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,9 +13,7 @@ class ExampleApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return const MaterialApp(
home: ExampleWidget(),
);
return const MaterialApp(home: ExampleWidget());
}
}
@@ -39,36 +37,45 @@ class ExampleWidget extends StatelessWidget {
children: <Widget>[
const Spacer(flex: 5),
Text('regular numbers have their place:', style: titleStyle),
const Text('The 1972 cup final was a 1-1 draw.',
style: TextStyle(
fontFamily: 'Cardo',
fontSize: 24,
)),
const Text(
'The 1972 cup final was a 1-1 draw.',
style: TextStyle(fontFamily: 'Cardo', fontSize: 24),
),
const Spacer(),
Text('but old-style figures blend well with lower case:', style: titleStyle),
const Text('The 1972 cup final was a 1-1 draw.',
style: TextStyle(
fontFamily: 'Cardo', fontSize: 24, fontFeatures: <FontFeature>[FontFeature.oldstyleFigures()])),
const Text(
'The 1972 cup final was a 1-1 draw.',
style: TextStyle(
fontFamily: 'Cardo',
fontSize: 24,
fontFeatures: <FontFeature>[FontFeature.oldstyleFigures()],
),
),
const Spacer(),
const Divider(),
const Spacer(),
Text('fractions look better with a custom ligature:', style: titleStyle),
const Text('Add 1/2 tsp of flour and stir.',
style: TextStyle(
fontFamily: 'Milonga',
fontSize: 24,
fontFeatures: <FontFeature>[FontFeature.alternativeFractions()])),
const Text(
'Add 1/2 tsp of flour and stir.',
style: TextStyle(
fontFamily: 'Milonga',
fontSize: 24,
fontFeatures: <FontFeature>[FontFeature.alternativeFractions()],
),
),
const Spacer(),
const Divider(),
const Spacer(),
Text('multiple stylistic sets in one font:', style: titleStyle),
const Text('Raleway Dots', style: TextStyle(fontFamily: 'Raleway Dots', fontSize: 48)),
Text('Raleway Dots',
style: TextStyle(
fontFeatures: <FontFeature>[FontFeature.stylisticSet(1)],
fontFamily: 'Raleway Dots',
fontSize: 48,
)),
Text(
'Raleway Dots',
style: TextStyle(
fontFeatures: <FontFeature>[FontFeature.stylisticSet(1)],
fontFamily: 'Raleway Dots',
fontSize: 48,
),
),
const Spacer(flex: 5),
],
),

View File

@@ -31,9 +31,7 @@ class ExampleWidget extends StatelessWidget {
'Fractions: 1/2 2/3 3/4 4/5',
style: TextStyle(
fontFamily: 'Ubuntu Mono',
fontFeatures: <FontFeature>[
FontFeature.alternativeFractions(),
],
fontFeatures: <FontFeature>[FontFeature.alternativeFractions()],
),
);
}

View File

@@ -31,9 +31,7 @@ class ExampleWidget extends StatelessWidget {
'(A) [A] {A} «A» A/B A•B',
style: TextStyle(
fontFamily: 'Piazzolla',
fontFeatures: <FontFeature>[
FontFeature.caseSensitiveForms(),
],
fontFeatures: <FontFeature>[FontFeature.caseSensitiveForms()],
),
);
}

View File

@@ -31,9 +31,7 @@ class ExampleWidget extends StatelessWidget {
"Ooohh, we weren't going to tell him that.",
style: TextStyle(
fontFamily: 'Barriecito',
fontFeatures: <FontFeature>[
FontFeature.contextualAlternates(),
],
fontFeatures: <FontFeature>[FontFeature.contextualAlternates()],
),
);
}

View File

@@ -31,9 +31,7 @@ class ExampleWidget extends StatelessWidget {
'Fractions: 1/2 2/3 3/4 4/5',
style: TextStyle(
fontFamily: 'Piazzolla',
fontFeatures: <FontFeature>[
FontFeature.denominator(),
],
fontFeatures: <FontFeature>[FontFeature.denominator()],
),
);
}

View File

@@ -31,9 +31,7 @@ class ExampleWidget extends StatelessWidget {
'Fractions: 1/2 2/3 3/4 4/5',
style: TextStyle(
fontFamily: 'Ubuntu Mono',
fontFeatures: <FontFeature>[
FontFeature.fractions(),
],
fontFeatures: <FontFeature>[FontFeature.fractions()],
),
);
}

View File

@@ -31,9 +31,7 @@ class ExampleWidget extends StatelessWidget {
'CALL 311-555-2368 NOW!',
style: TextStyle(
fontFamily: 'Sorts Mill Goudy',
fontFeatures: <FontFeature>[
FontFeature.liningFigures(),
],
fontFeatures: <FontFeature>[FontFeature.liningFigures()],
),
);
}

View File

