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

@@ -8,20 +8,22 @@ import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('shows font features', (WidgetTester tester) async {
await tester.pumpWidget(
const MaterialApp(
home: example.ExampleWidget(),
),
);
await tester.pumpWidget(const MaterialApp(home: example.ExampleWidget()));
expect(find.byType(Text), findsNWidgets(9));
expect((tester.widget(find.byType(Text).at(0)) as Text).style!.fontSize, equals(18.0));
expect((tester.widget(find.byType(Text).at(1)) as Text).style!.fontFamily, equals('Cardo'));
expect((tester.widget(find.byType(Text).at(3)) as Text).style!.fontFeatures,
equals(const <FontFeature>[FontFeature.oldstyleFigures()]));
expect((tester.widget(find.byType(Text).at(5)) as Text).style!.fontFeatures,
equals(const <FontFeature>[FontFeature.alternativeFractions()]));
expect((tester.widget(find.byType(Text).at(8)) as Text).style!.fontFeatures,
equals(<FontFeature>[FontFeature.stylisticSet(1)]));
expect(
(tester.widget(find.byType(Text).at(3)) as Text).style!.fontFeatures,
equals(const <FontFeature>[FontFeature.oldstyleFigures()]),
);
expect(
(tester.widget(find.byType(Text).at(5)) as Text).style!.fontFeatures,
equals(const <FontFeature>[FontFeature.alternativeFractions()]),
);
expect(
(tester.widget(find.byType(Text).at(8)) as Text).style!.fontFeatures,
equals(<FontFeature>[FontFeature.stylisticSet(1)]),
);
});
}

View File

@@ -3,20 +3,19 @@
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:flutter_api_samples/ui/text/font_feature.font_feature_alternative.0.dart' as example;
import 'package:flutter_api_samples/ui/text/font_feature.font_feature_alternative.0.dart'
as example;
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('shows font features', (WidgetTester tester) async {
await tester.pumpWidget(
const MaterialApp(
home: example.ExampleWidget(),
),
);
await tester.pumpWidget(const MaterialApp(home: example.ExampleWidget()));
expect(find.byType(Text), findsOneWidget);
expect((tester.widget(find.byType(Text).first) as Text).style!.fontFamily, equals('Raleway'));
expect((tester.widget(find.byType(Text).first) as Text).style!.fontFeatures,
equals(const <FontFeature>[FontFeature.alternative(1)]));
expect(
(tester.widget(find.byType(Text).first) as Text).style!.fontFeatures,
equals(const <FontFeature>[FontFeature.alternative(1)]),
);
});
}

View File

@@ -3,20 +3,22 @@
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:flutter_api_samples/ui/text/font_feature.font_feature_alternative_fractions.0.dart' as example;
import 'package:flutter_api_samples/ui/text/font_feature.font_feature_alternative_fractions.0.dart'
as example;
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('shows font features', (WidgetTester tester) async {
await tester.pumpWidget(
const MaterialApp(
home: example.ExampleWidget(),
),
);
await tester.pumpWidget(const MaterialApp(home: example.ExampleWidget()));
expect(find.byType(Text), findsOneWidget);
expect((tester.widget(find.byType(Text).first) as Text).style!.fontFamily, equals('Ubuntu Mono'));
expect((tester.widget(find.byType(Text).first) as Text).style!.fontFeatures,
equals(const <FontFeature>[FontFeature.alternativeFractions()]));
expect(
(tester.widget(find.byType(Text).first) as Text).style!.fontFamily,
equals('Ubuntu Mono'),
);
expect(
(tester.widget(find.byType(Text).first) as Text).style!.fontFeatures,
equals(const <FontFeature>[FontFeature.alternativeFractions()]),
);
});
}

View File

@@ -3,20 +3,19 @@
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:flutter_api_samples/ui/text/font_feature.font_feature_case_sensitive_forms.0.dart' as example;
import 'package:flutter_api_samples/ui/text/font_feature.font_feature_case_sensitive_forms.0.dart'
as example;
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('shows font features', (WidgetTester tester) async {
await tester.pumpWidget(
const MaterialApp(
home: example.ExampleWidget(),
),
);
await tester.pumpWidget(const MaterialApp(home: example.ExampleWidget()));
expect(find.byType(Text), findsOneWidget);
expect((tester.widget(find.byType(Text).first) as Text).style!.fontFamily, equals('Piazzolla'));
expect((tester.widget(find.byType(Text).first) as Text).style!.fontFeatures,
equals(const <FontFeature>[FontFeature.caseSensitiveForms()]));
expect(
(tester.widget(find.byType(Text).first) as Text).style!.fontFeatures,
equals(const <FontFeature>[FontFeature.caseSensitiveForms()]),
);
});
}

