ListModel<E>.ofObservableMap constructor

ListModel<E>.ofObservableMap({
  1. required ObservableMap<E, dynamic> map,
  2. MModel? container,
  3. GlobalKey<AnimatedListState>? listKey,
  4. AnimationType animationType = AnimationType.slide,
  5. String? attribute,
})

Creates a list model that represents keys in a map

Implementation

ListModel.ofObservableMap({
  required ObservableMap<E, dynamic> map,
  this.container,
  this.listKey,
  this.animationType = AnimationType.slide,
  this.attribute,
}) : _items = map.keys.toList() {
  // Sync changes with the observable map keys
  _dispose = map.observe((change) {
    updateAll(map.keys);
  });
}