getFormValue<T> method

T? getFormValue<T>(
  1. FormKey<T> key
)

Gets the current value for a form field by key.

Returns null if the form or field is not found.

Implementation

T? getFormValue<T>(FormKey<T> key) {
  final formController = Data.maybeFind<FormController>(this);
  if (formController != null) {
    final state = formController.getValue(key);
    return state;
  }
  return null;
}