fix: show error when description is empty#514
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds validation for empty task descriptions when editing through the description dialog. The implementation extracts the inline dialog code into a new _DescriptionEditDialog StatefulWidget to enable state management for displaying validation errors.
Key Changes:
- Converted the inline dialog builder to a separate
_DescriptionEditDialogStatefulWidget - Added validation to prevent empty descriptions with an inline error message
- Replaced
TextFieldwithTextFormFieldwrapped in aFormfor error display
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| class _DescriptionEditDialogState extends State<_DescriptionEditDialog> { | ||
| late TextEditingController controller; | ||
| final _formKey = GlobalKey<FormState>(); |
There was a problem hiding this comment.
The _formKey is declared but never used. Consider either:
- Using it with
_formKey.currentState?.validate()to validate the form, or - Removing it if manual validation via
errorTextis preferred.
Currently, the code manually validates by checking controller.text.trim().isEmpty and setting errorText, which makes the Form wrapper unnecessary.
SGI-CAPP-AT2
left a comment
There was a problem hiding this comment.
We should use GetX controller instead of using Stateful Widgets
|
Thanks for the review! |
PR CCExtractor#514 * fix: show error when description is empty * refactor: move description validation to GetX controller
Description
Fixes missing validation when editing a task description.
When the user presses Submit on an empty description, the dialog now remains open and shows an inline error message.
Fixes #513
Screenshots
Checklist