From c19f75c6a649ee5fbc0d73b33bf49f4e65dbd085 Mon Sep 17 00:00:00 2001 From: Felipe Date: Fri, 22 Dec 2023 16:38:55 -0500 Subject: [PATCH] update --- lib/src/presentation/screens/profile/profile.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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;