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

@@ -4,14 +4,13 @@
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter_api_samples/material/reorderable_list/reorderable_list_view.0.dart' as example;
import 'package:flutter_api_samples/material/reorderable_list/reorderable_list_view.0.dart'
as example;
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('Content is reordered after a drag', (WidgetTester tester) async {
await tester.pumpWidget(
const example.ReorderableApp(),
);
await tester.pumpWidget(const example.ReorderableApp());
bool item1IsBeforeItem2() {
final Iterable<Text> texts = tester.widgetList<Text>(find.byType(Text));

View File

@@ -4,14 +4,13 @@
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter_api_samples/material/reorderable_list/reorderable_list_view.1.dart' as example;
import 'package:flutter_api_samples/material/reorderable_list/reorderable_list_view.1.dart'
as example;
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('Dragged item color is updated', (WidgetTester tester) async {
await tester.pumpWidget(
const example.ReorderableApp(),
);
await tester.pumpWidget(const example.ReorderableApp());
final ThemeData theme = Theme.of(tester.element(find.byType(MaterialApp)));
@@ -19,10 +18,9 @@ void main() {
final TestGesture drag = await tester.startGesture(tester.getCenter(find.text('Item 1')));
await tester.pump(kLongPressTimeout + kPressTimeout);
await tester.pumpAndSettle();
final Material material = tester.widget<Material>(find.ancestor(
of: find.text('Item 1'),
matching: find.byType(Material),
));
final Material material = tester.widget<Material>(
find.ancestor(of: find.text('Item 1'), matching: find.byType(Material)),
);
expect(material.color, theme.colorScheme.secondary);
// Ends the drag gesture.

View File

@@ -4,17 +4,18 @@
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter_api_samples/material/reorderable_list/reorderable_list_view.2.dart' as example;
import 'package:flutter_api_samples/material/reorderable_list/reorderable_list_view.2.dart'
as example;
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('Dragged Card is elevated', (WidgetTester tester) async {
await tester.pumpWidget(
const example.ReorderableApp(),
);
await tester.pumpWidget(const example.ReorderableApp());
Card findCardOne() {
return tester.widget<Card>(find.ancestor(of: find.text('Card 1'), matching: find.byType(Card)));
return tester.widget<Card>(
find.ancestor(of: find.text('Card 1'), matching: find.byType(Card)),
);
}
// Card has default elevation when not dragged.

View File

@@ -17,9 +17,7 @@ void main() {
}
testWidgets('Reorder list item', (WidgetTester tester) async {
await tester.pumpWidget(
const example.ReorderableApp(),
);
await tester.pumpWidget(const example.ReorderableApp());
expect(tester.getCenter(find.text('Item 3')).dy, 280.0);
await longPressDrag(

View File

@@ -17,9 +17,7 @@ void main() {
}
testWidgets('Reorder list item', (WidgetTester tester) async {
await tester.pumpWidget(
const example.ReorderableApp(),
);
await tester.pumpWidget(const example.ReorderableApp());
expect(tester.getCenter(find.text('Item 3')).dy, 252.0);
await longPressDrag(