se añadio un modelo y el menu de modo profesional

This commit is contained in:
Juan Felipe Duarte
2023-04-18 16:03:01 -05:00
parent 85c927918e
commit 6b09ce2f3a
10 changed files with 777 additions and 294 deletions
+3 -39
View File
@@ -7,6 +7,8 @@ import 'package:prosappco/src/authentication/authentication_repository.dart';
import 'package:prosappco/src/components/drawer_menu.dart';
import 'package:prosappco/src/components/primary_btn.dart';
import 'package:prosappco/src/controllers/add_name_email_city.dart';
import 'package:prosappco/src/models/score_model.dart';
import 'package:prosappco/src/models/user_model.dart';
import '../components/photo_view.dart';
@@ -21,55 +23,17 @@ class _WelcomeScreenState extends State<WelcomeScreen> {
final FirebaseStorage storage = FirebaseStorage.instance;
final uid = AuthenticationRepository.instance.getCurrentUserUid();
final controller = Get.put(NameEmailCityController());
var _ciudad = '';
var _photo = '...';
var _estado = '...';
@override
void initState() {
super.initState();
if (_estado == '...') {
AuthenticationRepository.instance
.getState(uid.toString())
.then((String s) => setState(() {
_estado = s;
}));
}
if (_ciudad == '') {
AuthenticationRepository.instance
.getCity(uid.toString())
.then((String s) => setState(() {
_ciudad = s;
}));
}
if (_photo == '...') {
AuthenticationRepository.instance
.getPhoto(uid.toString())
.then((String s) => setState(() {
_photo = s;
}));
}
}
@override
Widget build(BuildContext context) {
final User? user = FirebaseAuth.instance.currentUser;
// String name = _nombre.toString();
String city = _ciudad.toString();
String state = _estado.toString();
return SafeArea(
child: Scaffold(
drawer: DrawerMenu(
ref: storage.ref().child(_photo),
userName: user?.displayName ?? '',
userPhoneNumber: user?.phoneNumber ?? '',
userCity: city,
userState: state),
drawer: DrawerMenu(),
resizeToAvoidBottomInset: false,
backgroundColor: const Color(0xFFD6F4FF),
body: Stack(