fix city
This commit is contained in:
@@ -92,6 +92,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
||||
builder: (context, state) {
|
||||
if (state.status == MyUserStatus.success) {
|
||||
_nameController.text = state.user!.name ?? '';
|
||||
_cityController.text = state.user!.city ?? '';
|
||||
_emailController.text = state.user!.email ?? '';
|
||||
_phoneController.text = state.user!.phone ?? '';
|
||||
_birthdayController.text = state.user!.birthday ?? '';
|
||||
@@ -291,14 +292,16 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
||||
|
||||
if (_nameController.text.isEmpty) {
|
||||
ScaffoldMessenger.of(context).clearSnackBars();
|
||||
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(content: Text('Por favor, ingrese su nombre')));
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('Por favor, ingrese su nombre')));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (_cityController.text.isEmpty) {
|
||||
ScaffoldMessenger.of(context).clearSnackBars();
|
||||
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(content: Text('Por favor, ingrese su ciudad')));
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('Por favor, ingrese su ciudad')));
|
||||
}
|
||||
|
||||
final myUser = state.user!.copyWith(
|
||||
@@ -311,7 +314,14 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
||||
gender: _genderController.text,
|
||||
);
|
||||
|
||||
context.read<ProfileBloc>().add(UpdateUserInfo(myUser: myUser, filePicture: _imageFile?.path));
|
||||
context
|
||||
.read<ProfileBloc>()
|
||||
.add(UpdateUserInfo(myUser: myUser, filePicture: _imageFile?.path));
|
||||
|
||||
ScaffoldMessenger.of(context).clearSnackBars();
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('Información actualizada...')),
|
||||
);
|
||||
|
||||
Navigator.pop(context);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user