BaseColor class

Brightness.light, Brightness.dark 分别使用2种颜色

  • 使用时必须调用build(context)方法
  • cupertino模式下优先取dynamicColor的值
  • material模式下优先取color和darkColor的值
Inheritance

Constructors

BaseColor({Color color, Color darkColor, CupertinoDynamicColor dynamicColor = CupertinoColors.secondarySystemBackground, Map<String, dynamic> cupertino, Map<String, dynamic> material})
const
BaseColor.highContrast({Color color, Color darkColor, CupertinoDynamicColor dynamicColor = const CupertinoDynamicColor.withBrightness(color: Colors.black, darkColor: Colors.white), Map<String, dynamic> cupertino, Map<String, dynamic> material})
高对比,一般用于背景色 默认Brightness.light取黑色,Brightness.dark取白色
const

Properties

color Color
When brightness = Brightness.light [...]
final
cupertino Map<String, dynamic>
final, inherited
darkColor Color
When brightness = Brightness.dark [...]
final
dynamicColor CupertinoDynamicColor
CupertinoDynamicColor [...]
final
hashCode int
The hash code for this object. [...]
read-only, inherited
material Map<String, dynamic>
final, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

build(BuildContext context) → dynamic
inherited
buildBefore(BuildContext context) → void
build之前调用
inherited
buildByCupertino(BuildContext context) Color
build on cupertino mode
override
buildByCupertinoBefore(BuildContext context) → void
buildByCupertino之前调用
inherited
buildByMaterial(BuildContext context) Color
build on material mode
override
buildByMaterialBefore(BuildContext context) → void
buildByMaterial之前调用
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
inherited
valueFromCupertino(String key, dynamic value) → dynamic
从cupertino获取key对应的值, 如果为null取value的值, 如果还是null则取material里的值
inherited
valueFromMap(Map<String, dynamic> map, String key, dynamic value) → dynamic
从cupertino获取key对应的值, 如果为null取value的值, 如果还是null则取material里的值
inherited
valueFromMaterial(String key, dynamic value) → dynamic
从material获取key对应的值, 如果为null取value的值, 如果还是null则取cupertino里的值
inherited

Operators

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