input method
Implementation
@override
bool input(Fractal f) {
if (f is T && matchSource(f) && f.match(filter)) {
if (f.state == StateF.removed) {
list.remove(f);
notifyListeners();
return false;
}
if (list.contains(f)) return true;
final o = order.entries.first;
if (f case EventFractal ev when ev.syncAt > latestSynch) {
latestSynch = ev.syncAt;
}
list.add(f);
if (o.key == 'created_at') {
list.sort((a, b) {
var ac = a.id;
var bc = a.id;
if (a case EventFractal ef) {
ac = ef.createdAt;
}
if (b case EventFractal ef) {
bc = ef.createdAt;
}
return ac.compareTo(bc);
});
}
notify(f);
return true;
}
return false;
}