EdgeFactory<T extends Edge> class
abstract
Factory interface for creating edge instances from JSON data.
Implement this interface to provide deserialization logic for your
custom edge types. This is used by Box.loadEdges to convert JSON
data back into edge objects.
Example:
class FriendshipEdgeFactory implements EdgeFactory<FriendshipEdge> {
@override
FriendshipEdge fromJson(Map<String, dynamic> json) {
return FriendshipEdge(
from: json['from'] as String,
to: json['to'] as String,
weight: (json['weight'] as num).toDouble(),
);
}
}
Constructors
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 an edge 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