diff --git a/.analysis_options b/.analysis_options index bd0b82261b..bdd11969ab 100644 --- a/.analysis_options +++ b/.analysis_options @@ -66,7 +66,7 @@ linter: # === style rules === - always_declare_return_types - # - always_put_control_body_on_new_line # not yet tested + - always_put_control_body_on_new_line - always_require_non_null_named_parameters - always_specify_types - annotate_overrides diff --git a/.analysis_options_repo b/.analysis_options_repo index 2b148ddd18..a1c2af8036 100644 --- a/.analysis_options_repo +++ b/.analysis_options_repo @@ -64,7 +64,7 @@ linter: # === style rules === - always_declare_return_types - # - always_put_control_body_on_new_line # not yet tested + - always_put_control_body_on_new_line - always_require_non_null_named_parameters - always_specify_types - annotate_overrides diff --git a/dev/integration_tests/channels/lib/src/test_step.dart b/dev/integration_tests/channels/lib/src/test_step.dart index 1f65880580..bd7d58ed79 100644 --- a/dev/integration_tests/channels/lib/src/test_step.dart +++ b/dev/integration_tests/channels/lib/src/test_step.dart @@ -102,7 +102,8 @@ Future resultOfHandshake( dynamic error, ) async { assert(message != nothing); - while (received.length < 2) received.add(nothing); + while (received.length < 2) + received.add(nothing); TestStatus status; if (!_deepEquals(messageEcho, message) || received.length != 2 || @@ -136,11 +137,16 @@ String _toString(dynamic message) { } bool _deepEquals(dynamic a, dynamic b) { - if (a == b) return true; - if (a is double && a.isNaN) return b is double && b.isNaN; - if (a is ByteData) return b is ByteData && _deepEqualsByteData(a, b); - if (a is List) return b is List && _deepEqualsList(a, b); - if (a is Map) return b is Map && _deepEqualsMap(a, b); + if (a == b) + return true; + if (a is double && a.isNaN) + return b is double && b.isNaN; + if (a is ByteData) + return b is ByteData && _deepEqualsByteData(a, b); + if (a is List) + return b is List && _deepEqualsList(a, b); + if (a is Map) + return b is Map && _deepEqualsMap(a, b); return false; } @@ -152,17 +158,21 @@ bool _deepEqualsByteData(ByteData a, ByteData b) { } bool _deepEqualsList(List a, List b) { - if (a.length != b.length) return false; + if (a.length != b.length) + return false; for (int i = 0; i < a.length; i++) { - if (!_deepEquals(a[i], b[i])) return false; + if (!_deepEquals(a[i], b[i])) + return false; } return true; } bool _deepEqualsMap(Map a, Map b) { - if (a.length != b.length) return false; + if (a.length != b.length) + return false; for (dynamic key in a.keys) { - if (!b.containsKey(key) || !_deepEquals(a[key], b[key])) return false; + if (!b.containsKey(key) || !_deepEquals(a[key], b[key])) + return false; } return true; } diff --git a/examples/flutter_gallery/lib/demo/material/text_form_field_demo.dart b/examples/flutter_gallery/lib/demo/material/text_form_field_demo.dart index 64c5b35e7b..d1f3f3100b 100644 --- a/examples/flutter_gallery/lib/demo/material/text_form_field_demo.dart +++ b/examples/flutter_gallery/lib/demo/material/text_form_field_demo.dart @@ -206,19 +206,23 @@ class _UsNumberTextInputFormatter extends TextInputFormatter { final StringBuffer newText = new StringBuffer(); if (newTextLength >= 1) { newText.write('('); - if (newValue.selection.end >= 1) selectionIndex++; + if (newValue.selection.end >= 1) + selectionIndex++; } if (newTextLength >= 4) { newText.write(newValue.text.substring(0, usedSubstringIndex = 3) + ') '); - if (newValue.selection.end >= 3) selectionIndex += 2; + if (newValue.selection.end >= 3) + selectionIndex += 2; } if (newTextLength >= 7) { newText.write(newValue.text.substring(3, usedSubstringIndex = 6) + '-'); - if (newValue.selection.end >= 6) selectionIndex++; + if (newValue.selection.end >= 6) + selectionIndex++; } if (newTextLength >= 11) { newText.write(newValue.text.substring(6, usedSubstringIndex = 10) + ' '); - if (newValue.selection.end >= 10) selectionIndex++; + if (newValue.selection.end >= 10) + selectionIndex++; } // Dump the rest. if (newTextLength >= usedSubstringIndex) diff --git a/examples/platform_channel/test_driver/button_tap_test.dart b/examples/platform_channel/test_driver/button_tap_test.dart index 67ea6b86f9..adf5467fda 100644 --- a/examples/platform_channel/test_driver/button_tap_test.dart +++ b/examples/platform_channel/test_driver/button_tap_test.dart @@ -14,7 +14,8 @@ void main() { }); tearDownAll(() async { - if (driver != null) driver.close(); + if (driver != null) + driver.close(); }); test('tap on the button, verify result', () async {