-Declare font in the pubspec.yaml
-use the font in widgets.
home.dart
pubspec.yaml
fonts: - family: Schyler fonts: - asset: fonts/Schyler-Regular.ttf - asset: fonts/Schyler-Italic.ttf style: italic - family: Trajan Pro fonts: - asset: fonts/TrajanPro.ttf - asset: fonts/TrajanPro_Bold.ttf weight: 700
import 'dart:ui'; import 'package:flutter/material.dart'; class Home extends StatelessWidget { @override Widget build(BuildContext context) { return Container( alignment: Alignment.center, color: Colors.deepOrangeAccent, child: Text( "Pizza", textDirection: TextDirection.ltr, style: TextStyle( fontSize: 80.0, decoration:TextDecoration.none, fontFamily: 'Schyler', ), )); } }
No comments:
Post a Comment