// ignore_for_file: prefer_final_fields abstract class TimeSeq { List pre; List now; void update(List new_) { pre = now; now = new_; if (pre.length != now.length) { pre.removeWhere((e) => now.any((el) => e.same(el))); pre.addAll(now.where((e) => pre.every((el) => !e.same(el)))); } } TimeSeq(this.pre, this.now); } abstract class TimeSeqIface { bool same(T other); }