NodeFactory<T extends Node> class abstract

Factory interface for creating node instances from JSON data.

Implement this interface to provide deserialization logic for your custom node types. This is used by Box.loadNode to convert JSON data back into node objects.

Example:

class PersonNodeFactory implements NodeFactory<PersonNode> {
  @override
  PersonNode fromJson(Map<String, dynamic> json) {
    return PersonNode(
      id: json['id'] as String,
      name: json['name'] as String,
      age: json['age'] as int,
    );
  }
}

Constructors

NodeFactory()

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(Map<String, dynamic> json) → T
Creates a node instance from JSON data.
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