BaseColor class
Use different colors for Brightness.light and Brightness.dark
- Must call build(context) method when using
- In cupertino mode, dynamicColor value takes priority
- In material mode, color and darkColor values take priority
Constructors
- BaseColor({Color? color, Color? darkColor, CupertinoDynamicColor? dynamicColor = CupertinoColors.secondarySystemBackground, BaseParam? baseParam})
-
const
- BaseColor.highContrast({Color? color, Color? darkColor, CupertinoDynamicColor? dynamicColor = const CupertinoDynamicColor.withBrightness(color: Colors.black, darkColor: Colors.white), BaseParam? baseParam})
-
High contrast, generally used for background color
Default: Brightness.light uses black, Brightness.dark uses white
const
Properties
- baseParam → BaseParam?
-
Personalization parameters, gets platform parameters first, then mode parameters
finalinherited
- color → Color?
-
When brightness = Brightness.light
final
- darkColor → Color?
-
When brightness = Brightness.dark
final
- dynamicColor → CupertinoDynamicColor?
-
CupertinoDynamicColor
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
beforeBuild(
BuildContext context) → void -
Called before build
inherited
-
beforeBuildByCupertino(
BuildContext context) → void -
Called before buildByCupertino
inherited
-
beforeBuildByCupertinoNative(
BuildContext context) → void -
Called before buildByCupertinoNative (native iOS implementation)
inherited
-
beforeBuildByMaterial(
BuildContext context) → void -
Called before buildByMaterial
inherited
-
build(
BuildContext context) → dynamic -
inherited
-
buildByCupertino(
BuildContext context) → Color - build on cupertino mode (Flutter implementation)
-
buildByCupertinoNative(
BuildContext context) → dynamic -
build on cupertino mode with native iOS components (cupertino_native package)
This is called when baseParam.nativeIOS = true
Default implementation falls back to buildByCupertino()
inherited
-
buildByMaterial(
BuildContext context) → Color - build on material mode
-
commonBuild(
BuildContext context, BaseParam? baseParam) → dynamic -
inherited
-
getBuildMode(
BaseParam? baseParam) → WidgetBuildMode -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
valueOf(
String key, dynamic value) → dynamic -
override
-
valueOfBaseParam(
BaseParam? baseParam, String key, dynamic value) → dynamic -
No reflection available in Dart
First get value from platform, then from mode, finally from value itself
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited