Open Albert221 opened 3 years ago
Another question: Why doesn't FormFieldState
override didUpdateWidget
? Is it an oversight?
Hello Albert, the value could be null for a tristate checkbox (true, false, null) or for a Dropdown for example .
But generic can take a type like String?
. The developer could then explicitly specify that the type is nullable.
https://github.com/flutter/flutter/blob/40e8620a27f1a608d4df232936a168f134d64d7c/packages/flutter/lib/src/widgets/form.dart#L279-L285
I find it less convenient to use
!
operator as I don't see a case when thevalue
would be null for a field.I'd be grateful for an explanation :)