removeField method

void removeField(
  1. String key, {
  2. int? index,
})

remove field and dispose manage item if use FormGroupManage.createListcreate data you can use removeField next param index delete Specify key if you need remove all index prefix key,you can use removeFieldByIndex

Implementation

void removeField(String key, {int? index}) {
  String _searchKey = key;
  if (index != null) {
    _searchKey = '$index.$_searchKey';
  }
  if (_list.containsKey(_searchKey)) {
    FormGroupItem _temp = _list[_searchKey]!;
    _list.remove(_searchKey);
    _temp.dispose();
  }
}