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

@@ -19,21 +19,14 @@ class AnimatedAlignExampleApp extends StatelessWidget {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('AnimatedAlign Sample')),
body: const AnimatedAlignExample(
duration: duration,
curve: curve,
),
body: const AnimatedAlignExample(duration: duration, curve: curve),
),
);
}
}
class AnimatedAlignExample extends StatefulWidget {
const AnimatedAlignExample({
required this.duration,
required this.curve,
super.key,
});
const AnimatedAlignExample({required this.duration, required this.curve, super.key});
final Duration duration;

View File

@@ -18,13 +18,8 @@ class AnimatedFractionallySizedBoxExampleApp extends StatelessWidget {
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('AnimatedFractionallySizedBox Sample'),
),
body: const AnimatedFractionallySizedBoxExample(
duration: duration,
curve: curve,
),
appBar: AppBar(title: const Text('AnimatedFractionallySizedBox Sample')),
body: const AnimatedFractionallySizedBoxExample(duration: duration, curve: curve),
),
);
}
@@ -46,8 +41,7 @@ class AnimatedFractionallySizedBoxExample extends StatefulWidget {
_AnimatedFractionallySizedBoxExampleState();
}
class _AnimatedFractionallySizedBoxExampleState
extends State<AnimatedFractionallySizedBoxExample> {
class _AnimatedFractionallySizedBoxExampleState extends State<AnimatedFractionallySizedBoxExample> {
bool selected = false;
@override
@@ -70,10 +64,7 @@ class _AnimatedFractionallySizedBoxExampleState
alignment: selected ? Alignment.topLeft : Alignment.bottomRight,
duration: widget.duration,
curve: widget.curve,
child: const ColoredBox(
color: Colors.blue,
child: FlutterLogo(size: 75),
),
child: const ColoredBox(color: Colors.blue, child: FlutterLogo(size: 75)),
),
),
),

View File

@@ -54,10 +54,11 @@ class _AnimatedPaddingExampleState extends State<AnimatedPaddingExample> {
),
Text('Padding: $padValue'),
ElevatedButton(
child: const Text('Change padding'),
onPressed: () {
_updatePadding(padValue == 0.0 ? 100.0 : 0.0);
}),
child: const Text('Change padding'),
onPressed: () {
_updatePadding(padValue == 0.0 ? 100.0 : 0.0);
},
),
],
);
}

View File

@@ -19,31 +19,21 @@ class AnimatedPositionedExampleApp extends StatelessWidget {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('AnimatedPositioned Sample')),
body: const Center(
child: AnimatedPositionedExample(
duration: duration,
curve: curve,
),
),
body: const Center(child: AnimatedPositionedExample(duration: duration, curve: curve)),
),
);
}
}
class AnimatedPositionedExample extends StatefulWidget {
const AnimatedPositionedExample({
required this.duration,
required this.curve,
super.key,
});
const AnimatedPositionedExample({required this.duration, required this.curve, super.key});
final Duration duration;
final Curve curve;
@override
State<AnimatedPositionedExample> createState() =>
_AnimatedPositionedExampleState();
State<AnimatedPositionedExample> createState() => _AnimatedPositionedExampleState();
}
class _AnimatedPositionedExampleState extends State<AnimatedPositionedExample> {
@@ -68,10 +58,7 @@ class _AnimatedPositionedExampleState extends State<AnimatedPositionedExample> {
selected = !selected;
});
},
child: const ColoredBox(
color: Colors.blue,
child: Center(child: Text('Tap me')),
),
child: const ColoredBox(color: Colors.blue, child: Center(child: Text('Tap me'))),
),
),
],

View File

@@ -13,10 +13,7 @@ class AnimatedSlideApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(useMaterial3: true),
home: const AnimatedSlideExample(),
);
return MaterialApp(theme: ThemeData(useMaterial3: true), home: const AnimatedSlideExample());
}
}

View File

@@ -19,67 +19,54 @@ class SliverAnimatedOpacityExampleApp extends StatelessWidget {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('SliverAnimatedOpacity Sample')),
body: const Center(
child: SliverAnimatedOpacityExample(
duration: duration,
curve: curve,
),
),
body: const Center(child: SliverAnimatedOpacityExample(duration: duration, curve: curve)),
),
);
}
}
class SliverAnimatedOpacityExample extends StatefulWidget {
const SliverAnimatedOpacityExample({
required this.duration,
required this.curve,
super.key,
});
const SliverAnimatedOpacityExample({required this.duration, required this.curve, super.key});
final Duration duration;
final Curve curve;
@override
State<SliverAnimatedOpacityExample> createState() =>
_SliverAnimatedOpacityExampleState();
State<SliverAnimatedOpacityExample> createState() => _SliverAnimatedOpacityExampleState();
}
class _SliverAnimatedOpacityExampleState
extends State<SliverAnimatedOpacityExample>
class _SliverAnimatedOpacityExampleState extends State<SliverAnimatedOpacityExample>
with SingleTickerProviderStateMixin {
bool _visible = true;
@override
Widget build(BuildContext context) {
return CustomScrollView(slivers: <Widget>[
SliverAnimatedOpacity(
opacity: _visible ? 1.0 : 0.0,
duration: widget.duration,
curve: widget.curve,
sliver: SliverFixedExtentList(
itemExtent: 100.0,
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) {
return Container(
color: index.isEven ? Colors.indigo[200] : Colors.orange[200],
);
},
childCount: 5,
return CustomScrollView(
slivers: <Widget>[
SliverAnimatedOpacity(
opacity: _visible ? 1.0 : 0.0,
duration: widget.duration,
curve: widget.curve,
sliver: SliverFixedExtentList(
itemExtent: 100.0,
delegate: SliverChildBuilderDelegate((BuildContext context, int index) {
return Container(color: index.isEven ? Colors.indigo[200] : Colors.orange[200]);
}, childCount: 5),
),
),
),
SliverToBoxAdapter(
SliverToBoxAdapter(
child: FloatingActionButton(
onPressed: () {
setState(() {
_visible = !_visible;
});
},
tooltip: 'Toggle opacity',
child: const Icon(Icons.flip),
)),
]);
onPressed: () {
setState(() {
_visible = !_visible;
});
},
tooltip: 'Toggle opacity',
child: const Icon(Icons.flip),
),
),
],
);
}
}