holtzmak / Humane-Transport

A Flutter and Firebase mobile application to record Canadian animal transport and transfer of care documentation
https://sanakhan1997.github.io/Humane-Transport/
GNU General Public License v3.0
6 stars 3 forks source link

Update form fields for validation #220

Closed holtzmak closed 3 years ago

holtzmak commented 3 years ago

The big part of #205. Some TODOs are mistakenly 136 or 134. I'll being going through app TODOs and assigning them next PR.

In this PR I have done:

  1. Update all form fields to have some form of validation
  2. Update the form fields to have the outlined box decoration. Maybe this is possible using app theme.
  3. Update the editing screen so saving the ATR when backing out (not hitting save or submit buttons) saves as-is
  4. Update the save and submit buttons to validate their respective forms

    Validation, when called outside the state you're validating, will not cause the red text to appear. The save button in that widget will cause the red text to appear.

    So, when hitting submit, we can't make the red text appear, but we can tell the transporter which section needs to be looked at again. I'll be doing this in the next PR.

  5. Update DynamicFormField to be less generically confusing, also dropped the expensive ListView.builder shrink wrap
  6. Updated tests accordingly
  7. Fixed a hidden bug with the TimeOfDay type and the database. It should be DateTime where we ignore the date. Changed accordingly

I'll be leaving further GUI changes to the form fields to #214 (like making the menus larger, adding white text to the save and submit buttons, because they're black now as seen in the video (hard to see))


Changes look like:

https://user-images.githubusercontent.com/32527219/111082800-c4d01500-84cf-11eb-97b5-0978c72dff2b.mp4

https://user-images.githubusercontent.com/32527219/111082801-c7326f00-84cf-11eb-8c34-9d677277ff15.mp4

https://user-images.githubusercontent.com/32527219/111082807-cbf72300-84cf-11eb-9191-4033c1bd2d1e.mp4