FlexSchemeColor class
Immutable data class for the main scheme colors used in a FlexColorScheme based color scheme.
The default constructor requires many properties. To make a FlexSchemeColor from a minimum of just the primary color, use the factory FlexSchemeColor.from which only requires the primary color to make a complete color set, but can use the other colors as optional values.
- Mixed in types
- Annotations
Constructors
- FlexSchemeColor({required Color primary, required Color primaryVariant, required Color secondary, required Color secondaryVariant, Color? appBarColor, Color? error})
-
Default constructor.
const
- FlexSchemeColor.from({required Color primary, Color? primaryVariant, Color? secondary, Color? secondaryVariant, Color? appBarColor, Color? error})
-
Make a FlexSchemeColor from just one primary color or possible also
from a more complete color scheme set. This is a convenience factory that
can create a nice toned color schemes based on only the primary color.
factory
Properties
- appBarColor → Color?
-
The color of the app bar.
final
- defaultError → FlexSchemeColor
-
Return a copy of this FlexSchemeColor that will when used, result in a
theme that use the Material Guide's default error color.
no setter
- error → Color?
-
The color to use for input validation errors, e.g. for
InputDecoration.errorText.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- primary → Color
-
The color displayed most frequently across your application's screens
and components.
final
- primaryVariant → Color
-
Typically a darker version of the primary color.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- secondary → Color
-
An accent color that, when used sparingly, calls attention to parts
of your app.
final
- secondaryVariant → Color
-
Typically a darker version of the secondary color.
final
Methods
-
copyWith(
{Color? primary, Color? primaryVariant, Color? secondary, Color? secondaryVariant, Color? appBarColor, Color? error}) → FlexSchemeColor - Copy the object with one or more provided properties changed.
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDark(
[int whiteBlend = 35]) → FlexSchemeColor - Returns a new FlexSchemeColor instance based on this one that is suitable for dark mode.
-
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
-
toStringShort(
) → String -
A brief description of this object, usually just the runtimeType and the
hashCode.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Static Methods
-
effective(
FlexSchemeColor colors, int usedColors, {bool swapColors = false}) → FlexSchemeColor -
Make effective FlexSchemeColor colors using 1...4 of the passed in
colors
based on theusedColors
property.