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

@@ -18,9 +18,7 @@ class WidgetStateBorderSideExampleApp extends StatelessWidget {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('WidgetStateBorderSide Sample')),
body: const Center(
child: WidgetStateBorderSideExample(),
),
body: const Center(child: WidgetStateBorderSideExample()),
),
);
}
@@ -46,15 +44,13 @@ class _WidgetStateBorderSideExampleState extends State<WidgetStateBorderSideExam
_isSelected = value;
});
},
side: const WidgetStateBorderSide.fromMap(
<WidgetStatesConstraint, BorderSide?>{
WidgetState.pressed: BorderSide(color: Colors.green),
WidgetState.hovered: BorderSide(color: Colors.blue),
WidgetState.selected: BorderSide(color: Colors.red),
// Resolves to null if no keys match, deferring to the default value
// of the theme or widget.
},
),
side: const WidgetStateBorderSide.fromMap(<WidgetStatesConstraint, BorderSide?>{
WidgetState.pressed: BorderSide(color: Colors.green),
WidgetState.hovered: BorderSide(color: Colors.blue),
WidgetState.selected: BorderSide(color: Colors.red),
// Resolves to null if no keys match, deferring to the default value
// of the theme or widget.
}),
);
}
}

View File

@@ -65,10 +65,7 @@ class _WidgetStateMouseCursorExampleState extends State<WidgetStateMouseCursorEx
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
'Enabled: ',
style: Theme.of(context).textTheme.titleSmall,
),
Text('Enabled: ', style: Theme.of(context).textTheme.titleSmall),
Switch(
value: _enabled,
onChanged: (_) {

View File

@@ -18,9 +18,7 @@ class WidgetStatePropertyExampleApp extends StatelessWidget {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('WidgetStateProperty Sample')),
body: const Center(
child: WidgetStatePropertyExample(),
),
body: const Center(child: WidgetStatePropertyExample()),
),
);
}
@@ -33,13 +31,11 @@ class WidgetStatePropertyExample extends StatelessWidget {
Widget build(BuildContext context) {
return TextButton(
style: ButtonStyle(
foregroundColor: WidgetStateProperty<Color>.fromMap(
<WidgetStatesConstraint, Color>{
WidgetState.focused: Colors.blueAccent,
WidgetState.pressed | WidgetState.hovered: Colors.blue,
WidgetState.any: Colors.red,
},
),
foregroundColor: WidgetStateProperty<Color>.fromMap(<WidgetStatesConstraint, Color>{
WidgetState.focused: Colors.blueAccent,
WidgetState.pressed | WidgetState.hovered: Colors.blue,
WidgetState.any: Colors.red,
}),
),
onPressed: () {},
child: const Text('TextButton'),