use flutter_lints as linter

This commit is contained in:
Lorenzo Pichilli 2022-10-08 19:07:50 +02:00
parent 386bd2097e
commit abab589d80
28 changed files with 15 additions and 52 deletions

View File

@ -1,4 +1,4 @@
include: package:lints/recommended.yaml include: package:flutter_lints/flutter.yaml
linter: linter:
rules: rules:

View File

@ -10,20 +10,5 @@
include: package:flutter_lints/flutter.yaml include: package:flutter_lints/flutter.yaml
linter: linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at
# https://dart-lang.github.io/linter/lints/index.html.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules: rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule constant_identifier_names: ignore
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options

View File

@ -14,7 +14,7 @@ void customActionButton() {
].contains(defaultTargetPlatform); ].contains(defaultTargetPlatform);
test('add custom action button', () async { test('add custom action button', () async {
var chromeSafariBrowser = new MyChromeSafariBrowser(); var chromeSafariBrowser = MyChromeSafariBrowser();
var actionButtonIcon = var actionButtonIcon =
await rootBundle.load('test_assets/images/flutter-logo.png'); await rootBundle.load('test_assets/images/flutter-logo.png');
chromeSafariBrowser.setActionButton(ChromeSafariBrowserActionButton( chromeSafariBrowser.setActionButton(ChromeSafariBrowserActionButton(
@ -22,7 +22,7 @@ void customActionButton() {
description: 'Action Button description', description: 'Action Button description',
icon: actionButtonIcon.buffer.asUint8List(), icon: actionButtonIcon.buffer.asUint8List(),
action: (url, title) { action: (url, title) {
print('Action Button 1 clicked!');
})); }));
expect(chromeSafariBrowser.isOpened(), false); expect(chromeSafariBrowser.isOpened(), false);

View File

@ -15,12 +15,12 @@ void customMenuItem() {
].contains(defaultTargetPlatform); ].contains(defaultTargetPlatform);
test('add custom menu item', () async { test('add custom menu item', () async {
var chromeSafariBrowser = new MyChromeSafariBrowser(); var chromeSafariBrowser = MyChromeSafariBrowser();
chromeSafariBrowser.addMenuItem(ChromeSafariBrowserMenuItem( chromeSafariBrowser.addMenuItem(ChromeSafariBrowserMenuItem(
id: 2, id: 2,
label: 'Custom item menu 1', label: 'Custom item menu 1',
action: (url, title) { action: (url, title) {
print('Custom item menu 1 clicked!');
})); }));
expect(chromeSafariBrowser.isOpened(), false); expect(chromeSafariBrowser.isOpened(), false);

View File

@ -14,7 +14,7 @@ void customTabs() {
group('Custom Tabs', () { group('Custom Tabs', () {
test('single instance', () async { test('single instance', () async {
var chromeSafariBrowser = new MyChromeSafariBrowser(); var chromeSafariBrowser = MyChromeSafariBrowser();
expect(chromeSafariBrowser.isOpened(), false); expect(chromeSafariBrowser.isOpened(), false);
await chromeSafariBrowser.open( await chromeSafariBrowser.open(

View File

@ -8,7 +8,7 @@ import 'open_and_close.dart';
import 'trusted_web_activity.dart'; import 'trusted_web_activity.dart';
void main() { void main() {
final shouldSkip = kIsWeb; const shouldSkip = kIsWeb;
group('ChromeSafariBrowser', () { group('ChromeSafariBrowser', () {
openAndClose(); openAndClose();

View File

@ -15,7 +15,7 @@ void openAndClose() {
].contains(defaultTargetPlatform); ].contains(defaultTargetPlatform);
test('open and close', () async { test('open and close', () async {
var chromeSafariBrowser = new MyChromeSafariBrowser(); var chromeSafariBrowser = MyChromeSafariBrowser();
expect(chromeSafariBrowser.isOpened(), false); expect(chromeSafariBrowser.isOpened(), false);
await chromeSafariBrowser.open(url: TEST_URL_1); await chromeSafariBrowser.open(url: TEST_URL_1);

View File

@ -14,7 +14,7 @@ void trustedWebActivity() {
group('Trusted Web Activity', () { group('Trusted Web Activity', () {
test('basic', () async { test('basic', () async {
var chromeSafariBrowser = new MyChromeSafariBrowser(); var chromeSafariBrowser = MyChromeSafariBrowser();
expect(chromeSafariBrowser.isOpened(), false); expect(chromeSafariBrowser.isOpened(), false);
await chromeSafariBrowser.open( await chromeSafariBrowser.open(
@ -33,7 +33,7 @@ void trustedWebActivity() {
}); });
test('single instance', () async { test('single instance', () async {
var chromeSafariBrowser = new MyChromeSafariBrowser(); var chromeSafariBrowser = MyChromeSafariBrowser();
expect(chromeSafariBrowser.isOpened(), false); expect(chromeSafariBrowser.isOpened(), false);
await chromeSafariBrowser.open( await chromeSafariBrowser.open(

View File

@ -1,5 +1,4 @@
import 'dart:async'; import 'dart:async';
import 'dart:typed_data';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';

View File

@ -1,6 +1,5 @@
import 'dart:async'; import 'dart:async';
import 'dart:convert'; import 'dart:convert';
import 'dart:typed_data';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';

View File

@ -1,5 +1,4 @@
import 'dart:async'; import 'dart:async';
import 'dart:typed_data';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';

View File

@ -1,6 +1,5 @@
import 'dart:async'; import 'dart:async';
import 'dart:convert'; import 'dart:convert';
import 'dart:typed_data';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';

View File

@ -1,6 +1,5 @@
import 'dart:async'; import 'dart:async';
import 'dart:convert'; import 'dart:convert';
import 'dart:typed_data';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';

View File

@ -42,7 +42,7 @@ dev_dependencies:
# git: # git:
# url: https://github.com/flutter/plugins.git # url: https://github.com/flutter/plugins.git
# path: packages/integration_test # path: packages/integration_test
pedantic: ^1.8.0 flutter_lints: ^2.0.1
# For information on the generic Dart part of this file, see the # For information on the generic Dart part of this file, see the
# following page: https://www.dartlang.org/tools/pub/pubspec # following page: https://www.dartlang.org/tools/pub/pubspec

View File

@ -1,6 +1,5 @@
import 'dart:async'; import 'dart:async';
import 'dart:collection'; import 'dart:collection';
import 'dart:typed_data';
import 'dart:developer' as developer; import 'dart:developer' as developer;
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';

View File

@ -1,6 +1,5 @@
import 'dart:async'; import 'dart:async';
import 'dart:collection'; import 'dart:collection';
import 'dart:typed_data';
import 'dart:developer' as developer; import 'dart:developer' as developer;
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';

View File

@ -1,5 +1,4 @@
import 'dart:core'; import 'dart:core';
import 'dart:typed_data';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';

View File

@ -1,6 +1,4 @@
import 'dart:collection'; import 'dart:collection';
import 'dart:typed_data';
import 'dart:ui';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_inappwebview/src/util.dart'; import 'package:flutter_inappwebview/src/util.dart';
@ -14,7 +12,6 @@ import 'in_app_webview_controller.dart';
import 'in_app_webview_settings.dart'; import 'in_app_webview_settings.dart';
import '../pull_to_refresh/pull_to_refresh_controller.dart'; import '../pull_to_refresh/pull_to_refresh_controller.dart';
import '../pull_to_refresh/pull_to_refresh_settings.dart'; import '../pull_to_refresh/pull_to_refresh_settings.dart';
import '../util.dart';
import '../types/disposable.dart'; import '../types/disposable.dart';
///Class that represents a WebView in headless mode. ///Class that represents a WebView in headless mode.

View File

@ -1,6 +1,5 @@
import 'dart:async'; import 'dart:async';
import 'dart:collection'; import 'dart:collection';
import 'dart:typed_data';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';

View File

@ -1,14 +1,11 @@
import 'dart:io'; import 'dart:io';
import 'dart:collection'; import 'dart:collection';
import 'dart:typed_data';
import 'dart:convert'; import 'dart:convert';
import 'dart:core'; import 'dart:core';
import 'dart:developer' as developer; import 'dart:developer' as developer;
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
import 'android/in_app_webview_controller.dart'; import 'android/in_app_webview_controller.dart';
import 'apple/in_app_webview_controller.dart'; import 'apple/in_app_webview_controller.dart';

View File

@ -1,9 +1,6 @@
import 'dart:ui';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import '../types/requested_with_header_mode.dart';
import 'android/in_app_webview_options.dart'; import 'android/in_app_webview_options.dart';
import 'apple/in_app_webview_options.dart'; import 'apple/in_app_webview_options.dart';
import '../content_blocker.dart'; import '../content_blocker.dart';

View File

@ -1,4 +1,3 @@
import 'dart:ui';
import 'dart:developer' as developer; import 'dart:developer' as developer;
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';

View File

@ -7,6 +7,7 @@ part 'ajax_request_event_type.g.dart';
///Class used by [AjaxRequestEvent] class. ///Class used by [AjaxRequestEvent] class.
@ExchangeableEnum() @ExchangeableEnum()
class AjaxRequestEventType_ { class AjaxRequestEventType_ {
// ignore: unused_field
final String _value; final String _value;
const AjaxRequestEventType_._internal(this._value); const AjaxRequestEventType_._internal(this._value);

View File

@ -33,6 +33,7 @@ class ModalTransitionStyle_ {
@Deprecated("Use ModalTransitionStyle instead") @Deprecated("Use ModalTransitionStyle instead")
@ExchangeableEnum() @ExchangeableEnum()
class IOSUIModalTransitionStyle_ { class IOSUIModalTransitionStyle_ {
// ignore: unused_field
final int _value; final int _value;
const IOSUIModalTransitionStyle_._internal(this._value); const IOSUIModalTransitionStyle_._internal(this._value);

View File

@ -1,5 +1,3 @@
import 'dart:collection';
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart'; import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
import '../in_app_webview/webview.dart'; import '../in_app_webview/webview.dart';

View File

@ -1,6 +1,5 @@
import 'dart:async'; import 'dart:async';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
import 'in_app_web_view_web_element.dart'; import 'in_app_web_view_web_element.dart';
import '../util.dart'; import '../util.dart';

View File

@ -1,6 +1,4 @@
import 'dart:async'; import 'dart:async';
import 'dart:typed_data';
import 'dart:ui';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'dart:html'; import 'dart:html';
import 'dart:js' as js; import 'dart:js' as js;

View File

@ -20,7 +20,7 @@ dev_dependencies:
sdk: flutter sdk: flutter
flutter_driver: flutter_driver:
sdk: flutter sdk: flutter
lints: ^1.0.1 flutter_lints: ^2.0.1
build_runner: ^2.2.1 build_runner: ^2.2.1
generators: generators:
path: dev_packages/generators path: dev_packages/generators