mirror of
https://github.com/nisrulz/flutter-examples.git
synced 2025-09-20 23:36:36 +08:00
implemented custom font in using_custom_fonts example
This commit is contained in:
BIN
using_custom_fonts/data_repo/fonts/Pacifico-Regular.ttf
Executable file
BIN
using_custom_fonts/data_repo/fonts/Pacifico-Regular.ttf
Executable file
Binary file not shown.
@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
|
|||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
runApp(new MaterialApp(
|
runApp(new MaterialApp(
|
||||||
// Title
|
// Title
|
||||||
title: "Using Custom Fonts",
|
title: "Using Custom Fonts",
|
||||||
// Home
|
// Home
|
||||||
home: new Scaffold(
|
home: new Scaffold(
|
||||||
@ -16,7 +16,13 @@ void main() {
|
|||||||
// Center the content
|
// Center the content
|
||||||
child: new Center(
|
child: new Center(
|
||||||
// Add Text
|
// Add Text
|
||||||
child: new Text("The quick brown fox jumps over the lazy dog"),
|
child: new Text("The quick brown fox jumps over the lazy dog",
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.blueAccent,
|
||||||
|
fontFamily: 'Pacifico',
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
fontSize: 36.0)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)));
|
)));
|
||||||
|
@ -48,3 +48,8 @@ flutter:
|
|||||||
# - asset: fonts/TrajanPro.ttf
|
# - asset: fonts/TrajanPro.ttf
|
||||||
# - asset: fonts/TrajanPro_Bold.ttf
|
# - asset: fonts/TrajanPro_Bold.ttf
|
||||||
# weight: 700
|
# weight: 700
|
||||||
|
fonts:
|
||||||
|
- family: Pacifico
|
||||||
|
fonts:
|
||||||
|
- asset: data_repo/fonts/Pacifico-Regular.ttf
|
||||||
|
weight: 400
|
Reference in New Issue
Block a user