value method

String value(
  1. String id
)

Use this function to get a text field value using the unique id you supplied earlier!

{@tool snippet}

        onPressed: () {
          //* Get controller value
          _formController.value("id1")
}

{@end-tool}

Implementation

String value(String id) {
  late String ret;
  if (_textControllers.containsKey(id) && _textControllers[id] != null) {
    ret = _textControllers[id]!.text;
  } else {
    throw Exception(
        "No controllers found with the provided id, Did you create a controller with this id? Did you wait for the controller to initializ?");
  }
  return ret;
}