How to use Custom Font in Text Style - Flutter Tutorial - Android/iOS Hybrid Application Development

Опубликовано: 07 Июнь 2019
на канале: Sciker
519
4

if you don't know how to install Flutter SDK in your MacOS, kindly check this video:    • How to setup Flutter SDK in MacOS   Also please follow Flutter Tutorials Playlist :    • Flutter Tutorials  

In this video also we are looking for how to fix error call Flutter Pub: Expected a key while parsing a block mapping. path:

fonts:
family: Roboto
fonts:
asset: fonts/Roboto-Bold.ttf
weight: 700
asset: fonts/Roboto-Light.ttf
weight: 300
asset: fonts/Roboto-Thin.ttf
weight: 100

dart code:

import 'package:flutter/material.dart';
main(){
runApp(MaterialApp(

home: Scaffold(
appBar: AppBar(
title: Text('Custom Fonts App', style: TextStyle(
fontFamily: 'Roboto', fontWeight: FontWeight.w100

)),
),
),
));
}