View File

@@ -3,25 +3,26 @@
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:flutter_api_samples/ui/text/font_feature.font_feature_character_variant.0.dart' as example;
import 'package:flutter_api_samples/ui/text/font_feature.font_feature_character_variant.0.dart'
as example;
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('shows font features', (WidgetTester tester) async {
await tester.pumpWidget(
const MaterialApp(
home: example.ExampleWidget(),
),
);
await tester.pumpWidget(const MaterialApp(home: example.ExampleWidget()));
expect(find.byType(Text), findsOneWidget);
expect((tester.widget(find.byType(Text).first) as Text).style!.fontFamily, equals('Source Code Pro'));
expect(
(tester.widget(find.byType(Text).first) as Text).style!.fontFeatures,
equals(<FontFeature>[
FontFeature.characterVariant(1),
FontFeature.characterVariant(2),
FontFeature.characterVariant(4),
]));
(tester.widget(find.byType(Text).first) as Text).style!.fontFamily,
equals('Source Code Pro'),
);
expect(
(tester.widget(find.byType(Text).first) as Text).style!.fontFeatures,
equals(<FontFeature>[
FontFeature.characterVariant(1),
FontFeature.characterVariant(2),
FontFeature.characterVariant(4),
]),
);
});
}

View File

@@ -3,20 +3,22 @@
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:flutter_api_samples/ui/text/font_feature.font_feature_contextual_alternates.0.dart' as example;
import 'package:flutter_api_samples/ui/text/font_feature.font_feature_contextual_alternates.0.dart'
as example;
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('shows font features', (WidgetTester tester) async {
await tester.pumpWidget(
const MaterialApp(
home: example.ExampleWidget(),
),
);
await tester.pumpWidget(const MaterialApp(home: example.ExampleWidget()));
expect(find.byType(Text), findsOneWidget);
expect((tester.widget(find.byType(Text).first) as Text).style!.fontFamily, equals('Barriecito'));
expect((tester.widget(find.byType(Text).first) as Text).style!.fontFeatures,
equals(const <FontFeature>[FontFeature.contextualAlternates()]));
expect(
(tester.widget(find.byType(Text).first) as Text).style!.fontFamily,
equals('Barriecito'),
);
expect(
(tester.widget(find.byType(Text).first) as Text).style!.fontFeatures,
equals(const <FontFeature>[FontFeature.contextualAlternates()]),
);
});
}

View File

@@ -3,20 +3,19 @@
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:flutter_api_samples/ui/text/font_feature.font_feature_denominator.0.dart' as example;
import 'package:flutter_api_samples/ui/text/font_feature.font_feature_denominator.0.dart'
as example;
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('shows font features', (WidgetTester tester) async {
await tester.pumpWidget(
const MaterialApp(
home: example.ExampleWidget(),
),
);
await tester.pumpWidget(const MaterialApp(home: example.ExampleWidget()));
expect(find.byType(Text), findsOneWidget);
expect((tester.widget(find.byType(Text).first) as Text).style!.fontFamily, equals('Piazzolla'));
expect((tester.widget(find.byType(Text).first) as Text).style!.fontFeatures,
equals(const <FontFeature>[FontFeature.denominator()]));
expect(
(tester.widget(find.byType(Text).first) as Text).style!.fontFeatures,
equals(const <FontFeature>[FontFeature.denominator()]),
);
});
}

View File

@@ -8,15 +8,16 @@ import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('shows font features', (WidgetTester tester) async {
await tester.pumpWidget(
const MaterialApp(
home: example.ExampleWidget(),
),
);
await tester.pumpWidget(const MaterialApp(home: example.ExampleWidget()));
expect(find.byType(Text), findsOneWidget);
expect((tester.widget(find.byType(Text).first) as Text).style!.fontFamily, equals('Ubuntu Mono'));
expect((tester.widget(find.byType(Text).first) as Text).style!.fontFeatures,
equals(const <FontFeature>[FontFeature.fractions()]));
expect(
(tester.widget(find.byType(Text).first) as Text).style!.fontFamily,
equals('Ubuntu Mono'),
);
expect(
(tester.widget(find.byType(Text).first) as Text).style!.fontFeatures,
equals(const <FontFeature>[FontFeature.fractions()]),
);
});
}

