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 NavigationRailExampleApp extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const MaterialApp(
|
||||
home: NavRailExample(),
|
||||
);
|
||||
return const MaterialApp(home: NavRailExample());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,23 +45,25 @@ class _NavRailExampleState extends State<NavRailExample> {
|
||||
});
|
||||
},
|
||||
labelType: labelType,
|
||||
leading: showLeading
|
||||
? FloatingActionButton(
|
||||
elevation: 0,
|
||||
onPressed: () {
|
||||
// Add your onPressed code here!
|
||||
},
|
||||
child: const Icon(Icons.add),
|
||||
)
|
||||
: const SizedBox(),
|
||||
trailing: showTrailing
|
||||
? IconButton(
|
||||
onPressed: () {
|
||||
// Add your onPressed code here!
|
||||
},
|
||||
icon: const Icon(Icons.more_horiz_rounded),
|
||||
)
|
||||
: const SizedBox(),
|
||||
leading:
|
||||
showLeading
|
||||
? FloatingActionButton(
|
||||
elevation: 0,
|
||||
onPressed: () {
|
||||
// Add your onPressed code here!
|
||||
},
|
||||
child: const Icon(Icons.add),
|
||||
)
|
||||
: const SizedBox(),
|
||||
trailing:
|
||||
showTrailing
|
||||
? IconButton(
|
||||
onPressed: () {
|
||||
// Add your onPressed code here!
|
||||
},
|
||||
icon: const Icon(Icons.more_horiz_rounded),
|
||||
)
|
||||
: const SizedBox(),
|
||||
destinations: const <NavigationRailDestination>[
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.favorite_border),
|
||||
|
||||
@@ -13,10 +13,7 @@ class NavigationRailExampleApp extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
theme: ThemeData(useMaterial3: true),
|
||||
home: const NavRailExample(),
|
||||
);
|
||||
return MaterialApp(theme: ThemeData(useMaterial3: true), home: const NavRailExample());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,23 +46,25 @@ class _NavRailExampleState extends State<NavRailExample> {
|
||||
});
|
||||
},
|
||||
labelType: labelType,
|
||||
leading: showLeading
|
||||
? FloatingActionButton(
|
||||
elevation: 0,
|
||||
onPressed: () {
|
||||
// Add your onPressed code here!
|
||||
},
|
||||
child: const Icon(Icons.add),
|
||||
)
|
||||
: const SizedBox(),
|
||||
trailing: showTrailing
|
||||
? IconButton(
|
||||
onPressed: () {
|
||||
// Add your onPressed code here!
|
||||
},
|
||||
icon: const Icon(Icons.more_horiz_rounded),
|
||||
)
|
||||
: const SizedBox(),
|
||||
leading:
|
||||
showLeading
|
||||
? FloatingActionButton(
|
||||
elevation: 0,
|
||||
onPressed: () {
|
||||
// Add your onPressed code here!
|
||||
},
|
||||
child: const Icon(Icons.add),
|
||||
)
|
||||
: const SizedBox(),
|
||||
trailing:
|
||||
showTrailing
|
||||
? IconButton(
|
||||
onPressed: () {
|
||||
// Add your onPressed code here!
|
||||
},
|
||||
icon: const Icon(Icons.more_horiz_rounded),
|
||||
)
|
||||
: const SizedBox(),
|
||||
destinations: const <NavigationRailDestination>[
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.favorite_border),
|
||||
@@ -78,14 +77,8 @@ class _NavRailExampleState extends State<NavRailExample> {
|
||||
label: Text('Second'),
|
||||
),
|
||||
NavigationRailDestination(
|
||||
icon: Badge(
|
||||
label: Text('4'),
|
||||
child: Icon(Icons.star_border),
|
||||
),
|
||||
selectedIcon: Badge(
|
||||
label: Text('4'),
|
||||
child: Icon(Icons.star),
|
||||
),
|
||||
icon: Badge(label: Text('4'), child: Icon(Icons.star_border)),
|
||||
selectedIcon: Badge(label: Text('4'), child: Icon(Icons.star)),
|
||||
label: Text('Third'),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -15,11 +15,7 @@ class ExtendedAnimationExampleApp extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const MaterialApp(
|
||||
home: Scaffold(
|
||||
body: MyNavigationRail(),
|
||||
),
|
||||
);
|
||||
return const MaterialApp(home: Scaffold(body: MyNavigationRail()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,11 +37,13 @@ class _MyNavigationRailState extends State<MyNavigationRail> {
|
||||
NavigationRail(
|
||||
selectedIndex: _selectedIndex,
|
||||
extended: _extended,
|
||||
leading: MyNavigationRailFab(onPressed: () {
|
||||
setState(() {
|
||||
_extended = !_extended;
|
||||
});
|
||||
}),
|
||||
leading: MyNavigationRailFab(
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
_extended = !_extended;
|
||||
});
|
||||
},
|
||||
),
|
||||
onDestinationSelected: (int index) {
|
||||
setState(() {
|
||||
_selectedIndex = index;
|
||||
@@ -103,26 +101,22 @@ class MyNavigationRailFab extends StatelessWidget {
|
||||
// The extended fab has a shorter height than the regular fab.
|
||||
return Container(
|
||||
height: 56,
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: lerpDouble(0, 6, animation.value)!,
|
||||
),
|
||||
child: animation.value == 0
|
||||
? FloatingActionButton(
|
||||
onPressed: onPressed,
|
||||
child: const Icon(Icons.add),
|
||||
)
|
||||
: Align(
|
||||
alignment: AlignmentDirectional.centerStart,
|
||||
widthFactor: animation.value,
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.only(start: 8),
|
||||
child: FloatingActionButton.extended(
|
||||
icon: const Icon(Icons.add),
|
||||
label: const Text('CREATE'),
|
||||
onPressed: onPressed,
|
||||
padding: EdgeInsets.symmetric(vertical: lerpDouble(0, 6, animation.value)!),
|
||||
child:
|
||||
animation.value == 0
|
||||
? FloatingActionButton(onPressed: onPressed, child: const Icon(Icons.add))
|
||||
: Align(
|
||||
alignment: AlignmentDirectional.centerStart,
|
||||
widthFactor: animation.value,
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.only(start: 8),
|
||||
child: FloatingActionButton.extended(
|
||||
icon: const Icon(Icons.add),
|
||||
label: const Text('CREATE'),
|
||||
onPressed: onPressed,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user