getByKey method

FormGroupItem getByKey(
  1. String key, {
  2. int? index,
})

get manage by key, index use in list form if you create data by FormGroupManage.createList,can use index get manage, In fact, list form must use index param

Implementation

FormGroupItem getByKey(String key, {int? index}) {
  String _searchKey = key;
  if (index != null) {
    _searchKey = '$index.$_searchKey';
  }
  if (!_list.containsKey(_searchKey)) {
    throw ArgumentError('$_searchKey is not exit in manage');
  }
  return _list[_searchKey]!;
}