This commit is contained in:
Juan Felipe Duarte
2023-04-03 14:28:58 -05:00
parent 210b479cde
commit 9656a85090
6 changed files with 266 additions and 82 deletions
+15 -24
View File
@@ -18,33 +18,27 @@ class _WelcomeScreenState extends State<WelcomeScreen> {
final _formKey = GlobalKey<FormState>();
final controller = Get.put(NameEmailCityController());
var _nombre = '...';
var _ciudad = '...';
var _ciudad = '';
@override
void initState() {
super.initState();
// if (_nombre == '...') {
// AuthenticationRepository.instance
// .getName(uid.toString())
// .then((String s) => setState(() {
// _nombre = s;
// }));
// }
// if (_ciudad == '...') {
// AuthenticationRepository.instance
// .getCity(uid.toString())
// .then((String s) => setState(() {
// _ciudad = s;
// }));
// }
if (_ciudad == '') {
AuthenticationRepository.instance
.getCity(uid.toString())
.then((String s) => setState(() {
_ciudad = s;
}));
}
}
@override
Widget build(BuildContext context) {
String name = 'Felipe el du';
String city = 'Felipe el du';
final User? user = FirebaseAuth.instance.currentUser;
// String name = _nombre.toString();
// String city = _ciudad.toString();
String city = _ciudad.toString();
return SafeArea(
child: Scaffold(
@@ -61,20 +55,17 @@ class _WelcomeScreenState extends State<WelcomeScreen> {
onTap: () {
Navigator.pushNamed(context, '/profile');
},
title: Text('$name',
title: Text('${user?.displayName ?? user?.email}',
style: TextStyle(fontWeight: FontWeight.bold)),
subtitle: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'friki',
// AuthenticationRepository.instance
// .getCurrentUserPhone()
// .toString(),
'${user?.phoneNumber ?? ''}',
style: TextStyle(fontSize: 12),
),
Text(
'$city',
'${city ?? "a"}',
style: TextStyle(fontSize: 12),
),
],