This commit is contained in:
Felipe
2023-08-23 14:41:18 -05:00
parent 1270f3a6b5
commit 52855f8c3e
5 changed files with 499 additions and 456 deletions
+1 -1
View File
@@ -170,7 +170,7 @@ class _CalendarScreenState extends State<CalendarScreen> {
content: StatefulBuilder(
builder: (BuildContext context, StateSetter setStateDialog) {
return SizedBox(
height: 350,
height: 800,
child: Column(
children: [
Padding(
+27 -15
View File
@@ -234,11 +234,13 @@ class _CitaScreenState extends State<CitaScreen> {
],
),
),
Container(
widget.evento.userId == widget.evento.professionalId
? const SizedBox()
: Container(
margin: const EdgeInsets.only(
left: 40, right: 40, top: 20, bottom: 20),
padding:
const EdgeInsets.symmetric(horizontal: 20, vertical: 15),
padding: const EdgeInsets.symmetric(
horizontal: 20, vertical: 15),
decoration: BoxDecoration(
color: const Color(0xFFD6F4FF),
borderRadius: BorderRadius.circular(20),
@@ -262,13 +264,13 @@ class _CitaScreenState extends State<CitaScreen> {
widget.evento.ubicacion != 'sitio'
? const Text(
'Servicio a domicilio.',
style:
TextStyle(color: Colors.black, fontSize: 14),
style: TextStyle(
color: Colors.black, fontSize: 14),
)
: const Text(
'Servicio en su sitio / consultorio',
style:
TextStyle(color: Colors.black, fontSize: 14),
style: TextStyle(
color: Colors.black, fontSize: 14),
),
],
),
@@ -293,7 +295,9 @@ class _CitaScreenState extends State<CitaScreen> {
style: const TextStyle(
color: Colors.grey, fontStyle: FontStyle.italic),
),
widget.evento.status == 'terminado'
widget.evento.userId == widget.evento.professionalId
? const SizedBox()
: widget.evento.status == 'terminado'
? const SizedBox(height: 10)
: const Padding(
padding: EdgeInsets.symmetric(vertical: 20),
@@ -302,7 +306,9 @@ class _CitaScreenState extends State<CitaScreen> {
style: TextStyle(color: Color(0xFF2BA4EC)),
),
),
widget.evento.status == 'terminado'
widget.evento.userId == widget.evento.professionalId
? const SizedBox()
: widget.evento.status == 'terminado'
? pro == true
? widget.evento.professionalScored == true
? const SizedBox()
@@ -324,9 +330,11 @@ class _CitaScreenState extends State<CitaScreen> {
);
},
style: ElevatedButton.styleFrom(
backgroundColor: const Color(0xFF2BA4EC),
backgroundColor:
const Color(0xFF2BA4EC),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(50),
borderRadius:
BorderRadius.circular(50),
),
elevation: 0,
minimumSize: const Size(230, 60),
@@ -362,9 +370,11 @@ class _CitaScreenState extends State<CitaScreen> {
);
},
style: ElevatedButton.styleFrom(
backgroundColor: const Color(0xFF2BA4EC),
backgroundColor:
const Color(0xFF2BA4EC),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(50),
borderRadius:
BorderRadius.circular(50),
),
elevation: 0,
minimumSize: const Size(230, 60),
@@ -416,7 +426,8 @@ class _CitaScreenState extends State<CitaScreen> {
final chatSnapshot = await chatDoc.get();
if (!chatSnapshot.exists ||
chatSnapshot.data()!['message'] == null) {
chatSnapshot.data()!['message'] ==
null) {
await chatDoc.set(
{
'professional_id':
@@ -478,7 +489,8 @@ class _CitaScreenState extends State<CitaScreen> {
),
elevation: 8.0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
borderRadius:
BorderRadius.circular(10.0),
),
);
+35 -5
View File
@@ -87,6 +87,7 @@ class _MyServicesScreenState extends State<MyServicesScreen> {
try {
eventos.addAll(snapshot.data!);
eventos.sort((a, b) => a.range1Hour1.compareTo(b.range1Hour1));
} catch (e) {
print("Error" + e.toString());
}
@@ -100,8 +101,33 @@ class _MyServicesScreenState extends State<MyServicesScreen> {
return Column(
children: [
...eventos.map(
(event) => ListTile(
...eventos
.where((event) => event.professionalId != event.userId)
.map(
(event) => FutureBuilder<DocumentSnapshot>(
future: FirebaseFirestore.instance
.collection('users')
.doc(event.professionalId)
.get(),
builder: (BuildContext context,
AsyncSnapshot<DocumentSnapshot> profSnapshot) {
if (profSnapshot.connectionState ==
ConnectionState.waiting) {
return const CircularProgressIndicator();
}
if (profSnapshot.hasError) {
return const Text(
'Error al obtener los datos del profesional',
// Aquí puedes agregar un estilo de texto apropiado
);
}
final professionalData = profSnapshot.data;
final professionalName =
professionalData?['name'] ?? 'N/D';
return ListTile(
tileColor: event.status == 'denegado'
? Colors.red[100]
: Colors.blue[100],
@@ -148,7 +174,7 @@ class _MyServicesScreenState extends State<MyServicesScreen> {
text: TextSpan(
children: [
TextSpan(
text: '${event.title}, ',
text: '${professionalName}, ',
style: const TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
@@ -172,7 +198,8 @@ class _MyServicesScreenState extends State<MyServicesScreen> {
Row(
children: [
RatingBar.builder(
initialRating: event.scoresModel?.average ?? 0,
initialRating:
event.scoresModel?.average ?? 0,
minRating: 1,
direction: Axis.horizontal,
allowHalfRating: true,
@@ -195,11 +222,14 @@ class _MyServicesScreenState extends State<MyServicesScreen> {
),
Text(
'" ${event.description}"',
style: const TextStyle(fontStyle: FontStyle.italic),
style:
const TextStyle(fontStyle: FontStyle.italic),
),
],
),
trailing: const Icon(Icons.keyboard_arrow_right),
);
},
),
),
],
+4 -4
View File
@@ -34,7 +34,8 @@ class _MyServicesProScreenState extends State<MyServicesProScreen> {
onPressed: () {
Navigator.pop(context);
},
label: 'Mis servicios'),
label: 'Mis servicios',
),
drawer: DrawerProfessional(),
body: SingleChildScrollView(
child: Column(
@@ -82,6 +83,7 @@ class _MyServicesProScreenState extends State<MyServicesProScreen> {
try {
eventos.addAll(snapshot.data!);
eventos.sort((a, b) => a.range1Hour1.compareTo(b.range1Hour1));
} catch (e) {
print("Error" + e.toString());
}
@@ -96,9 +98,7 @@ class _MyServicesProScreenState extends State<MyServicesProScreen> {
return Column(
children: [
...eventos.map(
(event) => event.userId == event.professionalId
? const SizedBox()
: ListTile(
(event) => ListTile(
tileColor: event.status == 'denegado'
? Colors.red[100]
: Colors.blue[100],
+1
View File
@@ -75,6 +75,7 @@ class SolicitudScreen extends StatelessWidget {
try {
eventos.addAll(snapshot.data!);
eventos.sort((a, b) => a.range1Hour1.compareTo(b.range1Hour1));
} catch (e) {
print("Error" + e.toString());
}