A tool to help you find the font you want to use in your Flutter app.
- Enables iterative process to continually refine your list of favorite fonts until you find the right one.
- Like or unlike fonts in current list.
- Save likes as a list and then refine that list and save it again...and repeat.
- Switch between lists, state is saved (as long as app is not closed)
- Export a font-list as JSON so that your developer/teammates can import the list (import not yet implemented).
See example for a working app.
in your pubspec.yaml
add the following dependencies:
flutter_riverpod: ^2.3.2
flutter_font_finder: ^0.0.1
In order to initialize riverpod for your app you will need to wrap your main widget with a ProviderScope
widget.
void main() {
runApp(
const ProviderScope(
child: MyApp(),
),
);
}
Next, under your MaterialApp
widget you will need to watch the currentFontProvider
which is imported via import 'package:flutter_font_finder/flutter_font_finder.dart';
MaterialApp(
theme: ThemeData(
primarySwatch: Colors.blue,
textTheme: ref.watch(currentFontProvider),
)
Finally, you will need to add a FontFinder
widget to your app. Make sure to set toolbarHeight:125
otherwise the widget will be cut off. This widget will allow you to search for fonts and select the one you want to use. Here is one example:
Scaffold(
appBar: AppBar(
title: const FontSel(),
toolbarHeight: 125,
),