Remove duplicate setState in TextFormFieldState.reset (#69062)

Small performance optimization by removing a duplicate setState call.
This commit is contained in:
Justin McCandless 2020-12-14 10:26:52 -08:00 committed by GitHub
parent cd294666bf
commit a42aa04826
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -359,10 +359,10 @@ class _TextFormFieldState extends FormFieldState<String> {
@override
void reset() {
super.reset();
setState(() {
// setState will be called in the superclass, so even though state is being
// manipulated, no setState call is needed here.
_effectiveController!.text = widget.initialValue ?? '';
});
super.reset();
}
void _handleControllerChanged() {