TextEditingApp icon indicating copy to clipboard operation
TextEditingApp copied to clipboard

Migration from `Snackbar` to `FormField` validation for empty text edge handling.

Open PearlGrell opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe.

At present, when a user tries to save an empty string, the app shows an error using a Snackbar. However, since the input is inside a modal dialog (which has a barrier), the Snackbar appears behind the dialog and may often be missed by users.


Describe the solution you'd like

Replace the Snackbar-based error with inline form validation. Instead of showing an external message, display the error directly below the text field, turning the border red and showing "Text cannot be empty" when submission is attempted without input.


Approach to be followed

  • Migrate from TextField to a TextFormField wrapped inside a Form.
  • Migrate from TextField to a TextFormField, wrapped in a Form widget.
  • Use a GlobalKey to validate the form before submission.
  • Implement a validator that checks for empty input and returns a string error message.
  • Prevent Navigator.pop() unless the form validates successfully.

Additional context

This approach will make the feedback visible and immediate, directly tied to the input field. It also aligns with common UX practices in form-based dialogs across platforms.

PearlGrell avatar Jul 26 '25 20:07 PearlGrell

Thank you for opening this issue! 🚀 Our team will review it soon. Please make sure you've included all relevant details and followed our Contributing Guidelines. For questions about our project, check out our README and Code of Conduct.

github-actions[bot] avatar Jul 26 '25 20:07 github-actions[bot]

@may-tas please assign me the issue

PearlGrell avatar Jul 26 '25 20:07 PearlGrell