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 FutureBuilderExampleApp extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const MaterialApp(
|
||||
home: FutureBuilderExample(),
|
||||
);
|
||||
return const MaterialApp(home: FutureBuilderExample());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,11 +41,7 @@ class _FutureBuilderExampleState extends State<FutureBuilderExample> {
|
||||
List<Widget> children;
|
||||
if (snapshot.hasData) {
|
||||
children = <Widget>[
|
||||
const Icon(
|
||||
Icons.check_circle_outline,
|
||||
color: Colors.green,
|
||||
size: 60,
|
||||
),
|
||||
const Icon(Icons.check_circle_outline, color: Colors.green, size: 60),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 16),
|
||||
child: Text('Result: ${snapshot.data}'),
|
||||
@@ -55,11 +49,7 @@ class _FutureBuilderExampleState extends State<FutureBuilderExample> {
|
||||
];
|
||||
} else if (snapshot.hasError) {
|
||||
children = <Widget>[
|
||||
const Icon(
|
||||
Icons.error_outline,
|
||||
color: Colors.red,
|
||||
size: 60,
|
||||
),
|
||||
const Icon(Icons.error_outline, color: Colors.red, size: 60),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 16),
|
||||
child: Text('Error: ${snapshot.error}'),
|
||||
@@ -67,22 +57,12 @@ class _FutureBuilderExampleState extends State<FutureBuilderExample> {
|
||||
];
|
||||
} else {
|
||||
children = const <Widget>[
|
||||
SizedBox(
|
||||
width: 60,
|
||||
height: 60,
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 16),
|
||||
child: Text('Awaiting result...'),
|
||||
),
|
||||
SizedBox(width: 60, height: 60, child: CircularProgressIndicator()),
|
||||
Padding(padding: EdgeInsets.only(top: 16), child: Text('Awaiting result...')),
|
||||
];
|
||||
}
|
||||
return Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: children,
|
||||
),
|
||||
child: Column(mainAxisAlignment: MainAxisAlignment.center, children: children),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
@@ -17,17 +17,12 @@ class StreamBuilderExampleApp extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const MaterialApp(
|
||||
home: StreamBuilderExample(delay: delay),
|
||||
);
|
||||
return const MaterialApp(home: StreamBuilderExample(delay: delay));
|
||||
}
|
||||
}
|
||||
|
||||
class StreamBuilderExample extends StatefulWidget {
|
||||
const StreamBuilderExample({
|
||||
required this.delay,
|
||||
super.key,
|
||||
});
|
||||
const StreamBuilderExample({required this.delay, super.key});
|
||||
|
||||
final Duration delay;
|
||||
|
||||
@@ -77,10 +72,7 @@ class _StreamBuilderExampleState extends State<StreamBuilderExample> {
|
||||
}
|
||||
|
||||
class BidsStatus extends StatelessWidget {
|
||||
const BidsStatus({
|
||||
required this.bids,
|
||||
super.key,
|
||||
});
|
||||
const BidsStatus({required this.bids, super.key});
|
||||
|
||||
final Stream<int>? bids;
|
||||
|
||||
@@ -92,11 +84,7 @@ class BidsStatus extends StatelessWidget {
|
||||
List<Widget> children;
|
||||
if (snapshot.hasError) {
|
||||
children = <Widget>[
|
||||
const Icon(
|
||||
Icons.error_outline,
|
||||
color: Colors.red,
|
||||
size: 60,
|
||||
),
|
||||
const Icon(Icons.error_outline, color: Colors.red, size: 60),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 16),
|
||||
child: Text('Error: ${snapshot.error}'),
|
||||
@@ -114,63 +102,31 @@ class BidsStatus extends StatelessWidget {
|
||||
switch (snapshot.connectionState) {
|
||||
case ConnectionState.none:
|
||||
children = const <Widget>[
|
||||
Icon(
|
||||
Icons.info,
|
||||
color: Colors.blue,
|
||||
size: 60,
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 16),
|
||||
child: Text('Select a lot'),
|
||||
),
|
||||
Icon(Icons.info, color: Colors.blue, size: 60),
|
||||
Padding(padding: EdgeInsets.only(top: 16), child: Text('Select a lot')),
|
||||
];
|
||||
case ConnectionState.waiting:
|
||||
children = const <Widget>[
|
||||
SizedBox(
|
||||
width: 60,
|
||||
height: 60,
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 16),
|
||||
child: Text('Awaiting bids...'),
|
||||
),
|
||||
SizedBox(width: 60, height: 60, child: CircularProgressIndicator()),
|
||||
Padding(padding: EdgeInsets.only(top: 16), child: Text('Awaiting bids...')),
|
||||
];
|
||||
case ConnectionState.active:
|
||||
children = <Widget>[
|
||||
const Icon(
|
||||
Icons.check_circle_outline,
|
||||
color: Colors.green,
|
||||
size: 60,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 16),
|
||||
child: Text('\$${snapshot.data}'),
|
||||
),
|
||||
const Icon(Icons.check_circle_outline, color: Colors.green, size: 60),
|
||||
Padding(padding: const EdgeInsets.only(top: 16), child: Text('\$${snapshot.data}')),
|
||||
];
|
||||
case ConnectionState.done:
|
||||
children = <Widget>[
|
||||
const Icon(
|
||||
Icons.info,
|
||||
color: Colors.blue,
|
||||
size: 60,
|
||||
),
|
||||
const Icon(Icons.info, color: Colors.blue, size: 60),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 16),
|
||||
child: Text(
|
||||
snapshot.hasData
|
||||
? '\$${snapshot.data} (closed)'
|
||||
: '(closed)',
|
||||
),
|
||||
child: Text(snapshot.hasData ? '\$${snapshot.data} (closed)' : '(closed)'),
|
||||
),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: children,
|
||||
);
|
||||
return Column(mainAxisAlignment: MainAxisAlignment.center, children: children);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user