View File

@@ -3,20 +3,22 @@
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:flutter_api_samples/ui/text/font_feature.font_feature_historical_forms.0.dart' as example;
import 'package:flutter_api_samples/ui/text/font_feature.font_feature_historical_forms.0.dart'
as example;
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('shows font features', (WidgetTester tester) async {
await tester.pumpWidget(
const MaterialApp(
home: example.ExampleWidget(),
),
);
await tester.pumpWidget(const MaterialApp(home: example.ExampleWidget()));
expect(find.byType(Text), findsOneWidget);
expect((tester.widget(find.byType(Text).first) as Text).style!.fontFamily, equals('Sorts Mill Goudy'));
expect((tester.widget(find.byType(Text).first) as Text).style!.fontFeatures,
equals(const <FontFeature>[FontFeature.historicalForms()]));
expect(
(tester.widget(find.byType(Text).first) as Text).style!.fontFamily,
equals('Sorts Mill Goudy'),
);
expect(
(tester.widget(find.byType(Text).first) as Text).style!.fontFeatures,
equals(const <FontFeature>[FontFeature.historicalForms()]),
);
});
}

View File

@@ -3,20 +3,22 @@
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:flutter_api_samples/ui/text/font_feature.font_feature_historical_ligatures.0.dart' as example;
import 'package:flutter_api_samples/ui/text/font_feature.font_feature_historical_ligatures.0.dart'
as example;
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('shows font features', (WidgetTester tester) async {
await tester.pumpWidget(
const MaterialApp(
home: example.ExampleWidget(),
),
);
await tester.pumpWidget(const MaterialApp(home: example.ExampleWidget()));
expect(find.byType(Text), findsOneWidget);
expect((tester.widget(find.byType(Text).first) as Text).style!.fontFamily, equals('Sorts Mill Goudy'));
expect((tester.widget(find.byType(Text).first) as Text).style!.fontFeatures,
equals(const <FontFeature>[FontFeature.historicalForms(), FontFeature.historicalLigatures()]));
expect(
(tester.widget(find.byType(Text).first) as Text).style!.fontFamily,
equals('Sorts Mill Goudy'),
);
expect(
(tester.widget(find.byType(Text).first) as Text).style!.fontFeatures,
equals(const <FontFeature>[FontFeature.historicalForms(), FontFeature.historicalLigatures()]),
);
});
}

View File

@@ -3,20 +3,22 @@
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:flutter_api_samples/ui/text/font_feature.font_feature_lining_figures.0.dart' as example;
import 'package:flutter_api_samples/ui/text/font_feature.font_feature_lining_figures.0.dart'
as example;
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('shows font features', (WidgetTester tester) async {
await tester.pumpWidget(
const MaterialApp(
home: example.ExampleWidget(),
),
);
await tester.pumpWidget(const MaterialApp(home: example.ExampleWidget()));
expect(find.byType(Text), findsOneWidget);
expect((tester.widget(find.byType(Text).first) as Text).style!.fontFamily, equals('Sorts Mill Goudy'));
expect((tester.widget(find.byType(Text).first) as Text).style!.fontFeatures,
equals(const <FontFeature>[FontFeature.liningFigures()]));
expect(
(tester.widget(find.byType(Text).first) as Text).style!.fontFamily,
equals('Sorts Mill Goudy'),
);
expect(
(tester.widget(find.byType(Text).first) as Text).style!.fontFeatures,
equals(const <FontFeature>[FontFeature.liningFigures()]),
);
});
}

View File

@@ -3,19 +3,19 @@
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:flutter_api_samples/ui/text/font_feature.font_feature_locale_aware.0.dart' as example;
import 'package:flutter_api_samples/ui/text/font_feature.font_feature_locale_aware.0.dart'
as example;
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('shows font features', (WidgetTester tester) async {
await tester.pumpWidget(
const MaterialApp(
home: example.ExampleWidget(),
),
);
await tester.pumpWidget(const MaterialApp(home: example.ExampleWidget()));
expect(find.byType(Text), findsOneWidget);
expect((tester.widget(find.byType(Text).first) as Text).style!.fontFamily, equals('Noto Sans'));
expect((tester.widget(find.byType(Text).first) as Text).locale, equals(const Locale('zh', 'CN')));
expect(
(tester.widget(find.byType(Text).first) as Text).locale,
equals(const Locale('zh', 'CN')),
);
});
}

