Auto-format Framework (#160545)
This auto-formats all *.dart files in the repository outside of the `engine` subdirectory and enforces that these files stay formatted with a presubmit check. **Reviewers:** Please carefully review all the commits except for the one titled "formatted". The "formatted" commit was auto-generated by running `dev/tools/format.sh -a -f`. The other commits were hand-crafted to prepare the repo for the formatting change. I recommend reviewing the commits one-by-one via the "Commits" tab and avoiding Github's "Files changed" tab as it will likely slow down your browser because of the size of this PR. --------- Co-authored-by: Kate Lovett <katelovett@google.com> Co-authored-by: LongCatIsLooong <31859944+LongCatIsLooong@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
8e0993eda8
commit
5491c8c146
@@ -16,7 +16,10 @@ void main() {
|
||||
expect(find.byType(AlertDialog), findsNothing);
|
||||
expect(find.text('Thanks!'), findsNothing);
|
||||
expect(find.widgetWithText(TextButton, 'OK'), findsNothing);
|
||||
expect(find.text('You typed "$sampleText", which has the length ${sampleText.length}.'), findsNothing);
|
||||
expect(
|
||||
find.text('You typed "$sampleText", which has the length ${sampleText.length}.'),
|
||||
findsNothing,
|
||||
);
|
||||
|
||||
await tester.enterText(find.byType(TextField), sampleText);
|
||||
await tester.testTextInput.receiveAction(TextInputAction.done);
|
||||
@@ -24,6 +27,9 @@ void main() {
|
||||
expect(find.byType(AlertDialog), findsOneWidget);
|
||||
expect(find.text('Thanks!'), findsOneWidget);
|
||||
expect(find.widgetWithText(TextButton, 'OK'), findsOneWidget);
|
||||
expect(find.text('You typed "$sampleText", which has length ${sampleText.characters.length}.'), findsOneWidget);
|
||||
expect(
|
||||
find.text('You typed "$sampleText", which has length ${sampleText.characters.length}.'),
|
||||
findsOneWidget,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -15,27 +15,39 @@ void main() {
|
||||
expect(find.byType(example.FilledTextFieldExample), findsOneWidget);
|
||||
expect(find.byType(example.OutlinedTextFieldExample), findsOneWidget);
|
||||
|
||||
final TextField filled = tester.widget<TextField>(find.descendant(
|
||||
of: find.byType(example.FilledTextFieldExample),
|
||||
matching: find.byType(TextField),
|
||||
));
|
||||
expect(filled.decoration!.prefixIcon, isA<Icon>()
|
||||
.having((Icon icon) => icon.icon, 'icon', Icons.search));
|
||||
expect(filled.decoration!.suffixIcon, isA<Icon>()
|
||||
.having((Icon icon) => icon.icon, 'icon', Icons.clear));
|
||||
final TextField filled = tester.widget<TextField>(
|
||||
find.descendant(
|
||||
of: find.byType(example.FilledTextFieldExample),
|
||||
matching: find.byType(TextField),
|
||||
),
|
||||
);
|
||||
expect(
|
||||
filled.decoration!.prefixIcon,
|
||||
isA<Icon>().having((Icon icon) => icon.icon, 'icon', Icons.search),
|
||||
);
|
||||
expect(
|
||||
filled.decoration!.suffixIcon,
|
||||
isA<Icon>().having((Icon icon) => icon.icon, 'icon', Icons.clear),
|
||||
);
|
||||
expect(filled.decoration!.labelText, 'Filled');
|
||||
expect(filled.decoration!.hintText, 'hint text');
|
||||
expect(filled.decoration!.helperText, 'supporting text');
|
||||
expect(filled.decoration!.filled, true);
|
||||
|
||||
final TextField outlined = tester.widget<TextField>(find.descendant(
|
||||
of: find.byType(example.OutlinedTextFieldExample),
|
||||
matching: find.byType(TextField),
|
||||
));
|
||||
expect(outlined.decoration!.prefixIcon, isA<Icon>()
|
||||
.having((Icon icon) => icon.icon, 'icon', Icons.search));
|
||||
expect(outlined.decoration!.suffixIcon, isA<Icon>()
|
||||
.having((Icon icon) => icon.icon, 'icon', Icons.clear));
|
||||
final TextField outlined = tester.widget<TextField>(
|
||||
find.descendant(
|
||||
of: find.byType(example.OutlinedTextFieldExample),
|
||||
matching: find.byType(TextField),
|
||||
),
|
||||
);
|
||||
expect(
|
||||
outlined.decoration!.prefixIcon,
|
||||
isA<Icon>().having((Icon icon) => icon.icon, 'icon', Icons.search),
|
||||
);
|
||||
expect(
|
||||
outlined.decoration!.suffixIcon,
|
||||
isA<Icon>().having((Icon icon) => icon.icon, 'icon', Icons.clear),
|
||||
);
|
||||
expect(outlined.decoration!.labelText, 'Outlined');
|
||||
expect(outlined.decoration!.hintText, 'hint text');
|
||||
expect(outlined.decoration!.helperText, 'supporting text');
|
||||
|
||||
Reference in New Issue
Block a user