Use curly_braces_in_flow_control_structures for non-flutter packages (#104629)

* Use `curly_braces_in_flow_control_structures` for `packages/flutter_driver`

* Use `curly_braces_in_flow_control_structures` for `packages/flutter_goldens`

* Use `curly_braces_in_flow_control_structures` for `packages/flutter_goldens_client`

* Use `curly_braces_in_flow_control_structures` for `packages/flutter_localizations`

* Use `curly_braces_in_flow_control_structures` for `packages/flutter_test`

* Use `curly_braces_in_flow_control_structures` for `packages/flutter_web_plugins`

* fix comments

* Use `curly_braces_in_flow_control_structures` for `packages/integration_test`

* fix indentation
This commit is contained in:
Pierre-Louis
2022-05-25 20:01:11 +02:00
committed by GitHub
parent a0248ebdf2
commit 74cfc3db67
34 changed files with 478 additions and 245 deletions

View File

@@ -416,12 +416,13 @@ void main() {
const String b = '$kSecondaryMouseButton';
for(int i = 0; i < logs.length; i++) {
if (i == 0)
if (i == 0) {
expect(logs[i], 'down $b');
else if (i != logs.length - 1)
} else if (i != logs.length - 1) {
expect(logs[i], 'move $b');
else
} else {
expect(logs[i], 'up 0');
}
}
},
);
@@ -472,12 +473,13 @@ void main() {
const String b = '$kSecondaryMouseButton';
for(int i = 0; i < logs.length; i++) {
if (i == 0)
if (i == 0) {
expect(logs[i], 'down $b');
else if (i != logs.length - 1)
} else if (i != logs.length - 1) {
expect(logs[i], 'move $b');
else
} else {
expect(logs[i], 'up 0');
}
}
},
);
@@ -503,12 +505,13 @@ void main() {
const String b = '$kSecondaryMouseButton';
for(int i = 0; i < logs.length; i++) {
if (i == 0)
if (i == 0) {
expect(logs[i], 'down $b');
else if (i != logs.length - 1)
} else if (i != logs.length - 1) {
expect(logs[i], 'move $b');
else
} else {
expect(logs[i], 'up 0');
}
}
},
);
@@ -535,12 +538,13 @@ void main() {
const String b = '$kSecondaryMouseButton';
for(int i = 0; i < logs.length; i++) {
if (i == 0)
if (i == 0) {
expect(logs[i], 'down $b');
else if (i != logs.length - 1)
} else if (i != logs.length - 1) {
expect(logs[i], 'move $b');
else
} else {
expect(logs[i], 'up 0');
}
}
},
);
@@ -599,12 +603,13 @@ void main() {
const String b = '$kSecondaryMouseButton';
for(int i = 0; i < logs.length; i++) {
if (i == 0)
if (i == 0) {
expect(logs[i], 'down $b');
else if (i != logs.length - 1)
} else if (i != logs.length - 1) {
expect(logs[i], 'move $b');
else
} else {
expect(logs[i], 'up 0');
}
}
},
);

View File

@@ -15,8 +15,9 @@ import 'package:flutter_test/flutter_test.dart';
class _MockToStringDeep {
_MockToStringDeep(String str) : _lines = <String>[] {
final List<String> lines = str.split('\n');
for (int i = 0; i < lines.length - 1; ++i)
for (int i = 0; i < lines.length - 1; ++i) {
_lines.add('${lines[i]}\n');
}
// If the last line is empty, that really just means that the previous
// line was terminated with a line break.
@@ -34,11 +35,13 @@ class _MockToStringDeep {
String toStringDeep({ String prefixLineOne = '', String prefixOtherLines = '' }) {
final StringBuffer sb = StringBuffer();
if (_lines.isNotEmpty)
if (_lines.isNotEmpty) {
sb.write('$prefixLineOne${_lines.first}');
}
for (int i = 1; i < _lines.length; ++i)
for (int i = 1; i < _lines.length; ++i) {
sb.write('$prefixOtherLines${_lines[i]}');
}
return sb.toString();
}
@@ -560,12 +563,15 @@ void main() {
int actions = 0;
int flags = 0;
const CustomSemanticsAction action = CustomSemanticsAction(label: 'test');
for (final int index in SemanticsAction.values.keys)
for (final int index in SemanticsAction.values.keys) {
actions |= index;
for (final int index in SemanticsFlag.values.keys)
}
for (final int index in SemanticsFlag.values.keys) {
// TODO(mdebbar): Remove this if after https://github.com/flutter/engine/pull/9894
if (SemanticsFlag.values[index] != SemanticsFlag.isMultiline)
if (SemanticsFlag.values[index] != SemanticsFlag.isMultiline) {
flags |= index;
}
}
final SemanticsData data = SemanticsData(
flags: flags,
actions: actions,