View File

@@ -3,20 +3,19 @@
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:flutter_api_samples/ui/text/font_feature.font_feature_notational_forms.0.dart' as example;
import 'package:flutter_api_samples/ui/text/font_feature.font_feature_notational_forms.0.dart'
as example;
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('shows font features', (WidgetTester tester) async {
await tester.pumpWidget(
const MaterialApp(
home: example.ExampleWidget(),
),
);
await tester.pumpWidget(const MaterialApp(home: example.ExampleWidget()));
expect(find.byType(Text), findsOneWidget);
expect((tester.widget(find.byType(Text).first) as Text).style!.fontFamily, equals('Gothic A1'));
expect((tester.widget(find.byType(Text).first) as Text).style!.fontFeatures,
equals(const <FontFeature>[FontFeature.notationalForms(3)]));
expect(
(tester.widget(find.byType(Text).first) as Text).style!.fontFeatures,
equals(const <FontFeature>[FontFeature.notationalForms(3)]),
);
});
}

View File

@@ -8,15 +8,13 @@ import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('shows font features', (WidgetTester tester) async {
await tester.pumpWidget(
const MaterialApp(
home: example.ExampleWidget(),
),
);
await tester.pumpWidget(const MaterialApp(home: example.ExampleWidget()));
expect(find.byType(Text), findsOneWidget);
expect((tester.widget(find.byType(Text).first) as Text).style!.fontFamily, equals('Piazzolla'));
expect((tester.widget(find.byType(Text).first) as Text).style!.fontFeatures,
equals(const <FontFeature>[FontFeature.numerators()]));
expect(
(tester.widget(find.byType(Text).first) as Text).style!.fontFeatures,
equals(const <FontFeature>[FontFeature.numerators()]),
);
});
}

View File

@@ -3,20 +3,19 @@
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:flutter_api_samples/ui/text/font_feature.font_feature_oldstyle_figures.0.dart' as example;
import 'package:flutter_api_samples/ui/text/font_feature.font_feature_oldstyle_figures.0.dart'
as example;
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('shows font features', (WidgetTester tester) async {
await tester.pumpWidget(
const MaterialApp(
home: example.ExampleWidget(),
),
);
await tester.pumpWidget(const MaterialApp(home: example.ExampleWidget()));
expect(find.byType(Text), findsOneWidget);
expect((tester.widget(find.byType(Text).first) as Text).style!.fontFamily, equals('Piazzolla'));
expect((tester.widget(find.byType(Text).first) as Text).style!.fontFeatures,
equals(const <FontFeature>[FontFeature.oldstyleFigures()]));
expect(
(tester.widget(find.byType(Text).first) as Text).style!.fontFeatures,
equals(const <FontFeature>[FontFeature.oldstyleFigures()]),
);
});
}

View File

@@ -3,20 +3,19 @@
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:flutter_api_samples/ui/text/font_feature.font_feature_ordinal_forms.0.dart' as example;
import 'package:flutter_api_samples/ui/text/font_feature.font_feature_ordinal_forms.0.dart'
as example;
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('shows font features', (WidgetTester tester) async {
await tester.pumpWidget(
const MaterialApp(
home: example.ExampleWidget(),
),
);
await tester.pumpWidget(const MaterialApp(home: example.ExampleWidget()));
expect(find.byType(Text), findsOneWidget);
expect((tester.widget(find.byType(Text).first) as Text).style!.fontFamily, equals('Piazzolla'));
expect((tester.widget(find.byType(Text).first) as Text).style!.fontFeatures,
equals(const <FontFeature>[FontFeature.ordinalForms()]));
expect(
(tester.widget(find.byType(Text).first) as Text).style!.fontFeatures,
equals(const <FontFeature>[FontFeature.ordinalForms()]),
);
});
}

View File

