| 1 | // Copyright 2014 The Flutter Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | import 'package:flutter/widgets.dart'; |
| 6 | |
| 7 | /// Flutter code sample for [FontFeature.subscripts]. |
| 8 | |
| 9 | void main() => runApp(const ExampleApp()); |
| 10 | |
| 11 | class ExampleApp extends StatelessWidget { |
| 12 | const ExampleApp({super.key}); |
| 13 | |
| 14 | @override |
| 15 | Widget build(BuildContext context) { |
| 16 | return WidgetsApp( |
| 17 | builder: (BuildContext context, Widget? navigator) => const ExampleWidget(), |
| 18 | color: const Color(0xffffffff), |
| 19 | ); |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | class ExampleWidget extends StatelessWidget { |
| 24 | const ExampleWidget({super.key}); |
| 25 | |
| 26 | @override |
| 27 | Widget build(BuildContext context) { |
| 28 | // The Piazzolla font can be downloaded from Google Fonts |
| 29 | // (https://www.google.com/fonts). |
| 30 | return const Text( |
| 31 | 'Line from x1,y1 to x2,y2' , |
| 32 | style: TextStyle( |
| 33 | fontFamily: 'Piazzolla' , |
| 34 | fontFeatures: <FontFeature>[FontFeature.subscripts()], |
| 35 | ), |
| 36 | ); |
| 37 | } |
| 38 | } |
| 39 | |