picker city update

This commit is contained in:
Juan Felipe Duarte
2023-04-12 11:51:05 -05:00
parent efd0a7e76e
commit a5f4db5836
2 changed files with 20 additions and 8 deletions
+1 -1
View File
@@ -187,7 +187,7 @@ class _CityScreenState extends State<CityScreen> {
),
onTap: () {
updateCity(citys[index].cityName ?? "");
Navigator.pushReplacementNamed(context, '/profile');
Navigator.pop(context, citys[index].cityName ?? "");
},
);
},
+19 -7
View File
@@ -428,15 +428,27 @@ class _ProfileScreenState extends State<ProfileScreen> {
20.0), // Agrega espacio vertical entre los TextFormFields
TextFormField(
readOnly: true,
onTap: () {
Navigator.pushReplacementNamed(context, '/city');
onTap: () async {
final String? ciudad =
(await Navigator.pushNamed(context, '/city'))
as String?;
if (ciudad != null) {
setState(() {
_ciudad = ciudad as String;
});
}
},
decoration: InputDecoration(
prefixIcon: Icon(Icons.near_me),
suffixIcon: Icon(Icons.arrow_drop_down),
hintText: city == '' ? 'Ciudad' : '$city',
hintStyle: TextStyle(color: Colors.black87),
),
prefixIcon: Icon(Icons.near_me),
suffixIcon: Icon(Icons.arrow_drop_down),
hintStyle: city == ''
? TextStyle()
: TextStyle(color: Colors.black87),
hintText: city == ''
? 'Profesión (Obligatorio)'
: '$city'),
// hintText: city == '' ? 'Ciudad' : '$city',
),
SizedBox(