Help you easily uses font from network 💪

In case you want user to use a plenty of custom font from network, This network_font package will help you use your custom font from network, so you don't have to store those fonts in your project directory's asset folder.

Also this package is inspired by google_fonts and cached_network_image

Getting Started

This network_font package will help you use your custom font from network, so you don't have to store in asset folder in the project directory.

How it work?

Basically just like cached_network_image. If your font file from network isn't exists in user's cache directory or expired, this package'll download and store your font to user's cache directory.

How to use?

1️⃣ First step is to import network_font

import 'package:network_font/network_font.dart';

2️⃣ Second step is to declare you network font's data

final NetworkFont _networkFont = NetworkFont('family', url:'font_url');

3️⃣ Last step is to use network_font, there are 3 ways

  1. NetworkFontText Widget

        'NetworkFontText Widget',
        font: _networkFont,
        style: TextStyle(fontSize: 18),
  2. NetworkFont's style

        'NetworkFont Style',
        style: 18),
  3. TextStyle network_font extension

        'NetworkFont Extension',
        style: TextStyle(fontSize: 18).network(_networkFont),

    However there are no different in technical, only code style that's different 🏄‍♂️

Other function


allow you to init font from network to your application.

This function'll read font data from cache. But If font data doesn't exist or expired, this function'll download from fontData.url and store it to user's cache directory.

Also This operation has unnecessary initialization checker to, so call initFont on same fontData multiple-time will not repeated.

import 'package:network_font/network_font.dart';
final NetworkFont _networkFont = NetworkFont('family', url:'font_url');

void initState() {

Widget build(BuildContext context) {
  return Text(
        'Example Text',
        style: TextStyle(fontFamily: fontFamily:,

Note: Currently only support OpenType (OTF) and TrueType (TTF) fonts.


Set expired duration of cached font.

Default is 30 days

final DateTime _oneWeek = const Duration(days: 7);


Note: You should call this before initFont

Join flutter community

🌎 Global FlutterDev Discord

🇹🇭 Thailand Flutter Developer Group

🇹🇭 FlutterDevTH Discord