@@ -20,6 +20,7 @@ class AppTextField extends StatefulWidget {
20
20
this .contentPadding,
21
21
this .autofillHints,
22
22
this .hintTextBelowTextField,
23
+ this .maxLength,
23
24
}) : isPasswordField = false ,
24
25
isObscureText = false ;
25
26
@@ -40,6 +41,7 @@ class AppTextField extends StatefulWidget {
40
41
this .autofillHints,
41
42
this .hintTextBelowTextField,
42
43
this .contentPadding,
44
+ this .maxLength,
43
45
}) : isPasswordField = true ,
44
46
isObscureText = true ;
45
47
@@ -60,6 +62,7 @@ class AppTextField extends StatefulWidget {
60
62
final FocusNode ? focusNode;
61
63
final int ? minLines;
62
64
final EdgeInsetsGeometry ? contentPadding;
65
+ final int ? maxLength;
63
66
64
67
@override
65
68
State <AppTextField > createState () => _AppTextFieldState ();
@@ -100,11 +103,13 @@ class _AppTextFieldState extends State<AppTextField> {
100
103
onChanged: widget.onChanged,
101
104
autofillHints: widget.autofillHints,
102
105
focusNode: widget.focusNode,
106
+ maxLength: widget.maxLength,
103
107
decoration: InputDecoration (
104
108
filled: true ,
105
109
fillColor: widget.backgroundColor ?? context.colorScheme.grey100,
106
110
hintText: widget.hintText,
107
- contentPadding: widget.contentPadding ?? const EdgeInsets .only (left: Insets .small12),
111
+ contentPadding: widget.contentPadding ??
112
+ const EdgeInsets .only (left: Insets .small12, right: Insets .small12),
108
113
errorMaxLines: 2 ,
109
114
focusedBorder: OutlineInputBorder (
110
115
borderRadius: BorderRadius .circular (Insets .xsmall8),
0 commit comments