Jsonizable<T> class abstract

The interface to create a Jsonizable class you can register via an object instance using Jsonize.registerClass.

Example:

class MyClass implements Jsonizable<MyClass> {
  String? str;
  MyClass([this.str]);
  factory MyClass.empty() => MyClass();

  @override
  String get jsonClassCode => "mc";
  @override
  dynamic toJson() => str;
  @override
  MyClass? fromJson(value) => MyClass(value);
}

Jsonize.registerClass(MyClass.empty());
Implementers

Constructors

Jsonizable()

Properties

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

Methods

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

Operators

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