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
@@ -68,9 +68,7 @@ class _NavigationDrawerExampleState extends State<NavigationDrawerExample> {
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Text('Page Index = $screenIndex'),
|
||||
],
|
||||
children: <Widget>[Text('Page Index = $screenIndex')],
|
||||
),
|
||||
),
|
||||
bottomNavigationBar: NavigationBar(
|
||||
@@ -80,16 +78,15 @@ class _NavigationDrawerExampleState extends State<NavigationDrawerExample> {
|
||||
screenIndex = index;
|
||||
});
|
||||
},
|
||||
destinations: destinations.map(
|
||||
(ExampleDestination destination) {
|
||||
return NavigationDestination(
|
||||
label: destination.label,
|
||||
icon: destination.icon,
|
||||
selectedIcon: destination.selectedIcon,
|
||||
tooltip: destination.label,
|
||||
);
|
||||
},
|
||||
).toList(),
|
||||
destinations:
|
||||
destinations.map((ExampleDestination destination) {
|
||||
return NavigationDestination(
|
||||
label: destination.label,
|
||||
icon: destination.icon,
|
||||
selectedIcon: destination.selectedIcon,
|
||||
tooltip: destination.label,
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -106,15 +103,14 @@ class _NavigationDrawerExampleState extends State<NavigationDrawerExample> {
|
||||
padding: const EdgeInsets.symmetric(horizontal: 5),
|
||||
child: NavigationRail(
|
||||
minWidth: 50,
|
||||
destinations: destinations.map(
|
||||
(ExampleDestination destination) {
|
||||
return NavigationRailDestination(
|
||||
label: Text(destination.label),
|
||||
icon: destination.icon,
|
||||
selectedIcon: destination.selectedIcon,
|
||||
);
|
||||
},
|
||||
).toList(),
|
||||
destinations:
|
||||
destinations.map((ExampleDestination destination) {
|
||||
return NavigationRailDestination(
|
||||
label: Text(destination.label),
|
||||
icon: destination.icon,
|
||||
selectedIcon: destination.selectedIcon,
|
||||
);
|
||||
}).toList(),
|
||||
selectedIndex: screenIndex,
|
||||
useIndicator: true,
|
||||
onDestinationSelected: (int index) {
|
||||
@@ -130,10 +126,7 @@ class _NavigationDrawerExampleState extends State<NavigationDrawerExample> {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Text('Page Index = $screenIndex'),
|
||||
ElevatedButton(
|
||||
onPressed: openDrawer,
|
||||
child: const Text('Open Drawer'),
|
||||
),
|
||||
ElevatedButton(onPressed: openDrawer, child: const Text('Open Drawer')),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -146,24 +139,16 @@ class _NavigationDrawerExampleState extends State<NavigationDrawerExample> {
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(28, 16, 16, 10),
|
||||
child: Text(
|
||||
'Header',
|
||||
style: Theme.of(context).textTheme.titleSmall,
|
||||
),
|
||||
),
|
||||
...destinations.map(
|
||||
(ExampleDestination destination) {
|
||||
return NavigationDrawerDestination(
|
||||
label: Text(destination.label),
|
||||
icon: destination.icon,
|
||||
selectedIcon: destination.selectedIcon,
|
||||
);
|
||||
},
|
||||
),
|
||||
const Padding(
|
||||
padding: EdgeInsets.fromLTRB(28, 16, 28, 10),
|
||||
child: Divider(),
|
||||
child: Text('Header', style: Theme.of(context).textTheme.titleSmall),
|
||||
),
|
||||
...destinations.map((ExampleDestination destination) {
|
||||
return NavigationDrawerDestination(
|
||||
label: Text(destination.label),
|
||||
icon: destination.icon,
|
||||
selectedIcon: destination.selectedIcon,
|
||||
);
|
||||
}),
|
||||
const Padding(padding: EdgeInsets.fromLTRB(28, 16, 28, 10), child: Divider()),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user