Skip to content

Instantly share code, notes, and snippets.

@timsneath
Created April 5, 2018 00:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timsneath/a884bf996b3f667681dc4d36a5d36498 to your computer and use it in GitHub Desktop.
Save timsneath/a884bf996b3f667681dc4d36a5d36498 to your computer and use it in GitHub Desktop.
Adding a font to existing Flutter code
// declaring a text style based on custom font
const jokeTextStyle = const TextStyle(
fontFamily: 'Patrick Hand',
fontSize: 34.0,
color: Colors.black87,
letterSpacing: -0.5,
fontStyle: FontStyle.normal,
fontWeight: FontWeight.normal);
// now all we have to do is add a style to the Text widget
final decoded = json.decode(snapshot.data);
if (decoded['status'] == 200) {
return new Text(decoded['joke'], style: jokeTextStyle);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment