bdlukaa / fluent_ui

Implements Microsoft's WinUI3 in Flutter.
https://bdlukaa.github.io/fluent_ui/
BSD 3-Clause "New" or "Revised" License
2.97k stars 464 forks source link

Checkbox that can be used with Forms #1120

Closed omnisci3nce closed 2 months ago

omnisci3nce commented 2 months ago

Is your feature request related to a problem? Please describe. I'd like to be able to use the Checkbox component in a form.

Describe the solution you'd like I am quite new to Flutter but from what I can tell to do this it must extend FormField like the components in the /forms subdirectory.

Describe alternatives you've considered N/A

Additional context I'd be happy to have a go at implementing this if it is something you think would be useful for the library. As I said, I'm new to Flutter and Dart but the checkbox should be fairly small in scope compared to other form inputs I would hope.

If this is not useful and it's easy enough for people to just roll it themselves or I'm massively misunderstanding the built in Form system in Flutter, feel free to close this.

Also, thanks for an awesome library!

bdlukaa commented 2 months ago

FormField is usually used alongside validators. A checkbox, in most of the cases, does not implement this kind of thing. Also, in Windows UI, this behavior is also not described.

One can save the state of the checkbox and validate if when the user presses a button, if that's the case. I believe implementing a FormField for it is an overkill.