CatalystProvider class

Convenience widget that sets up the full Catalyst UI scope in one step.

Place this inside your navigator (e.g. as the home of a WidgetsApp) to wire up theming and all Catalyst overlay dependencies at once.

Light theme only:

CatalystProvider(
  theme: ThemeData.light(fontFamily: 'Inter'),
  child: MyHomePage(),
)

Automatic dark / light switching:

CatalystProvider(
  theme: ThemeData.light(fontFamily: 'Inter'),
  darkTheme: ThemeData.dark(fontFamily: 'Inter'),
  child: MyHomePage(),
)

Force a specific mode:

CatalystProvider(
  theme: ThemeData.light(fontFamily: 'Inter'),
  darkTheme: ThemeData.dark(fontFamily: 'Inter'),
  themeMode: ThemeMode.dark,
  child: MyHomePage(),
)
Inheritance
Available extensions

Constructors

CatalystProvider({required ThemeData theme, required Widget child, ThemeData? darkTheme, ThemeMode themeMode = ThemeMode.system, Key? key})
Creates a Catalyst provider scope.
const

Properties

child Widget
The widget subtree receiving the Catalyst scope.
final
darkTheme ThemeData?
The dark theme. When provided alongside themeMode set to ThemeMode.system, the active theme switches automatically with the platform brightness.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
theme ThemeData
The light theme, and the fallback when darkTheme is not supplied.
final
themeMode ThemeMode
Controls which theme is applied. Defaults to ThemeMode.system.
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited
withBrightness(double amount) Widget

Available on Widget, provided by the BrightnessFilter extension

Applies a multiplicative brightness factor to this widget.

Operators

operator ==(Object other) bool
The equality operator.
inherited