@@ -3,20 +3,19 @@
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:flutter_api_samples/ui/text/font_feature.font_feature_proportional_figures.0.dart' as example;
import 'package:flutter_api_samples/ui/text/font_feature.font_feature_proportional_figures.0.dart'
as example;
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('shows font features', (WidgetTester tester) async {
await tester.pumpWidget(
const MaterialApp(
home: example.ExampleWidget(),
),
);
await tester.pumpWidget(const MaterialApp(home: example.ExampleWidget()));
expect(find.byType(Text), findsOneWidget);
expect((tester.widget(find.byType(Text).first) as Text).style!.fontFamily, equals('Kufam'));
expect((tester.widget(find.byType(Text).first) as Text).style!.fontFeatures,
equals(const <FontFeature>[FontFeature.proportionalFigures()]));
expect(
(tester.widget(find.byType(Text).first) as Text).style!.fontFeatures,
equals(const <FontFeature>[FontFeature.proportionalFigures()]),
);
});
}

View File

@@ -3,20 +3,19 @@
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:flutter_api_samples/ui/text/font_feature.font_feature_scientific_inferiors.0.dart' as example;
import 'package:flutter_api_samples/ui/text/font_feature.font_feature_scientific_inferiors.0.dart'
as example;
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('shows font features', (WidgetTester tester) async {
await tester.pumpWidget(
const MaterialApp(
home: example.ExampleWidget(),
),
);
await tester.pumpWidget(const MaterialApp(home: example.ExampleWidget()));
expect(find.byType(Text), findsOneWidget);
expect((tester.widget(find.byType(Text).first) as Text).style!.fontFamily, equals('Piazzolla'));
expect((tester.widget(find.byType(Text).first) as Text).style!.fontFeatures,
equals(const <FontFeature>[FontFeature.scientificInferiors()]));
expect(
(tester.widget(find.byType(Text).first) as Text).style!.fontFeatures,
equals(const <FontFeature>[FontFeature.scientificInferiors()]),
);
});
}

View File

@@ -3,20 +3,22 @@
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:flutter_api_samples/ui/text/font_feature.font_feature_slashed_zero.0.dart' as example;
import 'package:flutter_api_samples/ui/text/font_feature.font_feature_slashed_zero.0.dart'
as example;
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('shows font features', (WidgetTester tester) async {
await tester.pumpWidget(
const MaterialApp(
home: example.ExampleWidget(),
),
);
await tester.pumpWidget(const MaterialApp(home: example.ExampleWidget()));
expect(find.byType(Text), findsOneWidget);
expect((tester.widget(find.byType(Text).first) as Text).style!.fontFamily, equals('Source Code Pro'));
expect((tester.widget(find.byType(Text).first) as Text).style!.fontFeatures,
equals(const <FontFeature>[FontFeature.slashedZero()]));
expect(
(tester.widget(find.byType(Text).first) as Text).style!.fontFamily,
equals('Source Code Pro'),
);
expect(
(tester.widget(find.byType(Text).first) as Text).style!.fontFeatures,
equals(const <FontFeature>[FontFeature.slashedZero()]),
);
});
}

View File

@@ -3,20 +3,22 @@
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:flutter_api_samples/ui/text/font_feature.font_feature_stylistic_alternates.0.dart' as example;
import 'package:flutter_api_samples/ui/text/font_feature.font_feature_stylistic_alternates.0.dart'
as example;
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('shows font features', (WidgetTester tester) async {
await tester.pumpWidget(
const MaterialApp(
home: example.ExampleWidget(),
),
);
await tester.pumpWidget(const MaterialApp(home: example.ExampleWidget()));
expect(find.byType(Text), findsOneWidget);
expect((tester.widget(find.byType(Text).first) as Text).style!.fontFamily, equals('Source Code Pro'));
expect((tester.widget(find.byType(Text).first) as Text).style!.fontFeatures,
equals(const <FontFeature>[FontFeature.stylisticAlternates()]));
expect(
(tester.widget(find.byType(Text).first) as Text).style!.fontFamily,
equals('Source Code Pro'),
);
expect(
(tester.widget(find.byType(Text).first) as Text).style!.fontFeatures,
equals(const <FontFeature>[FontFeature.stylisticAlternates()]),
);
});
}

View File

@@ -3,28 +3,26 @@
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:flutter_api_samples/ui/text/font_feature.font_feature_stylistic_set.0.dart' as example;
import 'package:flutter_api_samples/ui/text/font_feature.font_feature_stylistic_set.0.dart'
as example;
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('shows font features', (WidgetTester tester) async {
await tester.pumpWidget(
const MaterialApp(
home: example.ExampleWidget(),
),
);
await tester.pumpWidget(const MaterialApp(home: example.ExampleWidget()));
expect(find.byType(Text), findsOneWidget);
expect((tester.widget(find.byType(Text).first) as Text).style!.fontFamily, equals('Source Code Pro'));
expect(
(tester.widget(find.byType(Text).first) as Text).style!.fontFamily,
equals('Source Code Pro'),
);
expect(
(tester.widget(find.byType(Text).first) as Text).style!.fontFeatures,
equals(
<FontFeature>[
FontFeature.stylisticSet(2),
FontFeature.stylisticSet(3),
FontFeature.stylisticSet(4),
],
),
equals(<FontFeature>[
FontFeature.stylisticSet(2),
FontFeature.stylisticSet(3),
FontFeature.stylisticSet(4),
]),
);
});
}

