Still, you may at any time choose to include the font file in the assets, and the Google Fonts package will prioritize pre-bundled files over http fetching.īecause of this, the Google Fonts package allows developers to choose between pre-bundling the fonts and loading them over http, while using the same API.įor example, say you want to use the Lato font from Google Fonts in your Flutter app.įirst, add the google_fonts package to your pubspec dependencies. This is ideal for development, and can be the preferred behavior for production apps thatĪre looking to reduce the app bundle size. Instead, they can be fetched once via http at runtime, and cached in the app's file system.
otf files do not need to be stored in your assets folder and mapped in (and their variants) from in your Flutter app.
The google_fonts package for Flutter allows you to easily use any of the 977 fonts