HexColorConverter class

Implements serialization and deserialization for Color from and to String.

The string is expected to be a hexadecimal color value.

Usage:

@JsonSerializable()
class MyClass {
  @JsonKey(name: 'color')
  @HexColorConverter()
  final Color color;

  const MyClass(this.color);
}
Inheritance

Constructors

HexColorConverter()
Implements serialization and deserialization for Color from and to String.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

fromJson(String json) Color
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson(Color object) String
override
toString() String
A string representation of this object.
inherited

Operators

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