View File

@@ -3,27 +3,19 @@
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:flutter_api_samples/ui/text/font_feature.font_feature_stylistic_set.1.dart' as example;
import 'package:flutter_api_samples/ui/text/font_feature.font_feature_stylistic_set.1.dart'
as example;
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('shows font features', (WidgetTester tester) async {
await tester.pumpWidget(
const MaterialApp(
home: example.ExampleWidget(),
),
);
await tester.pumpWidget(const MaterialApp(home: example.ExampleWidget()));
expect(find.byType(Text), findsOneWidget);
expect((tester.widget(find.byType(Text).first) as Text).style!.fontFamily, equals('Piazzolla'));
expect(
(tester.widget(find.byType(Text).first) as Text).style!.fontFeatures,
equals(
<FontFeature>[
FontFeature.stylisticSet(1),
FontFeature.stylisticSet(2),
],
),
equals(<FontFeature>[FontFeature.stylisticSet(1), FontFeature.stylisticSet(2)]),
);
});
}

View File

@@ -8,11 +8,7 @@ import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('shows font features', (WidgetTester tester) async {
await tester.pumpWidget(
const MaterialApp(
home: example.ExampleWidget(),
),
);
await tester.pumpWidget(const MaterialApp(home: example.ExampleWidget()));
expect(find.byType(Text), findsOneWidget);
expect((tester.widget(find.byType(Text).first) as Text).style!.fontFamily, equals('Piazzolla'));

View File

@@ -3,19 +3,19 @@
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:flutter_api_samples/ui/text/font_feature.font_feature_superscripts.0.dart' as example;
import 'package:flutter_api_samples/ui/text/font_feature.font_feature_superscripts.0.dart'
as example;
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('shows font features', (WidgetTester tester) async {
await tester.pumpWidget(
const MaterialApp(
home: example.ExampleWidget(),
),
);
await tester.pumpWidget(const MaterialApp(home: example.ExampleWidget()));
expect(find.byType(Text), findsOneWidget);
expect((tester.widget(find.byType(Text).first) as Text).style!.fontFamily, equals('Sorts Mill Goudy'));
expect(
(tester.widget(find.byType(Text).first) as Text).style!.fontFamily,
equals('Sorts Mill Goudy'),
);
expect(
(tester.widget(find.byType(Text).first) as Text).style!.fontFeatures,
equals(const <FontFeature>[FontFeature.superscripts()]),

View File

@@ -8,14 +8,13 @@ import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('shows font features', (WidgetTester tester) async {
await tester.pumpWidget(
const MaterialApp(
home: example.ExampleWidget(),
),
);
await tester.pumpWidget(const MaterialApp(home: example.ExampleWidget()));
expect(find.byType(Text), findsOneWidget);
expect((tester.widget(find.byType(Text).first) as Text).style!.fontFamily, equals('BioRhyme Expanded'));
expect(
(tester.widget(find.byType(Text).first) as Text).style!.fontFamily,
equals('BioRhyme Expanded'),
);
expect(
(tester.widget(find.byType(Text).first) as Text).style!.fontFeatures,
equals(const <FontFeature>[FontFeature.swash()]),

View File

@@ -3,16 +3,13 @@
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:flutter_api_samples/ui/text/font_feature.font_feature_tabular_figures.0.dart' as example;
import 'package:flutter_api_samples/ui/text/font_feature.font_feature_tabular_figures.0.dart'
as example;
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('shows font features', (WidgetTester tester) async {
await tester.pumpWidget(
const MaterialApp(
home: example.ExampleWidget(),
),
);
await tester.pumpWidget(const MaterialApp(home: example.ExampleWidget()));
expect(find.byType(Text), findsOneWidget);
expect((tester.widget(find.byType(Text).first) as Text).style!.fontFamily, equals('Piazzolla'));