29 lines
491 B
Dart
29 lines
491 B
Dart
import 'package:oc_front/models/search.dart';
|
|
|
|
class Graphs {
|
|
static const Map<String, Graph> graphs = {};
|
|
|
|
static Graph getGraph(String id) {
|
|
return graphs[id]!;
|
|
}
|
|
|
|
static void addGraph(String id, Graph graph) {
|
|
graphs[id] = graph;
|
|
}
|
|
|
|
static void removeGraph(String id) {
|
|
graphs.remove(id);
|
|
}
|
|
|
|
static void clear() {
|
|
graphs.clear();
|
|
}
|
|
}
|
|
|
|
class Graph {
|
|
String id;
|
|
List<AbstractItem> items = [];
|
|
|
|
Graph({ required this.id, required this.items }) {
|
|
}
|
|
} |