@@ -30,9 +30,7 @@ class ExampleWidget extends StatelessWidget {
return const Text(
'次 化 刃 直 入 令',
locale: Locale('zh', 'CN'), // or Locale('ja'), Locale('ko'), Locale('zh', 'TW'), etc
style: TextStyle(
fontFamily: 'Noto Sans',
),
style: TextStyle(fontFamily: 'Noto Sans'),
);
}
}

View File

@@ -32,9 +32,7 @@ class ExampleWidget extends StatelessWidget {
'Fractions: 1/2 2/3 3/4 4/5',
style: TextStyle(
fontFamily: 'Piazzolla',
fontFeatures: <FontFeature>[
FontFeature.numerators(),
],
fontFeatures: <FontFeature>[FontFeature.numerators()],
),
);
}

View File

@@ -31,9 +31,7 @@ class ExampleWidget extends StatelessWidget {
'Call 311-555-2368 now!',
style: TextStyle(
fontFamily: 'Piazzolla',
fontFeatures: <FontFeature>[
FontFeature.oldstyleFigures(),
],
fontFeatures: <FontFeature>[FontFeature.oldstyleFigures()],
),
);
}

View File

@@ -31,9 +31,7 @@ class ExampleWidget extends StatelessWidget {
'1st, 2nd, 3rd, 4th...',
style: TextStyle(
fontFamily: 'Piazzolla',
fontFeatures: <FontFeature>[
FontFeature.ordinalForms(),
],
fontFeatures: <FontFeature>[FontFeature.ordinalForms()],
),
);
}

View File

@@ -31,9 +31,7 @@ class ExampleWidget extends StatelessWidget {
'Call 311-555-2368 now!',
style: TextStyle(
fontFamily: 'Kufam',
fontFeatures: <FontFeature>[
FontFeature.proportionalFigures(),
],
fontFeatures: <FontFeature>[FontFeature.proportionalFigures()],
),
);
}

View File

@@ -31,9 +31,7 @@ class ExampleWidget extends StatelessWidget {
'C8H10N4O2',
style: TextStyle(
fontFamily: 'Piazzolla',
fontFeatures: <FontFeature>[
FontFeature.scientificInferiors(),
],
fontFeatures: <FontFeature>[FontFeature.scientificInferiors()],
),
);
}

View File

@@ -31,9 +31,7 @@ class ExampleWidget extends StatelessWidget {
'One million is: 1,000,000.00',
style: TextStyle(
fontFamily: 'Source Code Pro',
fontFeatures: <FontFeature>[
FontFeature.slashedZero(),
],
fontFeatures: <FontFeature>[FontFeature.slashedZero()],
),
);
}

View File

@@ -31,9 +31,7 @@ class ExampleWidget extends StatelessWidget {
r'Agile Game - $100 initial bet',
style: TextStyle(
fontFamily: 'Source Code Pro',
fontFeatures: <FontFeature>[
FontFeature.stylisticAlternates(),
],
fontFeatures: <FontFeature>[FontFeature.stylisticAlternates()],
),
);
}

View File

@@ -31,10 +31,7 @@ class ExampleWidget extends StatelessWidget {
'-> MCMXCVII <-', // 1997
style: TextStyle(
fontFamily: 'Piazzolla',
fontFeatures: <FontFeature>[
FontFeature.stylisticSet(1),
FontFeature.stylisticSet(2),
],
fontFeatures: <FontFeature>[FontFeature.stylisticSet(1), FontFeature.stylisticSet(2)],
),
);
}

View File

@@ -31,9 +31,7 @@ class ExampleWidget extends StatelessWidget {
'Line from x1,y1 to x2,y2',
style: TextStyle(
fontFamily: 'Piazzolla',
fontFeatures: <FontFeature>[
FontFeature.subscripts(),
],
fontFeatures: <FontFeature>[FontFeature.subscripts()],
),
);
}

View File

@@ -31,9 +31,7 @@ class ExampleWidget extends StatelessWidget {
'The isotope 238U decays to 206Pb',
style: TextStyle(
fontFamily: 'Sorts Mill Goudy',
fontFeatures: <FontFeature>[
FontFeature.superscripts(),
],
fontFeatures: <FontFeature>[FontFeature.superscripts()],
),
);
}

View File

@@ -31,9 +31,7 @@ class ExampleWidget extends StatelessWidget {
'Queer & Romantic',
style: TextStyle(
fontFamily: 'BioRhyme Expanded',
fontFeatures: <FontFeature>[
FontFeature.swash(),
],
fontFeatures: <FontFeature>[FontFeature.swash()],
),
);
}

View File

@@ -31,9 +31,7 @@ class ExampleWidget extends StatelessWidget {
'Call 311-555-2368 now!',
style: TextStyle(
fontFamily: 'Piazzolla',
fontFeatures: <FontFeature>[
FontFeature.tabularFigures(),
],
fontFeatures: <FontFeature>[FontFeature.tabularFigures()],
),
);
}