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
@@ -13,9 +13,7 @@ class ProgressIndicatorExampleApp extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const MaterialApp(
|
||||
home: ProgressIndicatorExample(),
|
||||
);
|
||||
return const MaterialApp(home: ProgressIndicatorExample());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,20 +24,20 @@ class ProgressIndicatorExample extends StatefulWidget {
|
||||
State<ProgressIndicatorExample> createState() => _ProgressIndicatorExampleState();
|
||||
}
|
||||
|
||||
class _ProgressIndicatorExampleState extends State<ProgressIndicatorExample> with TickerProviderStateMixin {
|
||||
class _ProgressIndicatorExampleState extends State<ProgressIndicatorExample>
|
||||
with TickerProviderStateMixin {
|
||||
late AnimationController controller;
|
||||
bool year2023 = true;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
controller = AnimationController(
|
||||
vsync: this,
|
||||
duration: const Duration(seconds: 5),
|
||||
)..addListener(() {
|
||||
setState(() {});
|
||||
})
|
||||
..repeat(reverse: true);
|
||||
controller =
|
||||
AnimationController(vsync: this, duration: const Duration(seconds: 5))
|
||||
..addListener(() {
|
||||
setState(() {});
|
||||
})
|
||||
..repeat(reverse: true);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -59,10 +57,7 @@ class _ProgressIndicatorExampleState extends State<ProgressIndicatorExample> wit
|
||||
const Text('Determinate CircularProgressIndicator'),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: CircularProgressIndicator(
|
||||
year2023: year2023,
|
||||
value: controller.value,
|
||||
),
|
||||
child: CircularProgressIndicator(year2023: year2023, value: controller.value),
|
||||
),
|
||||
const Text('Indeterminate CircularProgressIndicator'),
|
||||
Padding(
|
||||
@@ -71,7 +66,10 @@ class _ProgressIndicatorExampleState extends State<ProgressIndicatorExample> wit
|
||||
),
|
||||
SwitchListTile(
|
||||
value: year2023,
|
||||
title: year2023 ? const Text('Switch to latest M3 style') : const Text('Switch to year2023 M3 style'),
|
||||
title:
|
||||
year2023
|
||||
? const Text('Switch to latest M3 style')
|
||||
: const Text('Switch to year2023 M3 style'),
|
||||
onChanged: (bool value) {
|
||||
setState(() {
|
||||
year2023 = !year2023;
|
||||
|
||||
@@ -27,7 +27,8 @@ class ProgressIndicatorExample extends StatefulWidget {
|
||||
State<ProgressIndicatorExample> createState() => _ProgressIndicatorExampleState();
|
||||
}
|
||||
|
||||
class _ProgressIndicatorExampleState extends State<ProgressIndicatorExample> with TickerProviderStateMixin {
|
||||
class _ProgressIndicatorExampleState extends State<ProgressIndicatorExample>
|
||||
with TickerProviderStateMixin {
|
||||
late AnimationController controller;
|
||||
bool determinate = false;
|
||||
|
||||
@@ -39,8 +40,8 @@ class _ProgressIndicatorExampleState extends State<ProgressIndicatorExample> wit
|
||||
vsync: this,
|
||||
duration: const Duration(seconds: 2),
|
||||
)..addListener(() {
|
||||
setState(() {});
|
||||
});
|
||||
setState(() {});
|
||||
});
|
||||
controller.repeat(reverse: true);
|
||||
super.initState();
|
||||
}
|
||||
@@ -60,10 +61,7 @@ class _ProgressIndicatorExampleState extends State<ProgressIndicatorExample> wit
|
||||
spacing: 16.0,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
'Circular progress indicator',
|
||||
style: Theme.of(context).textTheme.titleLarge,
|
||||
),
|
||||
Text('Circular progress indicator', style: Theme.of(context).textTheme.titleLarge),
|
||||
CircularProgressIndicator(
|
||||
value: controller.value,
|
||||
semanticsLabel: 'Circular progress indicator',
|
||||
@@ -71,10 +69,7 @@ class _ProgressIndicatorExampleState extends State<ProgressIndicatorExample> wit
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Text(
|
||||
'determinate Mode',
|
||||
style: Theme.of(context).textTheme.titleSmall,
|
||||
),
|
||||
child: Text('determinate Mode', style: Theme.of(context).textTheme.titleSmall),
|
||||
),
|
||||
Switch(
|
||||
value: determinate,
|
||||
|
||||
@@ -13,9 +13,7 @@ class ProgressIndicatorExampleApp extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const MaterialApp(
|
||||
home: ProgressIndicatorExample(),
|
||||
);
|
||||
return const MaterialApp(home: ProgressIndicatorExample());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,26 +21,28 @@ class ProgressIndicatorExample extends StatefulWidget {
|
||||
const ProgressIndicatorExample({super.key});
|
||||
|
||||
@override
|
||||
State<ProgressIndicatorExample> createState() =>
|
||||
_ProgressIndicatorExampleState();
|
||||
State<ProgressIndicatorExample> createState() => _ProgressIndicatorExampleState();
|
||||
}
|
||||
|
||||
class _ProgressIndicatorExampleState extends State<ProgressIndicatorExample> with TickerProviderStateMixin {
|
||||
class _ProgressIndicatorExampleState extends State<ProgressIndicatorExample>
|
||||
with TickerProviderStateMixin {
|
||||
late AnimationController controller;
|
||||
bool year2023 = true;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
controller = AnimationController(
|
||||
/// [AnimationController]s can be created with `vsync: this` because of
|
||||
/// [TickerProviderStateMixin].
|
||||
vsync: this,
|
||||
duration: const Duration(seconds: 5),
|
||||
)..addListener(() {
|
||||
setState(() {});
|
||||
})
|
||||
..repeat(reverse: true);
|
||||
controller =
|
||||
AnimationController(
|
||||
/// [AnimationController]s can be created with `vsync: this` because of
|
||||
/// [TickerProviderStateMixin].
|
||||
vsync: this,
|
||||
duration: const Duration(seconds: 5),
|
||||
)
|
||||
..addListener(() {
|
||||
setState(() {});
|
||||
})
|
||||
..repeat(reverse: true);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -61,10 +61,7 @@ class _ProgressIndicatorExampleState extends State<ProgressIndicatorExample> wit
|
||||
const Text('Determinate LinearProgressIndicator'),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: LinearProgressIndicator(
|
||||
year2023: year2023,
|
||||
value: controller.value,
|
||||
),
|
||||
child: LinearProgressIndicator(year2023: year2023, value: controller.value),
|
||||
),
|
||||
const Text('Indeterminate LinearProgressIndicator'),
|
||||
Padding(
|
||||
@@ -73,7 +70,10 @@ class _ProgressIndicatorExampleState extends State<ProgressIndicatorExample> wit
|
||||
),
|
||||
SwitchListTile(
|
||||
value: year2023,
|
||||
title: year2023 ? const Text('Switch to latest M3 style') : const Text('Switch to year2023 M3 style'),
|
||||
title:
|
||||
year2023
|
||||
? const Text('Switch to latest M3 style')
|
||||
: const Text('Switch to year2023 M3 style'),
|
||||
onChanged: (bool value) {
|
||||
setState(() {
|
||||
year2023 = !year2023;
|
||||
|
||||
@@ -13,9 +13,7 @@ class ProgressIndicatorExampleApp extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const MaterialApp(
|
||||
home: ProgressIndicatorExample(),
|
||||
);
|
||||
return const MaterialApp(home: ProgressIndicatorExample());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,8 +21,7 @@ class ProgressIndicatorExample extends StatefulWidget {
|
||||
const ProgressIndicatorExample({super.key});
|
||||
|
||||
@override
|
||||
State<ProgressIndicatorExample> createState() =>
|
||||
_ProgressIndicatorExampleState();
|
||||
State<ProgressIndicatorExample> createState() => _ProgressIndicatorExampleState();
|
||||
}
|
||||
|
||||
class _ProgressIndicatorExampleState extends State<ProgressIndicatorExample>
|
||||
@@ -35,15 +32,17 @@ class _ProgressIndicatorExampleState extends State<ProgressIndicatorExample>
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
controller = AnimationController(
|
||||
/// [AnimationController]s can be created with `vsync: this` because of
|
||||
/// [TickerProviderStateMixin].
|
||||
vsync: this,
|
||||
duration: const Duration(seconds: 2),
|
||||
)..addListener(() {
|
||||
setState(() {});
|
||||
})
|
||||
..repeat(reverse: true);
|
||||
controller =
|
||||
AnimationController(
|
||||
/// [AnimationController]s can be created with `vsync: this` because of
|
||||
/// [TickerProviderStateMixin].
|
||||
vsync: this,
|
||||
duration: const Duration(seconds: 2),
|
||||
)
|
||||
..addListener(() {
|
||||
setState(() {});
|
||||
})
|
||||
..repeat(reverse: true);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -61,10 +60,7 @@ class _ProgressIndicatorExampleState extends State<ProgressIndicatorExample>
|
||||
spacing: 16.0,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
const Text(
|
||||
'Linear progress indicator',
|
||||
style: TextStyle(fontSize: 20),
|
||||
),
|
||||
const Text('Linear progress indicator', style: TextStyle(fontSize: 20)),
|
||||
LinearProgressIndicator(
|
||||
value: determinate ? controller.value : null,
|
||||
semanticsLabel: 'Linear progress indicator',
|
||||
|
||||
Reference in New Issue
Block a user