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

@@ -13,10 +13,7 @@ class TabBarApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(useMaterial3: true),
home: const TabBarExample(),
);
return MaterialApp(theme: ThemeData(useMaterial3: true), home: const TabBarExample());
}
}
@@ -33,29 +30,17 @@ class TabBarExample extends StatelessWidget {
title: const Text('TabBar Sample'),
bottom: const TabBar(
tabs: <Widget>[
Tab(
icon: Icon(Icons.cloud_outlined),
),
Tab(
icon: Icon(Icons.beach_access_sharp),
),
Tab(
icon: Icon(Icons.brightness_5_sharp),
),
Tab(icon: Icon(Icons.cloud_outlined)),
Tab(icon: Icon(Icons.beach_access_sharp)),
Tab(icon: Icon(Icons.brightness_5_sharp)),
],
),
),
body: const TabBarView(
children: <Widget>[
Center(
child: Text("It's cloudy here"),
),
Center(
child: Text("It's rainy here"),
),
Center(
child: Text("It's sunny here"),
),
Center(child: Text("It's cloudy here")),
Center(child: Text("It's rainy here")),
Center(child: Text("It's sunny here")),
],
),
),

View File

@@ -13,10 +13,7 @@ class TabBarApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(useMaterial3: true),
home: const TabBarExample(),
);
return MaterialApp(theme: ThemeData(useMaterial3: true), home: const TabBarExample());
}
}
@@ -52,30 +49,18 @@ class _TabBarExampleState extends State<TabBarExample> with TickerProviderStateM
bottom: TabBar(
controller: _tabController,
tabs: const <Widget>[
Tab(
icon: Icon(Icons.cloud_outlined),
),
Tab(
icon: Icon(Icons.beach_access_sharp),
),
Tab(
icon: Icon(Icons.brightness_5_sharp),
),
Tab(icon: Icon(Icons.cloud_outlined)),
Tab(icon: Icon(Icons.beach_access_sharp)),
Tab(icon: Icon(Icons.brightness_5_sharp)),
],
),
),
body: TabBarView(
controller: _tabController,
children: const <Widget>[
Center(
child: Text("It's cloudy here"),
),
Center(
child: Text("It's rainy here"),
),
Center(
child: Text("It's sunny here"),
),
Center(child: Text("It's cloudy here")),
Center(child: Text("It's rainy here")),
Center(child: Text("It's sunny here")),
],
),
);

View File

@@ -13,10 +13,7 @@ class TabBarApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(useMaterial3: true),
home: const TabBarExample(),
);
return MaterialApp(theme: ThemeData(useMaterial3: true), home: const TabBarExample());
}
}
@@ -34,18 +31,9 @@ class TabBarExample extends StatelessWidget {
bottom: const TabBar(
dividerColor: Colors.transparent,
tabs: <Widget>[
Tab(
text: 'Flights',
icon: Icon(Icons.flight),
),
Tab(
text: 'Trips',
icon: Icon(Icons.luggage),
),
Tab(
text: 'Explore',
icon: Icon(Icons.explore),
),
Tab(text: 'Flights', icon: Icon(Icons.flight)),
Tab(text: 'Trips', icon: Icon(Icons.luggage)),
Tab(text: 'Explore', icon: Icon(Icons.explore)),
],
),
),
@@ -91,10 +79,7 @@ class _NestedTabBarState extends State<NestedTabBar> with TickerProviderStateMix
children: <Widget>[
TabBar.secondary(
controller: _tabController,
tabs: const <Widget>[
Tab(text: 'Overview'),
Tab(text: 'Specifications'),
],
tabs: const <Widget>[Tab(text: 'Overview'), Tab(text: 'Specifications')],
),
Expanded(
child: TabBarView(

View File

@@ -13,16 +13,15 @@ class IndicatorAnimationExampleApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return const MaterialApp(
home: IndicatorAnimationExample(),
);
return const MaterialApp(home: IndicatorAnimationExample());
}
}
const List<(TabIndicatorAnimation, String)> indicatorAnimationSegments = <(TabIndicatorAnimation, String)>[
(TabIndicatorAnimation.linear, 'Linear'),
(TabIndicatorAnimation.elastic, 'Elastic'),
];
const List<(TabIndicatorAnimation, String)> indicatorAnimationSegments =
<(TabIndicatorAnimation, String)>[
(TabIndicatorAnimation.linear, 'Linear'),
(TabIndicatorAnimation.elastic, 'Elastic'),
];
class IndicatorAnimationExample extends StatefulWidget {
const IndicatorAnimationExample({super.key});
@@ -32,7 +31,9 @@ class IndicatorAnimationExample extends StatefulWidget {
}
class _IndicatorAnimationExampleState extends State<IndicatorAnimationExample> {
Set<TabIndicatorAnimation> _animationStyleSelection = <TabIndicatorAnimation>{TabIndicatorAnimation.linear};
Set<TabIndicatorAnimation> _animationStyleSelection = <TabIndicatorAnimation>{
TabIndicatorAnimation.linear,
};
TabIndicatorAnimation _tabIndicatorAnimation = TabIndicatorAnimation.linear;
@override
@@ -67,34 +68,26 @@ class _IndicatorAnimationExampleState extends State<IndicatorAnimationExample> {
_tabIndicatorAnimation = styles.first;
});
},
segments: indicatorAnimationSegments
.map<ButtonSegment<TabIndicatorAnimation>>(((TabIndicatorAnimation, String) shirt) {
return ButtonSegment<TabIndicatorAnimation>(value: shirt.$1, label: Text(shirt.$2));
})
.toList(),
segments:
indicatorAnimationSegments.map<ButtonSegment<TabIndicatorAnimation>>((
(TabIndicatorAnimation, String) shirt,
) {
return ButtonSegment<TabIndicatorAnimation>(
value: shirt.$1,
label: Text(shirt.$2),
);
}).toList(),
),
const SizedBox(height: 16),
const Expanded(
child: TabBarView(
children: <Widget>[
Center(
child: Text('Short Tab Page'),
),
Center(
child: Text('Very Very Very Long Tab Page'),
),
Center(
child: Text('Short Tab Page'),
),
Center(
child: Text('Very Very Very Long Tab Page'),
),
Center(
child: Text('Short Tab Page'),
),
Center(
child: Text('Very Very Very Long Tab Page'),
),
Center(child: Text('Short Tab Page')),
Center(child: Text('Very Very Very Long Tab Page')),
Center(child: Text('Short Tab Page')),
Center(child: Text('Very Very Very Long Tab Page')),
Center(child: Text('Short Tab Page')),
Center(child: Text('Very Very Very Long Tab Page')),
],
),
),