Tailwind class
Singleton holding library-wide configuration.
Configurable:
- sizeAdapter — install via configSizeAdapter to enable screen-scaling. Defaults to IdentitySizeAdapter (no scaling).
- primaryColor — read from init's context or set directly.
- imageFactory / image loader — see configImageFactory.
Cached by init:
- screenW, screenH — populated from MediaQuery at init time. Used by the hFull/wFull/sScreen/sFull-family getters.
Important: init requires a BuildContext that is inside the MaterialApp widget tree. The context is NOT retained — values are extracted immediately and cached to fields.
Constructors
- Tailwind()
-
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- imageFactory ↔ BaseImageFactory?
-
getter/setter pair
- inputConfig ↔ InputConfig
-
App-wide default appearance for
Input. Defaults to an empty config (no defaults, current behavior). Install via configInput. Per-instanceInputprops always win over these.getter/setter pair - primary → Color
-
Returns the active primary color.
Resolution: primaryColor (populated by init or set directly) ??
Colors.amber.
no setter
- primaryColor ↔ Color?
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- screenH ↔ double
-
Cached screen height in logical pixels. Populated by init.
Returns 0.0 if init hasn't been called yet.
getter/setter pair
- screenW ↔ double
-
Cached screen width in logical pixels. Populated by init.
Returns 0.0 if init hasn't been called yet.
getter/setter pair
- sizeAdapter ↔ SizeAdapter
-
The active size adapter. Defaults to identity (no scaling).
Replace via configSizeAdapter.
getter/setter pair
Methods
-
addImageConfig(
ImageLoaderConfigInterface imageConfig) → void -
configImageFactory(
BaseImageFactory imageFactory) → void -
configInput(
InputConfig config) → void -
Install app-wide default appearance for
Input. Typical call site: app startup. Per-instanceInputprops override these defaults. -
configSizeAdapter(
SizeAdapter adapter) → void - Install a custom size adapter. Typical call site: app startup.
-
init(
BuildContext context, [Color? fallbackPrimary]) → void -
One-shot setup. Pulls needed values out of
contextimmediately and caches them; does NOT retain the context reference. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited