GaspardMerten / date_field

Flutter DateField and DateFormField
Other
46 stars 32 forks source link

Fix empty value to resolve hintText layout issue #68

Closed mwoelk closed 5 months ago

mwoelk commented 6 months ago

Changed how empty values are displayed.

Currently, if no date is given, a SizedBox is rendered. Instead, a Text with an empty string should be rendered. The difference is that an empty SizedBox has a height of 0 whereas the empty Text height corresponds to the line height of the text. This is a better suited placeholder as the height will always stay the same if there is or isn't a value present.

This fixes issues with the display of e.g. hintText when no label is given as it would otherwise result in different field sizes or when using outlined fields, the hintText would be misplaced.

Before: Screenshot 2024-04-26 at 15 42 07

After: Screenshot 2024-04-26 at 15 43 02