ListEditingController<T, C extends ValueNotifier<T?> > class
A controller for managing a list of other controllers.
Use it to create editors of lists that contain individual item editors. It supports adding, deleting, and reordering items.
- Inheritance
-
- Object
- ChangeNotifier
- ValueNotifier<
List< T?> > - ListEditingController
Constructors
-
ListEditingController({required ValueGetter<
C> createItemController, required int maxLength, 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
-
createItemController
→ ValueGetter<
C> -
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<
C> -
Returns the current list of controllers.
no setterinherited
- maxLength → int
-
The upper limit for the item count.
finalinherited
- minLength → int
-
The lower limit for the item count.
finalinherited
-
nonNullValues
→ List<
T> -
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
↔ List<
T?> -
The current value stored in this notifier.
getter/setter pairoverride
Methods
-
add(
T? value) → C - Adds an item.
-
addController(
C controller) → void -
inherited
-
addEmpty(
) → C - Adds an empty item.
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
deleteItemController(
C controller) → void -
Deletes and disposes an item controller.
It should be present in the list.
inherited
-
deleteItemControllerAndAfter(
C 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 atnewIndex
.inherited -
replaceControllers(
List< C> controllers) → void -
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited