Move examples from dart:ui ui/lib/text.dart to examples/api (#96557)
This extracts the examples that are in flutter/engine@main/lib/ui/text.dart into examples in the examples/api/lib/ui directory and adds some simple tests for them.
Also, fixes some inconsistent test file naming.
This is step 1: the next step is to remove the examples from the dart:ui code.
diff --git a/examples/api/lib/ui/text/font_feature.0.dart b/examples/api/lib/ui/text/font_feature.0.dart
new file mode 100644
index 0000000..070333e
--- /dev/null
+++ b/examples/api/lib/ui/text/font_feature.0.dart
@@ -0,0 +1,79 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flutter code sample for FontFeature
+import 'dart:ui';
+
+import 'package:flutter/material.dart';
+
+void main() => runApp(const ExampleApp());
+
+class ExampleApp extends StatelessWidget {
+ const ExampleApp({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ return const MaterialApp(
+ home: ExampleWidget(),
+ );
+ }
+}
+
+final TextStyle titleStyle = TextStyle(
+ fontSize: 18,
+ fontFeatures: const <FontFeature>[FontFeature.enable('smcp')],
+ color: Colors.blueGrey[600],
+);
+
+class ExampleWidget extends StatelessWidget {
+ const ExampleWidget({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ // The Cardo, Milonga and Raleway Dots fonts can be downloaded from
+ // Google Fonts (https://www.google.com/fonts).
+ return Scaffold(
+ body: Center(
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ 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 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 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 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,
+ )),
+ const Spacer(flex: 5),
+ ],
+ ),
+ ),
+ );
+ }
+}
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_alternative.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_alternative.0.dart
new file mode 100644
index 0000000..ce2155a
--- /dev/null
+++ b/examples/api/lib/ui/text/font_feature.font_feature_alternative.0.dart
@@ -0,0 +1,40 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flutter code sample for FontFeature.FontFeature.alternative
+import 'dart:ui';
+
+import 'package:flutter/widgets.dart';
+
+void main() => runApp(const ExampleApp());
+
+class ExampleApp extends StatelessWidget {
+ const ExampleApp({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ return WidgetsApp(
+ builder: (BuildContext context, Widget? navigator) => const ExampleWidget(),
+ color: const Color(0xffffffff),
+ );
+ }
+}
+
+class ExampleWidget extends StatelessWidget {
+ const ExampleWidget({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ // The Raleway font can be downloaded from Google Fonts (https://www.google.com/fonts).
+ return const Text(
+ 'The infamous Tuna Torture.',
+ style: TextStyle(
+ fontFamily: 'Raleway',
+ fontFeatures: <FontFeature>[
+ FontFeature.alternative(1), // or 2, or 3, or...
+ ],
+ ),
+ );
+ }
+}
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_alternative_fractions.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_alternative_fractions.0.dart
new file mode 100644
index 0000000..3ceebb4
--- /dev/null
+++ b/examples/api/lib/ui/text/font_feature.font_feature_alternative_fractions.0.dart
@@ -0,0 +1,40 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flutter code sample for FontFeature.FontFeature.alternativeFractions
+import 'dart:ui';
+
+import 'package:flutter/widgets.dart';
+
+void main() => runApp(const ExampleApp());
+
+class ExampleApp extends StatelessWidget {
+ const ExampleApp({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ return WidgetsApp(
+ builder: (BuildContext context, Widget? navigator) => const ExampleWidget(),
+ color: const Color(0xffffffff),
+ );
+ }
+}
+
+class ExampleWidget extends StatelessWidget {
+ const ExampleWidget({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ // The Ubuntu Mono font can be downloaded from Google Fonts (https://www.google.com/fonts).
+ return const Text(
+ 'Fractions: 1/2 2/3 3/4 4/5',
+ style: TextStyle(
+ fontFamily: 'Ubuntu Mono',
+ fontFeatures: <FontFeature>[
+ FontFeature.alternativeFractions(),
+ ],
+ ),
+ );
+ }
+}
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_case_sensitive_forms.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_case_sensitive_forms.0.dart
new file mode 100644
index 0000000..a70f5b3
--- /dev/null
+++ b/examples/api/lib/ui/text/font_feature.font_feature_case_sensitive_forms.0.dart
@@ -0,0 +1,40 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flutter code sample for FontFeature.FontFeature.caseSensitiveForms
+import 'dart:ui';
+
+import 'package:flutter/widgets.dart';
+
+void main() => runApp(const ExampleApp());
+
+class ExampleApp extends StatelessWidget {
+ const ExampleApp({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ return WidgetsApp(
+ builder: (BuildContext context, Widget? navigator) => const ExampleWidget(),
+ color: const Color(0xffffffff),
+ );
+ }
+}
+
+class ExampleWidget extends StatelessWidget {
+ const ExampleWidget({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ // The Piazzolla font can be downloaded from Google Fonts (https://www.google.com/fonts).
+ return const Text(
+ '(A) [A] {A} «A» A/B A•B',
+ style: TextStyle(
+ fontFamily: 'Piazzolla',
+ fontFeatures: <FontFeature>[
+ FontFeature.caseSensitiveForms(),
+ ],
+ ),
+ );
+ }
+}
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_character_variant.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_character_variant.0.dart
new file mode 100644
index 0000000..58c4eed
--- /dev/null
+++ b/examples/api/lib/ui/text/font_feature.font_feature_character_variant.0.dart
@@ -0,0 +1,42 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flutter code sample for FontFeature.FontFeature.characterVariant
+import 'dart:ui';
+
+import 'package:flutter/widgets.dart';
+
+void main() => runApp(const ExampleApp());
+
+class ExampleApp extends StatelessWidget {
+ const ExampleApp({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ return WidgetsApp(
+ builder: (BuildContext context, Widget? navigator) => const ExampleWidget(),
+ color: const Color(0xffffffff),
+ );
+ }
+}
+
+class ExampleWidget extends StatelessWidget {
+ const ExampleWidget({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ // The Source Code Pro font can be downloaded from Google Fonts (https://www.google.com/fonts).
+ return Text(
+ 'aáâ β gǵĝ θб Iiíî Ll',
+ style: TextStyle(
+ fontFamily: 'Source Code Pro',
+ fontFeatures: <FontFeature>[
+ FontFeature.characterVariant(1),
+ FontFeature.characterVariant(2),
+ FontFeature.characterVariant(4),
+ ],
+ ),
+ );
+ }
+}
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_contextual_alternates.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_contextual_alternates.0.dart
new file mode 100644
index 0000000..05fadd8
--- /dev/null
+++ b/examples/api/lib/ui/text/font_feature.font_feature_contextual_alternates.0.dart
@@ -0,0 +1,40 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flutter code sample for FontFeature.FontFeature.contextualAlternates
+import 'dart:ui';
+
+import 'package:flutter/widgets.dart';
+
+void main() => runApp(const ExampleApp());
+
+class ExampleApp extends StatelessWidget {
+ const ExampleApp({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ return WidgetsApp(
+ builder: (BuildContext context, Widget? navigator) => const ExampleWidget(),
+ color: const Color(0xffffffff),
+ );
+ }
+}
+
+class ExampleWidget extends StatelessWidget {
+ const ExampleWidget({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ // The Barriecito font can be downloaded from Google Fonts (https://www.google.com/fonts).
+ return const Text(
+ "Ooohh, we weren't going to tell him that.",
+ style: TextStyle(
+ fontFamily: 'Barriecito',
+ fontFeatures: <FontFeature>[
+ FontFeature.contextualAlternates(),
+ ],
+ ),
+ );
+ }
+}
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_denominator.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_denominator.0.dart
new file mode 100644
index 0000000..516ba41
--- /dev/null
+++ b/examples/api/lib/ui/text/font_feature.font_feature_denominator.0.dart
@@ -0,0 +1,40 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flutter code sample for FontFeature.FontFeature.denominator
+import 'dart:ui';
+
+import 'package:flutter/widgets.dart';
+
+void main() => runApp(const ExampleApp());
+
+class ExampleApp extends StatelessWidget {
+ const ExampleApp({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ return WidgetsApp(
+ builder: (BuildContext context, Widget? navigator) => const ExampleWidget(),
+ color: const Color(0xffffffff),
+ );
+ }
+}
+
+class ExampleWidget extends StatelessWidget {
+ const ExampleWidget({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ // The Piazzolla font can be downloaded from Google Fonts (https://www.google.com/fonts).
+ return const Text(
+ 'Fractions: 1/2 2/3 3/4 4/5',
+ style: TextStyle(
+ fontFamily: 'Piazzolla',
+ fontFeatures: <FontFeature>[
+ FontFeature.denominator(),
+ ],
+ ),
+ );
+ }
+}
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_fractions.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_fractions.0.dart
new file mode 100644
index 0000000..306d463
--- /dev/null
+++ b/examples/api/lib/ui/text/font_feature.font_feature_fractions.0.dart
@@ -0,0 +1,40 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flutter code sample for FontFeature.FontFeature.fractions
+import 'dart:ui';
+
+import 'package:flutter/widgets.dart';
+
+void main() => runApp(const ExampleApp());
+
+class ExampleApp extends StatelessWidget {
+ const ExampleApp({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ return WidgetsApp(
+ builder: (BuildContext context, Widget? navigator) => const ExampleWidget(),
+ color: const Color(0xffffffff),
+ );
+ }
+}
+
+class ExampleWidget extends StatelessWidget {
+ const ExampleWidget({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ // The Ubuntu Mono font can be downloaded from Google Fonts (https://www.google.com/fonts).
+ return const Text(
+ 'Fractions: 1/2 2/3 3/4 4/5',
+ style: TextStyle(
+ fontFamily: 'Ubuntu Mono',
+ fontFeatures: <FontFeature>[
+ FontFeature.fractions(),
+ ],
+ ),
+ );
+ }
+}
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_historical_forms.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_historical_forms.0.dart
new file mode 100644
index 0000000..81d6a47
--- /dev/null
+++ b/examples/api/lib/ui/text/font_feature.font_feature_historical_forms.0.dart
@@ -0,0 +1,41 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flutter code sample for FontFeature.FontFeature.historicalForms
+import 'dart:ui';
+
+import 'package:flutter/widgets.dart';
+
+void main() => runApp(const ExampleApp());
+
+class ExampleApp extends StatelessWidget {
+ const ExampleApp({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ return WidgetsApp(
+ builder: (BuildContext context, Widget? navigator) => const ExampleWidget(),
+ color: const Color(0xffffffff),
+ );
+ }
+}
+
+class ExampleWidget extends StatelessWidget {
+ const ExampleWidget({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ // The Cardo font can be downloaded from Google Fonts (https://www.google.com/fonts).
+ return const Text(
+ 'VIBRANT fish assisted his business.',
+ style: TextStyle(
+ fontFamily: 'Sorts Mill Goudy',
+ fontFeatures: <FontFeature>[
+ FontFeature.historicalForms(), // Enables "hist".
+ // Use FontFeature.historicalLigatures() to enable "hlig" as well.
+ ],
+ ),
+ );
+ }
+}
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_historical_ligatures.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_historical_ligatures.0.dart
new file mode 100644
index 0000000..459f1ca
--- /dev/null
+++ b/examples/api/lib/ui/text/font_feature.font_feature_historical_ligatures.0.dart
@@ -0,0 +1,42 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flutter code sample for FontFeature.FontFeature.historicalLigatures
+
+import 'dart:ui';
+
+import 'package:flutter/widgets.dart';
+
+void main() => runApp(const ExampleApp());
+
+class ExampleApp extends StatelessWidget {
+ const ExampleApp({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ return WidgetsApp(
+ builder: (BuildContext context, Widget? navigator) => const ExampleWidget(),
+ color: const Color(0xffffffff),
+ );
+ }
+}
+
+class ExampleWidget extends StatelessWidget {
+ const ExampleWidget({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ // The Cardo font can be downloaded from Google Fonts (https://www.google.com/fonts).
+ return const Text(
+ 'VIBRANT fish assisted his business.',
+ style: TextStyle(
+ fontFamily: 'Sorts Mill Goudy',
+ fontFeatures: <FontFeature>[
+ FontFeature.historicalForms(), // Enables "hist".
+ FontFeature.historicalLigatures() // Enables "hlig".
+ ],
+ ),
+ );
+ }
+}
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_lining_figures.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_lining_figures.0.dart
new file mode 100644
index 0000000..26cf4eb
--- /dev/null
+++ b/examples/api/lib/ui/text/font_feature.font_feature_lining_figures.0.dart
@@ -0,0 +1,40 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flutter code sample for FontFeature.FontFeature.liningFigures
+import 'dart:ui';
+
+import 'package:flutter/widgets.dart';
+
+void main() => runApp(const ExampleApp());
+
+class ExampleApp extends StatelessWidget {
+ const ExampleApp({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ return WidgetsApp(
+ builder: (BuildContext context, Widget? navigator) => const ExampleWidget(),
+ color: const Color(0xffffffff),
+ );
+ }
+}
+
+class ExampleWidget extends StatelessWidget {
+ const ExampleWidget({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ // The Sorts Mill Goudy font can be downloaded from Google Fonts (https://www.google.com/fonts).
+ return const Text(
+ 'CALL 311-555-2368 NOW!',
+ style: TextStyle(
+ fontFamily: 'Sorts Mill Goudy',
+ fontFeatures: <FontFeature>[
+ FontFeature.liningFigures(),
+ ],
+ ),
+ );
+ }
+}
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_locale_aware.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_locale_aware.0.dart
new file mode 100644
index 0000000..b45b097
--- /dev/null
+++ b/examples/api/lib/ui/text/font_feature.font_feature_locale_aware.0.dart
@@ -0,0 +1,38 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flutter code sample for FontFeature.FontFeature.localeAware
+import 'dart:ui';
+
+import 'package:flutter/widgets.dart';
+
+void main() => runApp(const ExampleApp());
+
+class ExampleApp extends StatelessWidget {
+ const ExampleApp({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ return WidgetsApp(
+ builder: (BuildContext context, Widget? navigator) => const ExampleWidget(),
+ color: const Color(0xffffffff),
+ );
+ }
+}
+
+class ExampleWidget extends StatelessWidget {
+ const ExampleWidget({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ // The Noto family of fonts can be downloaded from Google Fonts (https://www.google.com/fonts).
+ return const Text(
+ '次 化 刃 直 入 令',
+ locale: Locale('zh', 'CN'), // or Locale('ja'), Locale('ko'), Locale('zh', 'TW'), etc
+ style: TextStyle(
+ fontFamily: 'Noto Sans',
+ ),
+ );
+ }
+}
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_notational_forms.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_notational_forms.0.dart
new file mode 100644
index 0000000..e617a75
--- /dev/null
+++ b/examples/api/lib/ui/text/font_feature.font_feature_notational_forms.0.dart
@@ -0,0 +1,40 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flutter code sample for FontFeature.FontFeature.notationalForms
+import 'dart:ui';
+
+import 'package:flutter/widgets.dart';
+
+void main() => runApp(const ExampleApp());
+
+class ExampleApp extends StatelessWidget {
+ const ExampleApp({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ return WidgetsApp(
+ builder: (BuildContext context, Widget? navigator) => const ExampleWidget(),
+ color: const Color(0xffffffff),
+ );
+ }
+}
+
+class ExampleWidget extends StatelessWidget {
+ const ExampleWidget({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ // The Gothic A1 font can be downloaded from Google Fonts (https://www.google.com/fonts).
+ return const Text(
+ 'abc 123',
+ style: TextStyle(
+ fontFamily: 'Gothic A1',
+ fontFeatures: <FontFeature>[
+ FontFeature.notationalForms(3), // circled letters and digits
+ ],
+ ),
+ );
+ }
+}
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_numerators.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_numerators.0.dart
new file mode 100644
index 0000000..d7af51c
--- /dev/null
+++ b/examples/api/lib/ui/text/font_feature.font_feature_numerators.0.dart
@@ -0,0 +1,41 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flutter code sample for FontFeature.FontFeature.numerators
+import 'dart:ui';
+
+import 'package:flutter/widgets.dart';
+
+void main() => runApp(const ExampleApp());
+
+class ExampleApp extends StatelessWidget {
+ const ExampleApp({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ return WidgetsApp(
+ builder: (BuildContext context, Widget? navigator) => const ExampleWidget(),
+ color: const Color(0xffffffff),
+ );
+ }
+}
+
+/// This is the stateless widget that the main application instantiates.
+class ExampleWidget extends StatelessWidget {
+ const ExampleWidget({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ // The Piazzolla font can be downloaded from Google Fonts (https://www.google.com/fonts).
+ return const Text(
+ 'Fractions: 1/2 2/3 3/4 4/5',
+ style: TextStyle(
+ fontFamily: 'Piazzolla',
+ fontFeatures: <FontFeature>[
+ FontFeature.numerators(),
+ ],
+ ),
+ );
+ }
+}
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_oldstyle_figures.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_oldstyle_figures.0.dart
new file mode 100644
index 0000000..a18d239
--- /dev/null
+++ b/examples/api/lib/ui/text/font_feature.font_feature_oldstyle_figures.0.dart
@@ -0,0 +1,40 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flutter code sample for FontFeature.FontFeature.oldstyleFigures
+import 'dart:ui';
+
+import 'package:flutter/widgets.dart';
+
+void main() => runApp(const ExampleApp());
+
+class ExampleApp extends StatelessWidget {
+ const ExampleApp({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ return WidgetsApp(
+ builder: (BuildContext context, Widget? navigator) => const ExampleWidget(),
+ color: const Color(0xffffffff),
+ );
+ }
+}
+
+class ExampleWidget extends StatelessWidget {
+ const ExampleWidget({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ // The Piazzolla font can be downloaded from Google Fonts (https://www.google.com/fonts).
+ return const Text(
+ 'Call 311-555-2368 now!',
+ style: TextStyle(
+ fontFamily: 'Piazzolla',
+ fontFeatures: <FontFeature>[
+ FontFeature.oldstyleFigures(),
+ ],
+ ),
+ );
+ }
+}
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_ordinal_forms.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_ordinal_forms.0.dart
new file mode 100644
index 0000000..4b8ef03
--- /dev/null
+++ b/examples/api/lib/ui/text/font_feature.font_feature_ordinal_forms.0.dart
@@ -0,0 +1,40 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flutter code sample for FontFeature.FontFeature.ordinalForms
+import 'dart:ui';
+
+import 'package:flutter/widgets.dart';
+
+void main() => runApp(const ExampleApp());
+
+class ExampleApp extends StatelessWidget {
+ const ExampleApp({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ return WidgetsApp(
+ builder: (BuildContext context, Widget? navigator) => const ExampleWidget(),
+ color: const Color(0xffffffff),
+ );
+ }
+}
+
+class ExampleWidget extends StatelessWidget {
+ const ExampleWidget({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ // The Piazzolla font can be downloaded from Google Fonts (https://www.google.com/fonts).
+ return const Text(
+ '1st, 2nd, 3rd, 4th...',
+ style: TextStyle(
+ fontFamily: 'Piazzolla',
+ fontFeatures: <FontFeature>[
+ FontFeature.ordinalForms(),
+ ],
+ ),
+ );
+ }
+}
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_proportional_figures.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_proportional_figures.0.dart
new file mode 100644
index 0000000..4113b79
--- /dev/null
+++ b/examples/api/lib/ui/text/font_feature.font_feature_proportional_figures.0.dart
@@ -0,0 +1,40 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flutter code sample for FontFeature.FontFeature.proportionalFigures
+import 'dart:ui';
+
+import 'package:flutter/widgets.dart';
+
+void main() => runApp(const ExampleApp());
+
+class ExampleApp extends StatelessWidget {
+ const ExampleApp({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ return WidgetsApp(
+ builder: (BuildContext context, Widget? navigator) => const ExampleWidget(),
+ color: const Color(0xffffffff),
+ );
+ }
+}
+
+class ExampleWidget extends StatelessWidget {
+ const ExampleWidget({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ // The Kufam font can be downloaded from Google Fonts (https://www.google.com/fonts).
+ return const Text(
+ 'Call 311-555-2368 now!',
+ style: TextStyle(
+ fontFamily: 'Kufam',
+ fontFeatures: <FontFeature>[
+ FontFeature.proportionalFigures(),
+ ],
+ ),
+ );
+ }
+}
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_scientific_inferiors.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_scientific_inferiors.0.dart
new file mode 100644
index 0000000..f30a35d
--- /dev/null
+++ b/examples/api/lib/ui/text/font_feature.font_feature_scientific_inferiors.0.dart
@@ -0,0 +1,40 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flutter code sample for FontFeature.FontFeature.scientificInferiors
+import 'dart:ui';
+
+import 'package:flutter/widgets.dart';
+
+void main() => runApp(const ExampleApp());
+
+class ExampleApp extends StatelessWidget {
+ const ExampleApp({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ return WidgetsApp(
+ builder: (BuildContext context, Widget? navigator) => const ExampleWidget(),
+ color: const Color(0xffffffff),
+ );
+ }
+}
+
+class ExampleWidget extends StatelessWidget {
+ const ExampleWidget({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ // The Piazzolla font can be downloaded from Google Fonts (https://www.google.com/fonts).
+ return const Text(
+ 'C8H10N4O2',
+ style: TextStyle(
+ fontFamily: 'Piazzolla',
+ fontFeatures: <FontFeature>[
+ FontFeature.scientificInferiors(),
+ ],
+ ),
+ );
+ }
+}
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_slashed_zero.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_slashed_zero.0.dart
new file mode 100644
index 0000000..ae18739
--- /dev/null
+++ b/examples/api/lib/ui/text/font_feature.font_feature_slashed_zero.0.dart
@@ -0,0 +1,40 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flutter code sample for FontFeature.FontFeature.slashedZero
+import 'dart:ui';
+
+import 'package:flutter/widgets.dart';
+
+void main() => runApp(const ExampleApp());
+
+class ExampleApp extends StatelessWidget {
+ const ExampleApp({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ return WidgetsApp(
+ builder: (BuildContext context, Widget? navigator) => const ExampleWidget(),
+ color: const Color(0xffffffff),
+ );
+ }
+}
+
+class ExampleWidget extends StatelessWidget {
+ const ExampleWidget({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ // The Source Code Pro font can be downloaded from Google Fonts (https://www.google.com/fonts).
+ return const Text(
+ 'One million is: 1,000,000.00',
+ style: TextStyle(
+ fontFamily: 'Source Code Pro',
+ fontFeatures: <FontFeature>[
+ FontFeature.slashedZero(),
+ ],
+ ),
+ );
+ }
+}
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_stylistic_alternates.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_stylistic_alternates.0.dart
new file mode 100644
index 0000000..d1dc900
--- /dev/null
+++ b/examples/api/lib/ui/text/font_feature.font_feature_stylistic_alternates.0.dart
@@ -0,0 +1,40 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flutter code sample for FontFeature.FontFeature.stylisticAlternates
+import 'dart:ui';
+
+import 'package:flutter/widgets.dart';
+
+void main() => runApp(const ExampleApp());
+
+class ExampleApp extends StatelessWidget {
+ const ExampleApp({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ return WidgetsApp(
+ builder: (BuildContext context, Widget? navigator) => const ExampleWidget(),
+ color: const Color(0xffffffff),
+ );
+ }
+}
+
+class ExampleWidget extends StatelessWidget {
+ const ExampleWidget({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ // The Source Code Pro font can be downloaded from Google Fonts (https://www.google.com/fonts).
+ return const Text(
+ r'Agile Game - $100 initial bet',
+ style: TextStyle(
+ fontFamily: 'Source Code Pro',
+ fontFeatures: <FontFeature>[
+ FontFeature.stylisticAlternates(),
+ ],
+ ),
+ );
+ }
+}
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_stylistic_set.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_stylistic_set.0.dart
new file mode 100644
index 0000000..70dd1d6
--- /dev/null
+++ b/examples/api/lib/ui/text/font_feature.font_feature_stylistic_set.0.dart
@@ -0,0 +1,42 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flutter code sample for FontFeature.FontFeature.stylisticSet
+import 'dart:ui';
+
+import 'package:flutter/widgets.dart';
+
+void main() => runApp(const ExampleApp());
+
+class ExampleApp extends StatelessWidget {
+ const ExampleApp({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ return WidgetsApp(
+ builder: (BuildContext context, Widget? navigator) => const ExampleWidget(),
+ color: const Color(0xffffffff),
+ );
+ }
+}
+
+class ExampleWidget extends StatelessWidget {
+ const ExampleWidget({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ // The Source Code Pro font can be downloaded from Google Fonts (https://www.google.com/fonts).
+ return Text(
+ 'aáâ β gǵĝ θб Iiíî Ll',
+ style: TextStyle(
+ fontFamily: 'Source Code Pro',
+ fontFeatures: <FontFeature>[
+ FontFeature.stylisticSet(2),
+ FontFeature.stylisticSet(3),
+ FontFeature.stylisticSet(4),
+ ],
+ ),
+ );
+ }
+}
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_stylistic_set.1.dart b/examples/api/lib/ui/text/font_feature.font_feature_stylistic_set.1.dart
new file mode 100644
index 0000000..650f036
--- /dev/null
+++ b/examples/api/lib/ui/text/font_feature.font_feature_stylistic_set.1.dart
@@ -0,0 +1,41 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flutter code sample for FontFeature.FontFeature.stylisticSet
+import 'dart:ui';
+
+import 'package:flutter/widgets.dart';
+
+void main() => runApp(const ExampleApp());
+
+class ExampleApp extends StatelessWidget {
+ const ExampleApp({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ return WidgetsApp(
+ builder: (BuildContext context, Widget? navigator) => const ExampleWidget(),
+ color: const Color(0xffffffff),
+ );
+ }
+}
+
+class ExampleWidget extends StatelessWidget {
+ const ExampleWidget({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ // The Piazzolla font can be downloaded from Google Fonts (https://www.google.com/fonts).
+ return Text(
+ '-> MCMXCVII <-', // 1997
+ style: TextStyle(
+ fontFamily: 'Piazzolla',
+ fontFeatures: <FontFeature>[
+ FontFeature.stylisticSet(1),
+ FontFeature.stylisticSet(2),
+ ],
+ ),
+ );
+ }
+}
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_subscripts.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_subscripts.0.dart
new file mode 100644
index 0000000..cfaea35
--- /dev/null
+++ b/examples/api/lib/ui/text/font_feature.font_feature_subscripts.0.dart
@@ -0,0 +1,40 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flutter code sample for FontFeature.FontFeature.subscripts
+import 'dart:ui';
+
+import 'package:flutter/widgets.dart';
+
+void main() => runApp(const ExampleApp());
+
+class ExampleApp extends StatelessWidget {
+ const ExampleApp({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ return WidgetsApp(
+ builder: (BuildContext context, Widget? navigator) => const ExampleWidget(),
+ color: const Color(0xffffffff),
+ );
+ }
+}
+
+class ExampleWidget extends StatelessWidget {
+ const ExampleWidget({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ // The Piazzolla font can be downloaded from Google Fonts (https://www.google.com/fonts).
+ return const Text(
+ 'Line from x1,y1 to x2,y2',
+ style: TextStyle(
+ fontFamily: 'Piazzolla',
+ fontFeatures: <FontFeature>[
+ FontFeature.subscripts(),
+ ],
+ ),
+ );
+ }
+}
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_superscripts.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_superscripts.0.dart
new file mode 100644
index 0000000..81d6478
--- /dev/null
+++ b/examples/api/lib/ui/text/font_feature.font_feature_superscripts.0.dart
@@ -0,0 +1,40 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flutter code sample for FontFeature.FontFeature.superscripts
+import 'dart:ui';
+
+import 'package:flutter/widgets.dart';
+
+void main() => runApp(const ExampleApp());
+
+class ExampleApp extends StatelessWidget {
+ const ExampleApp({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ return WidgetsApp(
+ builder: (BuildContext context, Widget? navigator) => const ExampleWidget(),
+ color: const Color(0xffffffff),
+ );
+ }
+}
+
+class ExampleWidget extends StatelessWidget {
+ const ExampleWidget({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ // The Sorts Mill Goudy font can be downloaded from Google Fonts (https://www.google.com/fonts).
+ return const Text(
+ 'The isotope 238U decays to 206Pb',
+ style: TextStyle(
+ fontFamily: 'Sorts Mill Goudy',
+ fontFeatures: <FontFeature>[
+ FontFeature.superscripts(),
+ ],
+ ),
+ );
+ }
+}
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_swash.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_swash.0.dart
new file mode 100644
index 0000000..bebf97c
--- /dev/null
+++ b/examples/api/lib/ui/text/font_feature.font_feature_swash.0.dart
@@ -0,0 +1,40 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flutter code sample for FontFeature.FontFeature.swash
+import 'dart:ui';
+
+import 'package:flutter/widgets.dart';
+
+void main() => runApp(const ExampleApp());
+
+class ExampleApp extends StatelessWidget {
+ const ExampleApp({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ return WidgetsApp(
+ builder: (BuildContext context, Widget? navigator) => const ExampleWidget(),
+ color: const Color(0xffffffff),
+ );
+ }
+}
+
+class ExampleWidget extends StatelessWidget {
+ const ExampleWidget({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ // The BioRhyme Expanded font can be downloaded from Google Fonts (https://www.google.com/fonts).
+ return const Text(
+ 'Queer & Romantic',
+ style: TextStyle(
+ fontFamily: 'BioRhyme Expanded',
+ fontFeatures: <FontFeature>[
+ FontFeature.swash(),
+ ],
+ ),
+ );
+ }
+}
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_tabular_figures.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_tabular_figures.0.dart
new file mode 100644
index 0000000..989def8
--- /dev/null
+++ b/examples/api/lib/ui/text/font_feature.font_feature_tabular_figures.0.dart
@@ -0,0 +1,40 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flutter code sample for dart:ui FontFeature.FontFeature.tabularFigures
+import 'dart:ui';
+
+import 'package:flutter/widgets.dart';
+
+void main() => runApp(const ExampleApp());
+
+class ExampleApp extends StatelessWidget {
+ const ExampleApp({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ return WidgetsApp(
+ builder: (BuildContext context, Widget? navigator) => const ExampleWidget(),
+ color: const Color(0xffffffff),
+ );
+ }
+}
+
+class ExampleWidget extends StatelessWidget {
+ const ExampleWidget({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ // The Piazzolla font can be downloaded from Google Fonts (https://www.google.com/fonts).
+ return const Text(
+ 'Call 311-555-2368 now!',
+ style: TextStyle(
+ fontFamily: 'Piazzolla',
+ fontFeatures: <FontFeature>[
+ FontFeature.tabularFigures(),
+ ],
+ ),
+ );
+ }
+}
diff --git a/examples/api/test/material/ink/ink.image_clip.0.test.dart b/examples/api/test/material/ink/ink.image_clip.0_test.dart
similarity index 100%
rename from examples/api/test/material/ink/ink.image_clip.0.test.dart
rename to examples/api/test/material/ink/ink.image_clip.0_test.dart
diff --git a/examples/api/test/material/ink/ink.image_clip.1.test.dart b/examples/api/test/material/ink/ink.image_clip.1_test.dart
similarity index 100%
rename from examples/api/test/material/ink/ink.image_clip.1.test.dart
rename to examples/api/test/material/ink/ink.image_clip.1_test.dart
diff --git a/examples/api/test/material/input_decorator/input_decoration.floating_label_style_error.0.test.dart b/examples/api/test/material/input_decorator/input_decoration.floating_label_style_error.0_test.dart
similarity index 100%
rename from examples/api/test/material/input_decorator/input_decoration.floating_label_style_error.0.test.dart
rename to examples/api/test/material/input_decorator/input_decoration.floating_label_style_error.0_test.dart
diff --git a/examples/api/test/material/input_decorator/input_decoration.label_style_error.0.test.dart b/examples/api/test/material/input_decorator/input_decoration.label_style_error.0_test.dart
similarity index 100%
rename from examples/api/test/material/input_decorator/input_decoration.label_style_error.0.test.dart
rename to examples/api/test/material/input_decorator/input_decoration.label_style_error.0_test.dart
diff --git a/examples/api/test/ui/text/font_feature.0_test.dart b/examples/api/test/ui/text/font_feature.0_test.dart
new file mode 100644
index 0000000..edd4db7
--- /dev/null
+++ b/examples/api/test/ui/text/font_feature.0_test.dart
@@ -0,0 +1,29 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+import 'dart:ui';
+import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
+import 'package:flutter_api_samples/ui/text/font_feature.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(),
+ ),
+ );
+
+ 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)]));
+ });
+}
diff --git a/examples/api/test/ui/text/font_feature.font_feature_alternative.0_test.dart b/examples/api/test/ui/text/font_feature.font_feature_alternative.0_test.dart
new file mode 100644
index 0000000..7f57a11
--- /dev/null
+++ b/examples/api/test/ui/text/font_feature.font_feature_alternative.0_test.dart
@@ -0,0 +1,24 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+import 'dart:ui';
+import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
+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(),
+ ),
+ );
+
+ 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)]));
+ });
+}
diff --git a/examples/api/test/ui/text/font_feature.font_feature_alternative_fractions.0_test.dart b/examples/api/test/ui/text/font_feature.font_feature_alternative_fractions.0_test.dart
new file mode 100644
index 0000000..8c2c800
--- /dev/null
+++ b/examples/api/test/ui/text/font_feature.font_feature_alternative_fractions.0_test.dart
@@ -0,0 +1,24 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+import 'dart:ui';
+import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
+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(),
+ ),
+ );
+
+ 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()]));
+ });
+}
diff --git a/examples/api/test/ui/text/font_feature.font_feature_case_sensitive_forms.0_test.dart b/examples/api/test/ui/text/font_feature.font_feature_case_sensitive_forms.0_test.dart
new file mode 100644
index 0000000..81ad5ca
--- /dev/null
+++ b/examples/api/test/ui/text/font_feature.font_feature_case_sensitive_forms.0_test.dart
@@ -0,0 +1,24 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+import 'dart:ui';
+import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
+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(),
+ ),
+ );
+
+ 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()]));
+ });
+}
diff --git a/examples/api/test/ui/text/font_feature.font_feature_character_variant.0_test.dart b/examples/api/test/ui/text/font_feature.font_feature_character_variant.0_test.dart
new file mode 100644
index 0000000..018d0da
--- /dev/null
+++ b/examples/api/test/ui/text/font_feature.font_feature_character_variant.0_test.dart
@@ -0,0 +1,29 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+import 'dart:ui';
+import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
+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(),
+ ),
+ );
+
+ 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),
+ ]));
+ });
+}
diff --git a/examples/api/test/ui/text/font_feature.font_feature_contextual_alternates.0_test.dart b/examples/api/test/ui/text/font_feature.font_feature_contextual_alternates.0_test.dart
new file mode 100644
index 0000000..a692503
--- /dev/null
+++ b/examples/api/test/ui/text/font_feature.font_feature_contextual_alternates.0_test.dart
@@ -0,0 +1,24 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+import 'dart:ui';
+import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
+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(),
+ ),
+ );
+
+ 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()]));
+ });
+}
diff --git a/examples/api/test/ui/text/font_feature.font_feature_denominator.0_test.dart b/examples/api/test/ui/text/font_feature.font_feature_denominator.0_test.dart
new file mode 100644
index 0000000..3473cf0
--- /dev/null
+++ b/examples/api/test/ui/text/font_feature.font_feature_denominator.0_test.dart
@@ -0,0 +1,24 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+import 'dart:ui';
+import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
+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(),
+ ),
+ );
+
+ 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()]));
+ });
+}
diff --git a/examples/api/test/ui/text/font_feature.font_feature_fractions.0_test.dart b/examples/api/test/ui/text/font_feature.font_feature_fractions.0_test.dart
new file mode 100644
index 0000000..ee02b18
--- /dev/null
+++ b/examples/api/test/ui/text/font_feature.font_feature_fractions.0_test.dart
@@ -0,0 +1,24 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+import 'dart:ui';
+import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
+import 'package:flutter_api_samples/ui/text/font_feature.font_feature_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(),
+ ),
+ );
+
+ 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()]));
+ });
+}
diff --git a/examples/api/test/ui/text/font_feature.font_feature_historical_forms.0_test.dart b/examples/api/test/ui/text/font_feature.font_feature_historical_forms.0_test.dart
new file mode 100644
index 0000000..58ec892
--- /dev/null
+++ b/examples/api/test/ui/text/font_feature.font_feature_historical_forms.0_test.dart
@@ -0,0 +1,24 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+import 'dart:ui';
+import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
+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(),
+ ),
+ );
+
+ 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()]));
+ });
+}
diff --git a/examples/api/test/ui/text/font_feature.font_feature_historical_ligatures.0_test.dart b/examples/api/test/ui/text/font_feature.font_feature_historical_ligatures.0_test.dart
new file mode 100644
index 0000000..f60ac57
--- /dev/null
+++ b/examples/api/test/ui/text/font_feature.font_feature_historical_ligatures.0_test.dart
@@ -0,0 +1,24 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+import 'dart:ui';
+import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
+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(),
+ ),
+ );
+
+ 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()]));
+ });
+}
diff --git a/examples/api/test/ui/text/font_feature.font_feature_lining_figures.0_test.dart b/examples/api/test/ui/text/font_feature.font_feature_lining_figures.0_test.dart
new file mode 100644
index 0000000..a29abfd
--- /dev/null
+++ b/examples/api/test/ui/text/font_feature.font_feature_lining_figures.0_test.dart
@@ -0,0 +1,24 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+import 'dart:ui';
+import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
+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(),
+ ),
+ );
+
+ 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()]));
+ });
+}
diff --git a/examples/api/test/ui/text/font_feature.font_feature_locale_aware.0_test.dart b/examples/api/test/ui/text/font_feature.font_feature_locale_aware.0_test.dart
new file mode 100644
index 0000000..c8a4d66
--- /dev/null
+++ b/examples/api/test/ui/text/font_feature.font_feature_locale_aware.0_test.dart
@@ -0,0 +1,23 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+import 'dart:ui';
+import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
+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(),
+ ),
+ );
+
+ 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')));
+ });
+}
diff --git a/examples/api/test/ui/text/font_feature.font_feature_notational_forms.0_test.dart b/examples/api/test/ui/text/font_feature.font_feature_notational_forms.0_test.dart
new file mode 100644
index 0000000..8a9aa0d
--- /dev/null
+++ b/examples/api/test/ui/text/font_feature.font_feature_notational_forms.0_test.dart
@@ -0,0 +1,24 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+import 'dart:ui';
+import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
+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(),
+ ),
+ );
+
+ 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)]));
+ });
+}
diff --git a/examples/api/test/ui/text/font_feature.font_feature_numerators.0_test.dart b/examples/api/test/ui/text/font_feature.font_feature_numerators.0_test.dart
new file mode 100644
index 0000000..3fb4147
--- /dev/null
+++ b/examples/api/test/ui/text/font_feature.font_feature_numerators.0_test.dart
@@ -0,0 +1,24 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+import 'dart:ui';
+import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
+import 'package:flutter_api_samples/ui/text/font_feature.font_feature_numerators.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(),
+ ),
+ );
+
+ 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()]));
+ });
+}
diff --git a/examples/api/test/ui/text/font_feature.font_feature_oldstyle_figures.0_test.dart b/examples/api/test/ui/text/font_feature.font_feature_oldstyle_figures.0_test.dart
new file mode 100644
index 0000000..ea77507
--- /dev/null
+++ b/examples/api/test/ui/text/font_feature.font_feature_oldstyle_figures.0_test.dart
@@ -0,0 +1,24 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+import 'dart:ui';
+import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
+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(),
+ ),
+ );
+
+ 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()]));
+ });
+}
diff --git a/examples/api/test/ui/text/font_feature.font_feature_ordinal_forms.0_test.dart b/examples/api/test/ui/text/font_feature.font_feature_ordinal_forms.0_test.dart
new file mode 100644
index 0000000..25c926b
--- /dev/null
+++ b/examples/api/test/ui/text/font_feature.font_feature_ordinal_forms.0_test.dart
@@ -0,0 +1,24 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+import 'dart:ui';
+import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
+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(),
+ ),
+ );
+
+ 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()]));
+ });
+}
diff --git a/examples/api/test/ui/text/font_feature.font_feature_proportional_figures.0_test.dart b/examples/api/test/ui/text/font_feature.font_feature_proportional_figures.0_test.dart
new file mode 100644
index 0000000..fedcc2f
--- /dev/null
+++ b/examples/api/test/ui/text/font_feature.font_feature_proportional_figures.0_test.dart
@@ -0,0 +1,24 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+import 'dart:ui';
+import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
+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(),
+ ),
+ );
+
+ 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()]));
+ });
+}
diff --git a/examples/api/test/ui/text/font_feature.font_feature_scientific_inferiors.0_test.dart b/examples/api/test/ui/text/font_feature.font_feature_scientific_inferiors.0_test.dart
new file mode 100644
index 0000000..b1c8260
--- /dev/null
+++ b/examples/api/test/ui/text/font_feature.font_feature_scientific_inferiors.0_test.dart
@@ -0,0 +1,24 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+import 'dart:ui';
+import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
+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(),
+ ),
+ );
+
+ 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()]));
+ });
+}
diff --git a/examples/api/test/ui/text/font_feature.font_feature_slashed_zero.0_test.dart b/examples/api/test/ui/text/font_feature.font_feature_slashed_zero.0_test.dart
new file mode 100644
index 0000000..7747067
--- /dev/null
+++ b/examples/api/test/ui/text/font_feature.font_feature_slashed_zero.0_test.dart
@@ -0,0 +1,24 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+import 'dart:ui';
+import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
+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(),
+ ),
+ );
+
+ 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()]));
+ });
+}
diff --git a/examples/api/test/ui/text/font_feature.font_feature_stylistic_alternates.0_test.dart b/examples/api/test/ui/text/font_feature.font_feature_stylistic_alternates.0_test.dart
new file mode 100644
index 0000000..ab79d50
--- /dev/null
+++ b/examples/api/test/ui/text/font_feature.font_feature_stylistic_alternates.0_test.dart
@@ -0,0 +1,24 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+import 'dart:ui';
+import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
+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(),
+ ),
+ );
+
+ 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()]));
+ });
+}
diff --git a/examples/api/test/ui/text/font_feature.font_feature_stylistic_set.0_test.dart b/examples/api/test/ui/text/font_feature.font_feature_stylistic_set.0_test.dart
new file mode 100644
index 0000000..c2e0aae
--- /dev/null
+++ b/examples/api/test/ui/text/font_feature.font_feature_stylistic_set.0_test.dart
@@ -0,0 +1,32 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+import 'dart:ui';
+import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
+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(),
+ ),
+ );
+
+ 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.stylisticSet(2),
+ FontFeature.stylisticSet(3),
+ FontFeature.stylisticSet(4),
+ ],
+ ),
+ );
+ });
+}
diff --git a/examples/api/test/ui/text/font_feature.font_feature_stylistic_set.1_test.dart b/examples/api/test/ui/text/font_feature.font_feature_stylistic_set.1_test.dart
new file mode 100644
index 0000000..200e35b
--- /dev/null
+++ b/examples/api/test/ui/text/font_feature.font_feature_stylistic_set.1_test.dart
@@ -0,0 +1,31 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+import 'dart:ui';
+import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
+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(),
+ ),
+ );
+
+ 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),
+ ],
+ ),
+ );
+ });
+}
diff --git a/examples/api/test/ui/text/font_feature.font_feature_subscripts.0_test.dart b/examples/api/test/ui/text/font_feature.font_feature_subscripts.0_test.dart
new file mode 100644
index 0000000..80e7d21
--- /dev/null
+++ b/examples/api/test/ui/text/font_feature.font_feature_subscripts.0_test.dart
@@ -0,0 +1,26 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+import 'dart:ui';
+import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
+import 'package:flutter_api_samples/ui/text/font_feature.font_feature_subscripts.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(),
+ ),
+ );
+
+ 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.subscripts()]),
+ );
+ });
+}
diff --git a/examples/api/test/ui/text/font_feature.font_feature_superscripts.0_test.dart b/examples/api/test/ui/text/font_feature.font_feature_superscripts.0_test.dart
new file mode 100644
index 0000000..951b60b
--- /dev/null
+++ b/examples/api/test/ui/text/font_feature.font_feature_superscripts.0_test.dart
@@ -0,0 +1,26 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+import 'dart:ui';
+import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
+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(),
+ ),
+ );
+
+ 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.superscripts()]),
+ );
+ });
+}
diff --git a/examples/api/test/ui/text/font_feature.font_feature_swash.0_test.dart b/examples/api/test/ui/text/font_feature.font_feature_swash.0_test.dart
new file mode 100644
index 0000000..7ab5624
--- /dev/null
+++ b/examples/api/test/ui/text/font_feature.font_feature_swash.0_test.dart
@@ -0,0 +1,26 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+import 'dart:ui';
+import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
+import 'package:flutter_api_samples/ui/text/font_feature.font_feature_swash.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(),
+ ),
+ );
+
+ 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!.fontFeatures,
+ equals(const <FontFeature>[FontFeature.swash()]),
+ );
+ });
+}
diff --git a/examples/api/test/ui/text/font_feature.font_feature_tabular_figures.0_test.dart b/examples/api/test/ui/text/font_feature.font_feature_tabular_figures.0_test.dart
new file mode 100644
index 0000000..57888d4
--- /dev/null
+++ b/examples/api/test/ui/text/font_feature.font_feature_tabular_figures.0_test.dart
@@ -0,0 +1,26 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+import 'dart:ui';
+import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
+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(),
+ ),
+ );
+
+ 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.tabularFigures()]),
+ );
+ });
+}