RequiredSizeConverter class
A non-nullable JSON converter for Flutter's Size class.
Similar to SizeConverter but for non-nullable Size fields. This converter serializes Size objects to JSON as a map with 'width' and 'height' keys, and deserializes JSON maps back to Size objects.
Usage with json_serializable:
@JsonSerializable()
class MyClass {
@RequiredSizeConverter()
final Size dimensions;
MyClass(this.dimensions);
}
Constructors
- RequiredSizeConverter()
-
Creates a const instance of RequiredSizeConverter.
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
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited