Created
October 7, 2020 10:31
-
-
Save mg/d141dbc29d99d81e45dc016e959fb1e1 to your computer and use it in GitHub Desktop.
Revisions
-
mg created this gist
Oct 7, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ class MyListNotifier extends ValueNotifier<MyList> { MyListNotifier(MyList myList) : super(myList) { value.setNotifyListeners(notifyListeners); } } class MyList<E> extends List<E> { VoidCallback _notifyListeners; void setNotifyListeners(VoidCallback notifyListeners) { this.notifyListeners = notifyListeners; } @override void add(E element) { super.add(element); _notifyListeners(); } // etc for needed mutating methods }