MapEditingController<K, V, KC extends ValueNotifier<K?>, VC extends ValueNotifier<V?>> class

A controller for managing a map of other controllers.

Use it to create editors of maps that contain individual key and value editors. It supports adding, deleting, and reordering items.

Inheritance

Constructors

MapEditingController({required ValueGetter<KC> createKeyController, required ValueGetter<VC> createValueController, required int maxLength, bool isReorderable = true, int minLength = 0, bool notifyOnItemChanges = true})

Properties

canAdd bool
Returns if items can be added to this controller. Uses maxLength that was set in the constructor for the upper limit.
no setterinherited
canDelete bool
Returns if items can be deleted from this controller. Uses minLength that was set in the constructor for the lower limit. It also returns true for the empty list
no setterinherited
createKeyController ValueGetter<KC>
final
createValueController ValueGetter<VC>
final
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
isReorderable bool
Whether the map can be reordered.
finalinherited
itemControllers List<MapEntryController<K, V, KC, VC>>
Returns the current list of controllers.
no setterinherited
keys Iterable<K?>
no setter
maxLength int
The upper limit for the item count.
finalinherited
minLength int
The lower limit for the item count.
finalinherited
nonNullValues Map<K, V>
Filters values for non-null after reading them from value.
no setter
notifyOnItemChanges bool
Whether to fire notifyListeners when item controllers fire their notifyListeners.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value Map<K, V?>
The current value stored in this notifier.
getter/setter pairoverride

Methods

add(K? key, V? value) MapEntryController<K, V, KC, VC>
Adds an item.
addController(MapEntryController<K, V, KC, VC> controller) → void
inherited
addEmpty() MapEntryController<K, V, KC, VC>
Adds an empty item.
addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
deleteItemController(MapEntryController<K, V, KC, VC> controller) → void
Deletes and disposes an item controller. It should be present in the list.
inherited
deleteItemControllerAndAfter(MapEntryController<K, V, KC, VC> controller) → void
Deletes and disposes an item controller. It should be present in the list.
inherited
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed).
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
reorder(int oldIndex, int newIndex) → void
Takes a controller at oldIndex and inserts it at newIndex.
inherited
replaceControllers(List<MapEntryController<K, V, KC, VC>> controllers) → void
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited