ColorModel class
Represents a color configuration for a Flutter project clone.
This model stores a color value (in hex format) and an optional name for organizing and referencing colors throughout the application.
Example:
final primaryColor = ColorModel(
color: '#FF5733',
name: 'Primary'
);
Constructors
- ColorModel({required String? color, required String? name})
- Creates a new ColorModel instance.
-
ColorModel.fromJson(Map<
String, dynamic> json) -
Creates a ColorModel instance from a JSON map.
factory
Properties
- color → String?
-
The color value in hex format (e.g., '#FF5733').
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- name → String?
-
An optional name to identify this color (e.g., 'Primary', 'Secondary').
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
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