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

@@ -14,9 +14,7 @@ class ExampleApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return const MaterialApp(
home: MyWidget(),
);
return const MaterialApp(home: MyWidget());
}
}
@@ -29,8 +27,32 @@ class MyWidget extends StatefulWidget {
class _MyWidgetState extends State<MyWidget> {
final List<String> alphabet = <String>[
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
'A',
'B',
'C',
'D',
'E',
'F',
'G',
'H',
'I',
'J',
'K',
'L',
'M',
'N',
'O',
'P',
'Q',
'R',
'S',
'T',
'U',
'V',
'W',
'X',
'Y',
'Z',
];
final Widget spacer = const SizedBox.square(dimension: 10);
ScrollDirection scrollDirection = ScrollDirection.idle;
@@ -38,9 +60,9 @@ class _MyWidgetState extends State<MyWidget> {
Widget _getArrows() {
final Widget arrow = switch (_axisDirection) {
AxisDirection.up => const Icon(Icons.arrow_upward_rounded),
AxisDirection.down => const Icon(Icons.arrow_downward_rounded),
AxisDirection.left => const Icon(Icons.arrow_back_rounded),
AxisDirection.up => const Icon(Icons.arrow_upward_rounded),
AxisDirection.down => const Icon(Icons.arrow_downward_rounded),
AxisDirection.left => const Icon(Icons.arrow_back_rounded),
AxisDirection.right => const Icon(Icons.arrow_forward_rounded),
};
return Flex(
@@ -84,9 +106,7 @@ class _MyWidgetState extends State<MyWidget> {
return DefaultTextStyle(
style: const TextStyle(fontWeight: FontWeight.bold, color: Colors.white),
child: RadioTheme(
data: RadioThemeData(
fillColor: WidgetStateProperty.all<Color>(Colors.white),
),
data: RadioThemeData(fillColor: WidgetStateProperty.all<Color>(Colors.white)),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
@@ -143,10 +163,7 @@ class _MyWidgetState extends State<MyWidget> {
title: const Text('ScrollDirections'),
bottom: PreferredSize(
preferredSize: const Size.fromHeight(50),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: _getRadioRow(),
),
child: Padding(padding: const EdgeInsets.all(8.0), child: _getRadioRow()),
),
),
body: NotificationListener<UserScrollNotification>(
@@ -174,10 +191,7 @@ class _MyWidgetState extends State<MyWidget> {
child: Center(child: Text(alphabet[index - 1])),
);
}
return Padding(
padding: const EdgeInsets.all(8.0),
child: child,
);
return Padding(padding: const EdgeInsets.all(8.0), child: child);
},
),
],