update
This commit is contained in:
@@ -170,7 +170,7 @@ class _CalendarScreenState extends State<CalendarScreen> {
|
|||||||
content: StatefulBuilder(
|
content: StatefulBuilder(
|
||||||
builder: (BuildContext context, StateSetter setStateDialog) {
|
builder: (BuildContext context, StateSetter setStateDialog) {
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
height: 350,
|
height: 800,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
|
|||||||
+283
-271
@@ -234,45 +234,47 @@ class _CitaScreenState extends State<CitaScreen> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
widget.evento.userId == widget.evento.professionalId
|
||||||
margin: const EdgeInsets.only(
|
? const SizedBox()
|
||||||
left: 40, right: 40, top: 20, bottom: 20),
|
: Container(
|
||||||
padding:
|
margin: const EdgeInsets.only(
|
||||||
const EdgeInsets.symmetric(horizontal: 20, vertical: 15),
|
left: 40, right: 40, top: 20, bottom: 20),
|
||||||
decoration: BoxDecoration(
|
padding: const EdgeInsets.symmetric(
|
||||||
color: const Color(0xFFD6F4FF),
|
horizontal: 20, vertical: 15),
|
||||||
borderRadius: BorderRadius.circular(20),
|
decoration: BoxDecoration(
|
||||||
boxShadow: [
|
color: const Color(0xFFD6F4FF),
|
||||||
BoxShadow(
|
borderRadius: BorderRadius.circular(20),
|
||||||
color: Colors.grey.withOpacity(0.5),
|
boxShadow: [
|
||||||
spreadRadius: 1,
|
BoxShadow(
|
||||||
blurRadius: 5,
|
color: Colors.grey.withOpacity(0.5),
|
||||||
offset: const Offset(1, 3),
|
spreadRadius: 1,
|
||||||
),
|
blurRadius: 5,
|
||||||
],
|
offset: const Offset(1, 3),
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
const Icon(
|
|
||||||
Icons.error_outline,
|
|
||||||
size: 27,
|
|
||||||
color: Colors.black54,
|
|
||||||
),
|
|
||||||
const SizedBox(width: 15),
|
|
||||||
widget.evento.ubicacion != 'sitio'
|
|
||||||
? const Text(
|
|
||||||
'Servicio a domicilio.',
|
|
||||||
style:
|
|
||||||
TextStyle(color: Colors.black, fontSize: 14),
|
|
||||||
)
|
|
||||||
: const Text(
|
|
||||||
'Servicio en su sitio / consultorio',
|
|
||||||
style:
|
|
||||||
TextStyle(color: Colors.black, fontSize: 14),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
child: Row(
|
||||||
|
children: [
|
||||||
|
const Icon(
|
||||||
|
Icons.error_outline,
|
||||||
|
size: 27,
|
||||||
|
color: Colors.black54,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 15),
|
||||||
|
widget.evento.ubicacion != 'sitio'
|
||||||
|
? const Text(
|
||||||
|
'Servicio a domicilio.',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.black, fontSize: 14),
|
||||||
|
)
|
||||||
|
: const Text(
|
||||||
|
'Servicio en su sitio / consultorio',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.black, fontSize: 14),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
settings?.tarifas == true && widget.evento.tarifa != 0
|
settings?.tarifas == true && widget.evento.tarifa != 0
|
||||||
? Column(
|
? Column(
|
||||||
children: [
|
children: [
|
||||||
@@ -293,249 +295,259 @@ class _CitaScreenState extends State<CitaScreen> {
|
|||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
color: Colors.grey, fontStyle: FontStyle.italic),
|
color: Colors.grey, fontStyle: FontStyle.italic),
|
||||||
),
|
),
|
||||||
widget.evento.status == 'terminado'
|
widget.evento.userId == widget.evento.professionalId
|
||||||
? const SizedBox(height: 10)
|
? const SizedBox()
|
||||||
: const Padding(
|
: widget.evento.status == 'terminado'
|
||||||
padding: EdgeInsets.symmetric(vertical: 20),
|
? const SizedBox(height: 10)
|
||||||
child: Text(
|
: const Padding(
|
||||||
'Medios de comunicación con el usuario.',
|
padding: EdgeInsets.symmetric(vertical: 20),
|
||||||
style: TextStyle(color: Color(0xFF2BA4EC)),
|
child: Text(
|
||||||
),
|
'Medios de comunicación con el usuario.',
|
||||||
),
|
style: TextStyle(color: Color(0xFF2BA4EC)),
|
||||||
widget.evento.status == 'terminado'
|
|
||||||
? pro == true
|
|
||||||
? widget.evento.professionalScored == true
|
|
||||||
? const SizedBox()
|
|
||||||
: Column(
|
|
||||||
children: [
|
|
||||||
const SizedBox(height: 120),
|
|
||||||
ElevatedButton(
|
|
||||||
onPressed: () {
|
|
||||||
Navigator.pushReplacement(
|
|
||||||
context,
|
|
||||||
CupertinoPageRoute(
|
|
||||||
builder: (BuildContext context) {
|
|
||||||
return ScoreScreen(
|
|
||||||
evento: widget.evento,
|
|
||||||
pro: pro!,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
style: ElevatedButton.styleFrom(
|
|
||||||
backgroundColor: const Color(0xFF2BA4EC),
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(50),
|
|
||||||
),
|
|
||||||
elevation: 0,
|
|
||||||
minimumSize: const Size(230, 60),
|
|
||||||
),
|
|
||||||
child: const Text(
|
|
||||||
'Puntuar servicio',
|
|
||||||
style: TextStyle(
|
|
||||||
color: Colors.white,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
fontSize: 18,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
: widget.evento.userScored == true
|
|
||||||
? const SizedBox()
|
|
||||||
: Column(
|
|
||||||
children: [
|
|
||||||
const SizedBox(height: 120),
|
|
||||||
ElevatedButton(
|
|
||||||
onPressed: () {
|
|
||||||
Navigator.pushReplacement(
|
|
||||||
context,
|
|
||||||
CupertinoPageRoute(
|
|
||||||
builder: (BuildContext context) {
|
|
||||||
return ScoreScreen(
|
|
||||||
evento: widget.evento,
|
|
||||||
pro: pro!,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
style: ElevatedButton.styleFrom(
|
|
||||||
backgroundColor: const Color(0xFF2BA4EC),
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(50),
|
|
||||||
),
|
|
||||||
elevation: 0,
|
|
||||||
minimumSize: const Size(230, 60),
|
|
||||||
),
|
|
||||||
child: const Text(
|
|
||||||
'Puntuar servicio',
|
|
||||||
style: TextStyle(
|
|
||||||
color: Colors.white,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
fontSize: 18,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
: Row(
|
|
||||||
children: [
|
|
||||||
const Expanded(child: SizedBox()),
|
|
||||||
ElevatedButton(
|
|
||||||
onPressed: () => launch("tel:$numberPhone"),
|
|
||||||
style: ElevatedButton.styleFrom(
|
|
||||||
foregroundColor: const Color(0xFF2BA4EC),
|
|
||||||
backgroundColor: Colors.white,
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(50),
|
|
||||||
side: const BorderSide(
|
|
||||||
color: Color(0xFF2BA4EC),
|
|
||||||
width: 2,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: const Padding(
|
|
||||||
padding: EdgeInsets.symmetric(
|
|
||||||
vertical: 18, horizontal: 0),
|
|
||||||
child: Icon(
|
|
||||||
Icons.phone_android,
|
|
||||||
size: 30,
|
|
||||||
color: Color(0xFF2BA4EC),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 20),
|
widget.evento.userId == widget.evento.professionalId
|
||||||
ElevatedButton(
|
? const SizedBox()
|
||||||
onPressed: () async {
|
: widget.evento.status == 'terminado'
|
||||||
if (widget.evento.status != 'pendiente') {
|
? pro == true
|
||||||
final chatDoc = FirebaseFirestore.instance
|
? widget.evento.professionalScored == true
|
||||||
.collection('chats')
|
? const SizedBox()
|
||||||
.doc(widget.evento.id);
|
: Column(
|
||||||
final chatSnapshot = await chatDoc.get();
|
children: [
|
||||||
|
const SizedBox(height: 120),
|
||||||
if (!chatSnapshot.exists ||
|
ElevatedButton(
|
||||||
chatSnapshot.data()!['message'] == null) {
|
onPressed: () {
|
||||||
await chatDoc.set(
|
Navigator.pushReplacement(
|
||||||
{
|
context,
|
||||||
'professional_id':
|
CupertinoPageRoute(
|
||||||
widget.evento.professionalId,
|
builder: (BuildContext context) {
|
||||||
'user_id': widget.evento.userId,
|
return ScoreScreen(
|
||||||
'message': [],
|
evento: widget.evento,
|
||||||
},
|
pro: pro!,
|
||||||
SetOptions(merge: true),
|
);
|
||||||
).catchError((error) => print(
|
},
|
||||||
'Error al crear el documento: $error'));
|
),
|
||||||
}
|
);
|
||||||
|
},
|
||||||
Navigator.push(
|
style: ElevatedButton.styleFrom(
|
||||||
context,
|
backgroundColor:
|
||||||
CupertinoPageRoute(
|
const Color(0xFF2BA4EC),
|
||||||
builder: (BuildContext context) {
|
shape: RoundedRectangleBorder(
|
||||||
return ChatScreen(
|
borderRadius:
|
||||||
eventoId: widget.evento.id);
|
BorderRadius.circular(50),
|
||||||
},
|
),
|
||||||
),
|
elevation: 0,
|
||||||
);
|
minimumSize: const Size(230, 60),
|
||||||
}
|
),
|
||||||
|
child: const Text(
|
||||||
// if (widget.evento.status != 'pendiente') {
|
'Puntuar servicio',
|
||||||
// await FirebaseFirestore.instance
|
style: TextStyle(
|
||||||
// .collection('chats')
|
color: Colors.white,
|
||||||
// .doc(widget.evento.id)
|
fontWeight: FontWeight.bold,
|
||||||
// .set(
|
fontSize: 18,
|
||||||
// {
|
),
|
||||||
// 'professional_id':
|
),
|
||||||
// widget.evento.professionalId,
|
),
|
||||||
// 'user_id': widget.evento.userId,
|
],
|
||||||
// 'message': [],
|
)
|
||||||
// },
|
: widget.evento.userScored == true
|
||||||
// SetOptions(
|
? const SizedBox()
|
||||||
// merge:
|
: Column(
|
||||||
// true)).catchError((error) => print(
|
children: [
|
||||||
// 'Error al crear el documento: $error'));
|
const SizedBox(height: 120),
|
||||||
|
ElevatedButton(
|
||||||
// Navigator.push(
|
onPressed: () {
|
||||||
// context,
|
Navigator.pushReplacement(
|
||||||
// CupertinoPageRoute(
|
context,
|
||||||
// builder: (BuildContext context) {
|
CupertinoPageRoute(
|
||||||
// return ChatScreen(
|
builder: (BuildContext context) {
|
||||||
// eventoId: widget.evento.id);
|
return ScoreScreen(
|
||||||
// },
|
evento: widget.evento,
|
||||||
// ),
|
pro: pro!,
|
||||||
// );
|
);
|
||||||
// }
|
},
|
||||||
else {
|
),
|
||||||
final snackBar = SnackBar(
|
);
|
||||||
backgroundColor: Colors.blue,
|
},
|
||||||
content: const Text(
|
style: ElevatedButton.styleFrom(
|
||||||
'Primero acepta la solicitud',
|
backgroundColor:
|
||||||
style: TextStyle(
|
const Color(0xFF2BA4EC),
|
||||||
color: Colors.white,
|
shape: RoundedRectangleBorder(
|
||||||
fontWeight: FontWeight.bold,
|
borderRadius:
|
||||||
),
|
BorderRadius.circular(50),
|
||||||
),
|
),
|
||||||
elevation: 8.0,
|
elevation: 0,
|
||||||
|
minimumSize: const Size(230, 60),
|
||||||
|
),
|
||||||
|
child: const Text(
|
||||||
|
'Puntuar servicio',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 18,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
: Row(
|
||||||
|
children: [
|
||||||
|
const Expanded(child: SizedBox()),
|
||||||
|
ElevatedButton(
|
||||||
|
onPressed: () => launch("tel:$numberPhone"),
|
||||||
|
style: ElevatedButton.styleFrom(
|
||||||
|
foregroundColor: const Color(0xFF2BA4EC),
|
||||||
|
backgroundColor: Colors.white,
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
borderRadius: BorderRadius.circular(50),
|
||||||
|
side: const BorderSide(
|
||||||
|
color: Color(0xFF2BA4EC),
|
||||||
|
width: 2,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
),
|
||||||
|
child: const Padding(
|
||||||
|
padding: EdgeInsets.symmetric(
|
||||||
|
vertical: 18, horizontal: 0),
|
||||||
|
child: Icon(
|
||||||
|
Icons.phone_android,
|
||||||
|
size: 30,
|
||||||
|
color: Color(0xFF2BA4EC),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 20),
|
||||||
|
ElevatedButton(
|
||||||
|
onPressed: () async {
|
||||||
|
if (widget.evento.status != 'pendiente') {
|
||||||
|
final chatDoc = FirebaseFirestore.instance
|
||||||
|
.collection('chats')
|
||||||
|
.doc(widget.evento.id);
|
||||||
|
final chatSnapshot = await chatDoc.get();
|
||||||
|
|
||||||
ScaffoldMessenger.of(context)
|
if (!chatSnapshot.exists ||
|
||||||
.showSnackBar(snackBar);
|
chatSnapshot.data()!['message'] ==
|
||||||
}
|
null) {
|
||||||
},
|
await chatDoc.set(
|
||||||
style: ElevatedButton.styleFrom(
|
{
|
||||||
foregroundColor: const Color(0xFF2BA4EC),
|
'professional_id':
|
||||||
backgroundColor: Colors.white,
|
widget.evento.professionalId,
|
||||||
shape: RoundedRectangleBorder(
|
'user_id': widget.evento.userId,
|
||||||
borderRadius: BorderRadius.circular(50),
|
'message': [],
|
||||||
side: const BorderSide(
|
},
|
||||||
color: Color(0xFF2BA4EC),
|
SetOptions(merge: true),
|
||||||
width: 2,
|
).catchError((error) => print(
|
||||||
|
'Error al crear el documento: $error'));
|
||||||
|
}
|
||||||
|
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
CupertinoPageRoute(
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return ChatScreen(
|
||||||
|
eventoId: widget.evento.id);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// if (widget.evento.status != 'pendiente') {
|
||||||
|
// await FirebaseFirestore.instance
|
||||||
|
// .collection('chats')
|
||||||
|
// .doc(widget.evento.id)
|
||||||
|
// .set(
|
||||||
|
// {
|
||||||
|
// 'professional_id':
|
||||||
|
// widget.evento.professionalId,
|
||||||
|
// 'user_id': widget.evento.userId,
|
||||||
|
// 'message': [],
|
||||||
|
// },
|
||||||
|
// SetOptions(
|
||||||
|
// merge:
|
||||||
|
// true)).catchError((error) => print(
|
||||||
|
// 'Error al crear el documento: $error'));
|
||||||
|
|
||||||
|
// Navigator.push(
|
||||||
|
// context,
|
||||||
|
// CupertinoPageRoute(
|
||||||
|
// builder: (BuildContext context) {
|
||||||
|
// return ChatScreen(
|
||||||
|
// eventoId: widget.evento.id);
|
||||||
|
// },
|
||||||
|
// ),
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
else {
|
||||||
|
final snackBar = SnackBar(
|
||||||
|
backgroundColor: Colors.blue,
|
||||||
|
content: const Text(
|
||||||
|
'Primero acepta la solicitud',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
elevation: 8.0,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.circular(10.0),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
ScaffoldMessenger.of(context)
|
||||||
|
.showSnackBar(snackBar);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
style: ElevatedButton.styleFrom(
|
||||||
|
foregroundColor: const Color(0xFF2BA4EC),
|
||||||
|
backgroundColor: Colors.white,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(50),
|
||||||
|
side: const BorderSide(
|
||||||
|
color: Color(0xFF2BA4EC),
|
||||||
|
width: 2,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: const Padding(
|
||||||
|
padding: EdgeInsets.symmetric(
|
||||||
|
vertical: 18, horizontal: 0),
|
||||||
|
child: Icon(
|
||||||
|
Icons.message,
|
||||||
|
size: 30,
|
||||||
|
color: Color(0xFF2BA4EC),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(width: 20),
|
||||||
child: const Padding(
|
ElevatedButton(
|
||||||
padding: EdgeInsets.symmetric(
|
onPressed: () {
|
||||||
vertical: 18, horizontal: 0),
|
_sendWhatsapp(numberPhone);
|
||||||
child: Icon(
|
},
|
||||||
Icons.message,
|
style: ElevatedButton.styleFrom(
|
||||||
size: 30,
|
foregroundColor: const Color(0xFF2BA4EC),
|
||||||
color: Color(0xFF2BA4EC),
|
backgroundColor: Colors.white,
|
||||||
),
|
shape: RoundedRectangleBorder(
|
||||||
),
|
borderRadius: BorderRadius.circular(50),
|
||||||
),
|
side: const BorderSide(
|
||||||
const SizedBox(width: 20),
|
color: Color(0xFF2BA4EC),
|
||||||
ElevatedButton(
|
width: 2,
|
||||||
onPressed: () {
|
),
|
||||||
_sendWhatsapp(numberPhone);
|
),
|
||||||
},
|
),
|
||||||
style: ElevatedButton.styleFrom(
|
child: const Padding(
|
||||||
foregroundColor: const Color(0xFF2BA4EC),
|
padding: EdgeInsets.symmetric(
|
||||||
backgroundColor: Colors.white,
|
vertical: 18, horizontal: 0),
|
||||||
shape: RoundedRectangleBorder(
|
child: Icon(
|
||||||
borderRadius: BorderRadius.circular(50),
|
CommunityMaterialIcons.whatsapp,
|
||||||
side: const BorderSide(
|
size: 30,
|
||||||
color: Color(0xFF2BA4EC),
|
color: Color(0xFF2BA4EC),
|
||||||
width: 2,
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
const Expanded(child: SizedBox()),
|
||||||
child: const Padding(
|
],
|
||||||
padding: EdgeInsets.symmetric(
|
|
||||||
vertical: 18, horizontal: 0),
|
|
||||||
child: Icon(
|
|
||||||
CommunityMaterialIcons.whatsapp,
|
|
||||||
size: 30,
|
|
||||||
color: Color(0xFF2BA4EC),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
const Expanded(child: SizedBox()),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
widget.evento.ubicacion == 'sitio'
|
widget.evento.ubicacion == 'sitio'
|
||||||
? const SizedBox()
|
? const SizedBox()
|
||||||
: Padding(
|
: Padding(
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ class _MyServicesScreenState extends State<MyServicesScreen> {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
eventos.addAll(snapshot.data!);
|
eventos.addAll(snapshot.data!);
|
||||||
|
eventos.sort((a, b) => a.range1Hour1.compareTo(b.range1Hour1));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Error" + e.toString());
|
print("Error" + e.toString());
|
||||||
}
|
}
|
||||||
@@ -100,108 +101,137 @@ class _MyServicesScreenState extends State<MyServicesScreen> {
|
|||||||
|
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
...eventos.map(
|
...eventos
|
||||||
(event) => ListTile(
|
.where((event) => event.professionalId != event.userId)
|
||||||
tileColor: event.status == 'denegado'
|
.map(
|
||||||
? Colors.red[100]
|
(event) => FutureBuilder<DocumentSnapshot>(
|
||||||
: Colors.blue[100],
|
future: FirebaseFirestore.instance
|
||||||
onTap: () {
|
.collection('users')
|
||||||
Navigator.push(
|
.doc(event.professionalId)
|
||||||
context,
|
.get(),
|
||||||
CupertinoPageRoute(
|
builder: (BuildContext context,
|
||||||
builder: (BuildContext context) {
|
AsyncSnapshot<DocumentSnapshot> profSnapshot) {
|
||||||
return CitaScreen(evento: event);
|
if (profSnapshot.connectionState ==
|
||||||
},
|
ConnectionState.waiting) {
|
||||||
),
|
return const CircularProgressIndicator();
|
||||||
);
|
}
|
||||||
},
|
|
||||||
leading: event.status == 'aprobado'
|
if (profSnapshot.hasError) {
|
||||||
? const Icon(
|
return const Text(
|
||||||
Icons.check,
|
'Error al obtener los datos del profesional',
|
||||||
color: Colors.blue,
|
// Aquí puedes agregar un estilo de texto apropiado
|
||||||
size: 40,
|
);
|
||||||
)
|
}
|
||||||
: event.status == 'iniciado'
|
|
||||||
? const Icon(
|
final professionalData = profSnapshot.data;
|
||||||
Icons.access_time,
|
final professionalName =
|
||||||
color: Colors.blue,
|
professionalData?['name'] ?? 'N/D';
|
||||||
size: 40,
|
|
||||||
)
|
return ListTile(
|
||||||
: event.status == 'pendiente'
|
tileColor: event.status == 'denegado'
|
||||||
|
? Colors.red[100]
|
||||||
|
: Colors.blue[100],
|
||||||
|
onTap: () {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
CupertinoPageRoute(
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return CitaScreen(evento: event);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
leading: event.status == 'aprobado'
|
||||||
? const Icon(
|
? const Icon(
|
||||||
Icons.access_time_outlined,
|
Icons.check,
|
||||||
color: Colors.blue,
|
color: Colors.blue,
|
||||||
size: 40,
|
size: 40,
|
||||||
)
|
)
|
||||||
: event.status == 'terminado'
|
: event.status == 'iniciado'
|
||||||
? const Icon(
|
? const Icon(
|
||||||
Icons.rocket_launch,
|
Icons.access_time,
|
||||||
color: Colors.blue,
|
color: Colors.blue,
|
||||||
size: 40,
|
size: 40,
|
||||||
)
|
)
|
||||||
: const Icon(
|
: event.status == 'pendiente'
|
||||||
Icons.close,
|
? const Icon(
|
||||||
color: Colors.red,
|
Icons.access_time_outlined,
|
||||||
size: 40,
|
color: Colors.blue,
|
||||||
|
size: 40,
|
||||||
|
)
|
||||||
|
: event.status == 'terminado'
|
||||||
|
? const Icon(
|
||||||
|
Icons.rocket_launch,
|
||||||
|
color: Colors.blue,
|
||||||
|
size: 40,
|
||||||
|
)
|
||||||
|
: const Icon(
|
||||||
|
Icons.close,
|
||||||
|
color: Colors.red,
|
||||||
|
size: 40,
|
||||||
|
),
|
||||||
|
title: RichText(
|
||||||
|
text: TextSpan(
|
||||||
|
children: [
|
||||||
|
TextSpan(
|
||||||
|
text: '${professionalName}, ',
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.black,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 16,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
TextSpan(
|
||||||
|
text:
|
||||||
|
'${DateFormat('dd MMM', 'es').format(DateTime.parse(event.day))} - ${TimeOfDay.fromDateTime(DateTime.parse(event.range1Hour1)).format(context)}',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.grey[600],
|
||||||
|
fontSize: 16,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
subtitle: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
RatingBar.builder(
|
||||||
|
initialRating:
|
||||||
|
event.scoresModel?.average ?? 0,
|
||||||
|
minRating: 1,
|
||||||
|
direction: Axis.horizontal,
|
||||||
|
allowHalfRating: true,
|
||||||
|
itemCount: 5,
|
||||||
|
itemSize: 25,
|
||||||
|
maxRating: 5,
|
||||||
|
itemPadding:
|
||||||
|
const EdgeInsets.symmetric(horizontal: 0),
|
||||||
|
itemBuilder: (context, _) => const Icon(
|
||||||
|
Icons.star,
|
||||||
|
color: Color(0xFF2BA4EC),
|
||||||
),
|
),
|
||||||
title: RichText(
|
onRatingUpdate: (rating) {},
|
||||||
text: TextSpan(
|
ignoreGestures: true,
|
||||||
children: [
|
),
|
||||||
TextSpan(
|
const SizedBox(width: 5),
|
||||||
text: '${event.title}, ',
|
Text(
|
||||||
style: const TextStyle(
|
'(${event.scoresModel?.total.toString()}) ${event.scoresModel?.average.toStringAsFixed(1)}'),
|
||||||
color: Colors.black,
|
],
|
||||||
fontWeight: FontWeight.bold,
|
),
|
||||||
fontSize: 16,
|
Text(
|
||||||
|
'" ${event.description}"',
|
||||||
|
style:
|
||||||
|
const TextStyle(fontStyle: FontStyle.italic),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
trailing: const Icon(Icons.keyboard_arrow_right),
|
||||||
TextSpan(
|
);
|
||||||
text:
|
},
|
||||||
'${DateFormat('dd MMM', 'es').format(DateTime.parse(event.day))} - ${TimeOfDay.fromDateTime(DateTime.parse(event.range1Hour1)).format(context)}',
|
|
||||||
style: TextStyle(
|
|
||||||
color: Colors.grey[600],
|
|
||||||
fontSize: 16,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
subtitle: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
RatingBar.builder(
|
|
||||||
initialRating: event.scoresModel?.average ?? 0,
|
|
||||||
minRating: 1,
|
|
||||||
direction: Axis.horizontal,
|
|
||||||
allowHalfRating: true,
|
|
||||||
itemCount: 5,
|
|
||||||
itemSize: 25,
|
|
||||||
maxRating: 5,
|
|
||||||
itemPadding:
|
|
||||||
const EdgeInsets.symmetric(horizontal: 0),
|
|
||||||
itemBuilder: (context, _) => const Icon(
|
|
||||||
Icons.star,
|
|
||||||
color: Color(0xFF2BA4EC),
|
|
||||||
),
|
|
||||||
onRatingUpdate: (rating) {},
|
|
||||||
ignoreGestures: true,
|
|
||||||
),
|
|
||||||
const SizedBox(width: 5),
|
|
||||||
Text(
|
|
||||||
'(${event.scoresModel?.total.toString()}) ${event.scoresModel?.average.toStringAsFixed(1)}'),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
'" ${event.description}"',
|
|
||||||
style: const TextStyle(fontStyle: FontStyle.italic),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
trailing: const Icon(Icons.keyboard_arrow_right),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -31,10 +31,11 @@ class _MyServicesProScreenState extends State<MyServicesProScreen> {
|
|||||||
return SafeArea(
|
return SafeArea(
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
appBar: PopAppbar(
|
appBar: PopAppbar(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
},
|
},
|
||||||
label: 'Mis servicios'),
|
label: 'Mis servicios',
|
||||||
|
),
|
||||||
drawer: DrawerProfessional(),
|
drawer: DrawerProfessional(),
|
||||||
body: SingleChildScrollView(
|
body: SingleChildScrollView(
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -82,6 +83,7 @@ class _MyServicesProScreenState extends State<MyServicesProScreen> {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
eventos.addAll(snapshot.data!);
|
eventos.addAll(snapshot.data!);
|
||||||
|
eventos.sort((a, b) => a.range1Hour1.compareTo(b.range1Hour1));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Error" + e.toString());
|
print("Error" + e.toString());
|
||||||
}
|
}
|
||||||
@@ -96,102 +98,100 @@ class _MyServicesProScreenState extends State<MyServicesProScreen> {
|
|||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
...eventos.map(
|
...eventos.map(
|
||||||
(event) => event.userId == event.professionalId
|
(event) => ListTile(
|
||||||
? const SizedBox()
|
tileColor: event.status == 'denegado'
|
||||||
: ListTile(
|
? Colors.red[100]
|
||||||
tileColor: event.status == 'denegado'
|
: Colors.blue[100],
|
||||||
? Colors.red[100]
|
onTap: () {
|
||||||
: Colors.blue[100],
|
Navigator.push(
|
||||||
onTap: () {
|
context,
|
||||||
Navigator.push(
|
CupertinoPageRoute(
|
||||||
context,
|
builder: (BuildContext context) {
|
||||||
CupertinoPageRoute(
|
return CitaScreen(evento: event);
|
||||||
builder: (BuildContext context) {
|
|
||||||
return CitaScreen(evento: event);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
leading: event.status == 'aprobado'
|
),
|
||||||
? const Icon(
|
);
|
||||||
Icons.check,
|
},
|
||||||
color: Colors.blue,
|
leading: event.status == 'aprobado'
|
||||||
size: 40,
|
? const Icon(
|
||||||
)
|
Icons.check,
|
||||||
: event.status == 'iniciado'
|
color: Colors.blue,
|
||||||
? const Icon(
|
size: 40,
|
||||||
Icons.access_time,
|
)
|
||||||
color: Colors.blue,
|
: event.status == 'iniciado'
|
||||||
size: 40,
|
? const Icon(
|
||||||
)
|
Icons.access_time,
|
||||||
: event.status == 'terminado'
|
color: Colors.blue,
|
||||||
? const Icon(
|
size: 40,
|
||||||
Icons.rocket_launch,
|
)
|
||||||
color: Colors.blue,
|
: event.status == 'terminado'
|
||||||
size: 40,
|
? const Icon(
|
||||||
)
|
Icons.rocket_launch,
|
||||||
: const Icon(
|
color: Colors.blue,
|
||||||
Icons.close,
|
size: 40,
|
||||||
color: Colors.red,
|
)
|
||||||
size: 40,
|
: const Icon(
|
||||||
),
|
Icons.close,
|
||||||
title: RichText(
|
color: Colors.red,
|
||||||
text: TextSpan(
|
size: 40,
|
||||||
children: [
|
|
||||||
TextSpan(
|
|
||||||
text: '${event.title}, ',
|
|
||||||
style: const TextStyle(
|
|
||||||
color: Colors.black,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
fontSize: 16,
|
|
||||||
),
|
),
|
||||||
),
|
title: RichText(
|
||||||
TextSpan(
|
text: TextSpan(
|
||||||
text:
|
children: [
|
||||||
'${DateFormat('dd MMM', 'es').format(DateTime.parse(event.day))} - ${TimeOfDay.fromDateTime(DateTime.parse(event.range1Hour1)).format(context)}',
|
TextSpan(
|
||||||
style: TextStyle(
|
text: '${event.title}, ',
|
||||||
color: Colors.grey[600],
|
style: const TextStyle(
|
||||||
fontSize: 16,
|
color: Colors.black,
|
||||||
),
|
fontWeight: FontWeight.bold,
|
||||||
),
|
fontSize: 16,
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
subtitle: Column(
|
TextSpan(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
text:
|
||||||
children: [
|
'${DateFormat('dd MMM', 'es').format(DateTime.parse(event.day))} - ${TimeOfDay.fromDateTime(DateTime.parse(event.range1Hour1)).format(context)}',
|
||||||
Row(
|
style: TextStyle(
|
||||||
children: [
|
color: Colors.grey[600],
|
||||||
RatingBar.builder(
|
fontSize: 16,
|
||||||
initialRating: event.scoresModel?.average ?? 0,
|
),
|
||||||
minRating: 1,
|
|
||||||
direction: Axis.horizontal,
|
|
||||||
allowHalfRating: true,
|
|
||||||
itemCount: 5,
|
|
||||||
itemSize: 25,
|
|
||||||
maxRating: 5,
|
|
||||||
itemPadding:
|
|
||||||
const EdgeInsets.symmetric(horizontal: 0),
|
|
||||||
itemBuilder: (context, _) => const Icon(
|
|
||||||
Icons.star,
|
|
||||||
color: Color(0xFF2BA4EC),
|
|
||||||
),
|
|
||||||
onRatingUpdate: (rating) {},
|
|
||||||
ignoreGestures: true,
|
|
||||||
),
|
|
||||||
const SizedBox(width: 5),
|
|
||||||
Text(
|
|
||||||
'(${event.scoresModel?.total.toString()}) ${event.scoresModel?.average.toStringAsFixed(1)}'),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
'" ${event.description}"',
|
|
||||||
style: const TextStyle(fontStyle: FontStyle.italic),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
trailing: const Icon(Icons.keyboard_arrow_right),
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
subtitle: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
RatingBar.builder(
|
||||||
|
initialRating: event.scoresModel?.average ?? 0,
|
||||||
|
minRating: 1,
|
||||||
|
direction: Axis.horizontal,
|
||||||
|
allowHalfRating: true,
|
||||||
|
itemCount: 5,
|
||||||
|
itemSize: 25,
|
||||||
|
maxRating: 5,
|
||||||
|
itemPadding:
|
||||||
|
const EdgeInsets.symmetric(horizontal: 0),
|
||||||
|
itemBuilder: (context, _) => const Icon(
|
||||||
|
Icons.star,
|
||||||
|
color: Color(0xFF2BA4EC),
|
||||||
|
),
|
||||||
|
onRatingUpdate: (rating) {},
|
||||||
|
ignoreGestures: true,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 5),
|
||||||
|
Text(
|
||||||
|
'(${event.scoresModel?.total.toString()}) ${event.scoresModel?.average.toStringAsFixed(1)}'),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
|
Text(
|
||||||
|
'" ${event.description}"',
|
||||||
|
style: const TextStyle(fontStyle: FontStyle.italic),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
trailing: const Icon(Icons.keyboard_arrow_right),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ class SolicitudScreen extends StatelessWidget {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
eventos.addAll(snapshot.data!);
|
eventos.addAll(snapshot.data!);
|
||||||
|
eventos.sort((a, b) => a.range1Hour1.compareTo(b.range1Hour1));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Error" + e.toString());
|
print("Error" + e.toString());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user