initState method

  1. @override
void initState()
override

Called when this state object is first inserted into the tree.

Implementation

@override
void initState() {
  super.initState();
  _value = widget.initialValue;
  WidgetsBinding.instance.addPostFrameCallback((_) {
    final formScope = FormScope.of(context);
    if (formScope != null) {
      formScope.formState.register(this);
    }
  });
}