FlexiFontController class
Controller class for managing font selection and persistence
- Inheritance
-
- Object
- ChangeNotifier
- FlexiFontController
Constructors
- FlexiFontController({StorageProvider? storageProvider})
-
Get the singleton instance
factory
Properties
-
availableFonts
→ List<
FontOption> -
Get the list of available font options
no setter
- fontScale → double
-
Get the current font scale factor
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- isInitialized → bool
-
Check if the controller has been initialized
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectedFont → FontOption?
-
Get the currently selected font option
no setter
Methods
-
addFont(
FontOption font) → void - Add a custom font to the available fonts
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
applyToTheme(
ThemeData theme) → ThemeData - Apply the selected font to a ThemeData
-
dispose(
) → void -
Dispose the controller
override
-
getTextStyle(
{TextStyle? baseStyle}) → TextStyle - Get a TextStyle with the selected font applied
-
initialize(
{List< FontOption> ? customFonts, FontOption? defaultFont, bool includeGoogleFonts = true}) → Future<void> - Initialize the controller with default fonts and load saved preferences
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
removeFont(
FontOption font) → void - Remove a font from the available fonts
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
resetToDefaults(
) → Future< void> - Reset to default font and scale
-
setFont(
FontOption font) → Future< void> - Set the selected font and save to storage
-
setFontScale(
double scale) → Future< void> - Set the font scale factor and save to storage
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited