state<T> method

ControlState<T> state<T>({
  1. T? value,
  2. bool? disabled,
})

Creates a ControlState.

You can pass the optional arguments value and disabled to the control state.

Example:

final form = fb.group({
  'name': 'first name'
});

form.resetState({
  'name': fb.state(value: 'name'),
});

print(form.value); // output: {'name': 'name'}

Implementation

ControlState<T> state<T>({T? value, bool? disabled}) {
  return ControlState<T>(value: value, disabled: disabled);
}