diff --git a/lib/src/presentation/screens/profile/profile.dart b/lib/src/presentation/screens/profile/profile.dart index 199a660..e5e480f 100644 --- a/lib/src/presentation/screens/profile/profile.dart +++ b/lib/src/presentation/screens/profile/profile.dart @@ -4,6 +4,7 @@ import 'package:firebase_storage/firebase_storage.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:get/get.dart'; import 'dart:io'; import 'package:intl/intl.dart'; @@ -641,11 +642,14 @@ class _ProfileScreenState extends State { TextFormField( controller: _nameController, maxLength: 50, + inputFormatters: [ + FilteringTextInputFormatter.deny(RegExp(r'\s{2,}')), + ], validator: (value) { - if (value == null || value.isEmpty) { + if (value == null || value.trim().isEmpty) { return 'Porfavor ingrese un nombre.'; } - if (value.length < 5) { + if (value.trim().length < 5) { return 'Debe tener al menos 5 caracteres.'; } return null;