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:
Michael Goderbauer
2024-12-19 12:06:21 -08:00
committed by GitHub
parent 8e0993eda8
commit 5491c8c146
4411 changed files with 455108 additions and 415991 deletions

View File

@@ -8,9 +8,7 @@ import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('IconButton increments volume when tapped', (WidgetTester tester) async {
await tester.pumpWidget(
const example.IconButtonExampleApp(),
);
await tester.pumpWidget(const example.IconButtonExampleApp());
expect(find.byIcon(Icons.volume_up), findsOneWidget);
expect(find.text('Volume : 0.0'), findsOneWidget);
@@ -22,9 +20,7 @@ void main() {
});
testWidgets('IconButton shows tooltip when long pressed', (WidgetTester tester) async {
await tester.pumpWidget(
const example.IconButtonExampleApp(),
);
await tester.pumpWidget(const example.IconButtonExampleApp());
expect(find.text('Increase volume by 10'), findsNothing);
await tester.longPress(find.byType(IconButton));

View File

@@ -8,18 +8,13 @@ import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('IconButton', (WidgetTester tester) async {
await tester.pumpWidget(
const example.IconButtonExampleApp(),
);
await tester.pumpWidget(const example.IconButtonExampleApp());
await tester.pumpAndSettle();
expect(find.byIcon(Icons.android), findsOneWidget);
final Ink ink = tester.widget<Ink>(
find.ancestor(
of: find.byIcon(Icons.android),
matching: find.byType(Ink),
),
find.ancestor(of: find.byIcon(Icons.android), matching: find.byType(Ink)),
);
final ShapeDecoration decoration = ink.decoration! as ShapeDecoration;
@@ -27,6 +22,6 @@ void main() {
expect(decoration.shape, const CircleBorder());
final IconButton iconButton = ink.child! as IconButton;
expect(iconButton.color, Colors.white) ;
expect(iconButton.color, Colors.white);
});
}

View File

@@ -8,9 +8,7 @@ import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('IconButton Types', (WidgetTester tester) async {
await tester.pumpWidget(
const example.IconButtonApp(),
);
await tester.pumpWidget(const example.IconButtonApp());
expect(find.widgetWithIcon(IconButton, Icons.filter_drama), findsNWidgets(8));
final Finder iconButtons = find.widgetWithIcon(IconButton, Icons.filter_drama);
for (int i = 0; i <= 3; i++) {

View File

@@ -8,9 +8,7 @@ import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('It should select and unselect the icon buttons', (WidgetTester tester) async {
await tester.pumpWidget(
const example.IconButtonToggleApp(),
);
await tester.pumpWidget(const example.IconButtonToggleApp());
expect(find.widgetWithIcon(IconButton, Icons.settings_outlined), findsExactly(8));
final Finder unselectedIconButtons = find.widgetWithIcon(IconButton, Icons.settings_outlined);