diff --git a/analysis_options.yaml b/analysis_options.yaml index 17d47a8d25..7b00ff6132 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -117,7 +117,7 @@ linter: # - prefer_constructors_over_static_methods # not yet tested - prefer_contains # - prefer_expression_function_bodies # conflicts with https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#consider-using--for-short-functions-and-methods - # - prefer_final_fields # https://github.com/dart-lang/linter/issues/506 + - prefer_final_fields - prefer_final_locals # - prefer_foreach # not yet tested # - prefer_function_declarations_over_variables # not yet tested @@ -127,7 +127,7 @@ linter: - prefer_is_not_empty # - prefer_single_quote_strings # not yet tested # - public_member_api_docs # this is the only difference from analysis_options_repo.yaml - # - recursive_getters # https://github.com/dart-lang/linter/issues/452 + - recursive_getters - slash_for_doc_comments - sort_constructors_first - sort_unnamed_constructors_first @@ -140,7 +140,7 @@ linter: # - unnecessary_lambdas # https://github.com/dart-lang/linter/issues/498 - unnecessary_null_aware_assignments - unnecessary_null_in_if_null_operators - # - unnecessary_overrides # https://github.com/dart-lang/linter/issues/626 and https://github.com/dart-lang/linter/issues/627 + - unnecessary_overrides - unnecessary_this - use_rethrow_when_possible # - use_setters_to_change_properties # not yet tested diff --git a/analysis_options_repo.yaml b/analysis_options_repo.yaml index 80f6c1c73d..bfeef2cd86 100644 --- a/analysis_options_repo.yaml +++ b/analysis_options_repo.yaml @@ -111,7 +111,7 @@ linter: # - prefer_constructors_over_static_methods # not yet tested - prefer_contains # - prefer_expression_function_bodies # conflicts with https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#consider-using--for-short-functions-and-methods - # - prefer_final_fields # https://github.com/dart-lang/linter/issues/506 + - prefer_final_fields - prefer_final_locals # - prefer_foreach # not yet tested # - prefer_function_declarations_over_variables # not yet tested @@ -121,7 +121,7 @@ linter: - prefer_is_not_empty # - prefer_single_quote_strings # not yet tested - public_member_api_docs # this is the only difference from analysis_options_repo.yaml - # - recursive_getters # https://github.com/dart-lang/linter/issues/452 + - recursive_getters - slash_for_doc_comments - sort_constructors_first - sort_unnamed_constructors_first @@ -134,7 +134,7 @@ linter: # - unnecessary_lambdas # https://github.com/dart-lang/linter/issues/498 - unnecessary_null_aware_assignments - unnecessary_null_in_if_null_operators - # - unnecessary_overrides # https://github.com/dart-lang/linter/issues/626 and https://github.com/dart-lang/linter/issues/627 + - unnecessary_overrides - unnecessary_this - use_rethrow_when_possible # - use_setters_to_change_properties # not yet tested diff --git a/dev/integration_tests/ui/lib/keyboard_resize.dart b/dev/integration_tests/ui/lib/keyboard_resize.dart index 9e6a9a9851..4638b6000c 100644 --- a/dev/integration_tests/ui/lib/keyboard_resize.dart +++ b/dev/integration_tests/ui/lib/keyboard_resize.dart @@ -32,7 +32,7 @@ class MyHomePage extends StatefulWidget { } class _MyHomePageState extends State { - TextEditingController _controller = new TextEditingController(); + final TextEditingController _controller = new TextEditingController(); @override Widget build(BuildContext context) { diff --git a/packages/flutter/lib/src/rendering/semantics.dart b/packages/flutter/lib/src/rendering/semantics.dart index 7e82c17615..67edc47e21 100644 --- a/packages/flutter/lib/src/rendering/semantics.dart +++ b/packages/flutter/lib/src/rendering/semantics.dart @@ -352,7 +352,7 @@ class SemanticsNode extends AbstractNode { } } - Set _tags = new Set(); + final Set _tags = new Set(); /// Tags the [SemanticsNode] with [tag]. /// diff --git a/packages/flutter_tools/lib/src/commands/fuchsia_reload.dart b/packages/flutter_tools/lib/src/commands/fuchsia_reload.dart index 9ec880569f..ea0069a907 100644 --- a/packages/flutter_tools/lib/src/commands/fuchsia_reload.dart +++ b/packages/flutter_tools/lib/src/commands/fuchsia_reload.dart @@ -132,7 +132,7 @@ class FuchsiaReloadCommand extends FlutterCommand { } // A cache of VMService connections. - HashMap _vmServiceCache = new HashMap(); + final HashMap _vmServiceCache = new HashMap(); VMService _getVMService(int port) { if (!_vmServiceCache.containsKey(port)) { diff --git a/packages/flutter_tools/test/src/mocks.dart b/packages/flutter_tools/test/src/mocks.dart index 3cbfdb3f41..84dcbebc8e 100644 --- a/packages/flutter_tools/test/src/mocks.dart +++ b/packages/flutter_tools/test/src/mocks.dart @@ -30,9 +30,9 @@ class MockApplicationPackageStore extends ApplicationPackageStore { } class MockPollingDeviceDiscovery extends PollingDeviceDiscovery { - List _devices = []; - StreamController _onAddedController = new StreamController.broadcast(); - StreamController _onRemovedController = new StreamController.broadcast(); + final List _devices = []; + final StreamController _onAddedController = new StreamController.broadcast(); + final StreamController _onRemovedController = new StreamController.broadcast(); MockPollingDeviceDiscovery() : super('mock');