FTheme class - forui.theme library (original) (raw)
Applies a theme to descendant widgets.
A theme configures the colors and typographic choices of Forui widgets. The actual configuration is stored in a FThemeData. Descendant widgets obtain the current theme's FThemeData via either FThemeBuildContext.theme, or FTheme.of. When a widget uses either, it is automatically rebuilt if the theme later changes.
class Parent extends StatelessWidget {
@override
Widget build(BuildContext context) => FTheme(
data: FThemes.zinc.light,
child: Child(),
);
}
class Child extends StatelessWidget {
@override
Widget build(BuildContext context) {
final FThemeData theme = context.theme;
final FThemeData sameTheme = FTheme.of(context);
return const Placeholder();
}
}
See FThemeData which describes of the actual configuration of a theme.
Properties
The widget below this widget in the tree.
final
The color and typography values for descendant Forui widgets.
final
The hash code for this object.
no setterinherited
Controls how one widget replaces another widget in the tree.
finalinherited
A representation of the runtime type of the object.
no setterinherited
textDirection → TextDirection?
The text direction. Defaults to the text direction inherited from its nearest ancestor.
final