clear method

dynamic clear({
  1. bool refreshState = true,
})

Clear the form

Implementation

clear({bool refreshState = true}) {
  _data.forEach((key, value) {
    _data[key] = null;
  });
  _dummyData.forEach((key, value) {
    _dummyData[key] = null;
  });
  if (refreshState) {
    // update the state
    NyForm.stateClearData(stateName);
  }
}