Skip to content

Commit

Permalink
feat: make text fields design use less space (openfoodfacts#2725)
Browse files Browse the repository at this point in the history
* feat: make text fields design use less space
* chore: simplify comparison

Co-authored-by: monsieurtanuki <fabrice_fontaine@hotmail.com>
  • Loading branch information
VaiTon and monsieurtanuki authored Aug 4, 2022
1 parent 5af58b9 commit bff9e92
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,18 @@ class _SmoothTextFormFieldState extends State<SmoothTextFormField> {
onChanged: widget.onChanged ??
(String data) {
// Rebuilds for changing the eye icon
if (widget.type == TextFieldTypes.PASSWORD) {
if (data.isEmpty) {
setState(() {});
} else if (data.isNotEmpty && data.length > 1) {
setState(() {});
}
if (widget.type == TextFieldTypes.PASSWORD && data.length != 1) {
setState(() {});
}
},
onFieldSubmitted: widget.onFieldSubmitted,
style: TextStyle(fontSize: textSize),
cursorHeight: textSize * (textStyle.height ?? 1.4),
decoration: InputDecoration(
contentPadding: const EdgeInsets.symmetric(
horizontal: LARGE_SPACE,
vertical: SMALL_SPACE,
),
prefixIcon: widget.prefixIcon,
filled: true,
hintStyle: TextStyle(
Expand Down

0 comments on commit bff9e92

Please sign in to comment.