This commit is contained in:
Felipe
2024-04-09 21:28:16 -05:00
parent 60547febb6
commit ef06730840
12 changed files with 1440 additions and 230 deletions
+8 -3
View File
@@ -1,3 +1,5 @@
import 'dart:developer';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@@ -53,7 +55,8 @@ class _UserServiceScreenState extends State<UserServiceScreen> {
final service = state.service;
return FutureBuilder(
future: _getUserAndProfessionalInfo(service),
builder: (BuildContext context, AsyncSnapshot<List<dynamic>> snapshot) {
builder: (BuildContext context,
AsyncSnapshot<List<dynamic>> snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return const Center(child: CircularProgressIndicator());
} else {
@@ -372,12 +375,14 @@ class _UserServiceScreenState extends State<UserServiceScreen> {
return '\$${formatter.format(number)}';
}
Future<List<dynamic>> _getUserAndProfessionalInfo(ServiceEntity service) async {
Future<List<dynamic>> _getUserAndProfessionalInfo(
ServiceEntity service) async {
final userRepo = FirebaseUserRepository(FirebaseAuth.instance);
final userInfo = await userRepo.getMyUser(service.professionalId);
final professionalRepo = FirebaseProfessionalRepository();
final professionalInfo = await professionalRepo.getProInfo(service.professionalId);
final professionalInfo =
await professionalRepo.getProInfo(service.professionalId);
return [userInfo, professionalInfo];
}