removeReactiveArrayItem function

void removeReactiveArrayItem(
  1. Map<String, dynamic> formData,
  2. String arrayPath,
  3. int index
)

Removes an item from a reactive nested array

Implementation

void removeReactiveArrayItem(
  Map<String, dynamic> formData,
  String arrayPath,
  int index,
) {
  final arrayData = getNestedFormValue(formData, arrayPath);

  if (arrayData is List && index >= 0 && index < arrayData.length) {
    arrayData.removeAt(index);
  }
}