File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ class TextInputField extends StatelessWidget {
1414 // NUEVO: Propiedad para el icono del final (ojito)
1515 final Widget ? suffixIcon;
1616
17+ final String ? Function (String ? )? validator;
18+
1719 const TextInputField ({
1820 super .key,
1921 required this .label,
@@ -26,6 +28,7 @@ class TextInputField extends StatelessWidget {
2628 this .onFieldSubmitted,
2729 this .readOnly = false ,
2830 this .suffixIcon, // Lo recibimos en el constructor
31+ this .validator, // Lo recibimos aquí
2932 });
3033
3134 @override
@@ -56,6 +59,7 @@ class TextInputField extends StatelessWidget {
5659 focusNode: focusNode,
5760 onFieldSubmitted: onFieldSubmitted,
5861 readOnly: readOnly,
62+ validator: validator,
5963 decoration: InputDecoration (
6064 labelText: label,
6165 labelStyle: TextStyle (color: Colors .grey[600 ]),
You can’t perform that action at this time.
0 commit comments