This commit is contained in:
Felipe
2023-11-17 17:53:54 -05:00
parent ef58892c13
commit a760c3c863
4 changed files with 245 additions and 130 deletions
+132 -119
View File
@@ -300,127 +300,140 @@ class _ProfessionalScreenState extends State<ProfessionalScreen> {
),
),
),
Expanded(
child: ListView.builder(
itemCount: professionals.length,
itemBuilder: (BuildContext context, int index) {
return ListTile(
leading: GestureDetector(
onTap: () {
Navigator.of(context).push(
CupertinoPageRoute(
builder: (BuildContext context) {
return ProfessionalInfoScreen(
professional: professionals[index],
);
},
),
);
},
child: ReferencePhoto(
ref: professionals[index].professionalRef,
sizeCircle: 50,
size: 50,
sizeIcon: 35,
),
),
trailing: GestureDetector(
child: const Icon(Icons.keyboard_arrow_right),
onTap: () {
Navigator.of(context).push(
CupertinoPageRoute(
builder: (BuildContext context) {
return ProfessionalInfoScreen(
professional: professionals[index],
);
},
),
);
},
),
title: RichText(
text: TextSpan(
style: const TextStyle(
fontSize: 15.0,
color: Colors.black,
),
children: <TextSpan>[
TextSpan(
text: '${professionals[index].name}, ',
style: const TextStyle(fontWeight: FontWeight.bold),
),
TextSpan(
text:
"${professionals[index].professionName}, ${professionals[index].cityName}",
style: TextStyle(color: Colors.grey[600]),
),
],
),
),
subtitle: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
settings?.tarifas == true
? professionals[index].tarifa == 0
? const SizedBox()
: Container(
padding: const EdgeInsets.symmetric(
horizontal: 10, vertical: 5),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20.0),
color: const Color(0xFFD6F4FF),
),
child: Text(
formatCurrency(
professionals[index].tarifa ?? 0),
style: TextStyle(
color: Colors.grey[850],
fontWeight: FontWeight.w600,
),
),
)
: const SizedBox(),
professionals[index].ubicacion == 'ambos'
? Text(
'Disponibilidad a domicilio y en sitio ${professionals[index].tarifa}',
style: const TextStyle(
color: Colors.blue,
professionals.isEmpty
? Expanded(
child: Padding(
padding:
const EdgeInsets.only(left: 20, right: 20, top: 50),
child:
Text('Aún no tenemos ningun(a) ${widget.profession}'),
))
: Expanded(
child: ListView.builder(
itemCount: professionals.length,
itemBuilder: (BuildContext context, int index) {
return ListTile(
leading: GestureDetector(
onTap: () {
Navigator.of(context).push(
CupertinoPageRoute(
builder: (BuildContext context) {
return ProfessionalInfoScreen(
professional: professionals[index],
);
},
),
)
: professionals[index].ubicacion == 'sitio'
? Text(
'Disponibilidad en ${professionals[index].ubicacion} ',
style: const TextStyle(
color: Colors.blue,
),
)
: Text(
'Disponibilidad a ${professionals[index].ubicacion}',
style: const TextStyle(
color: Colors.blue,
),
),
],
);
},
child: ReferencePhoto(
ref: professionals[index].professionalRef,
sizeCircle: 50,
size: 50,
sizeIcon: 35,
),
),
trailing: GestureDetector(
child: const Icon(Icons.keyboard_arrow_right),
onTap: () {
Navigator.of(context).push(
CupertinoPageRoute(
builder: (BuildContext context) {
return ProfessionalInfoScreen(
professional: professionals[index],
);
},
),
);
},
),
title: RichText(
text: TextSpan(
style: const TextStyle(
fontSize: 15.0,
color: Colors.black,
),
children: <TextSpan>[
TextSpan(
text: '${professionals[index].name}, ',
style: const TextStyle(
fontWeight: FontWeight.bold),
),
TextSpan(
text:
"${professionals[index].professionName}, ${professionals[index].cityName}",
style: TextStyle(color: Colors.grey[600]),
),
],
),
),
subtitle: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
settings?.tarifas == true
? professionals[index].tarifa == 0
? const SizedBox()
: Container(
padding: const EdgeInsets.symmetric(
horizontal: 10, vertical: 5),
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(20.0),
color: const Color(0xFFD6F4FF),
),
child: Text(
formatCurrency(
professionals[index].tarifa ??
0),
style: TextStyle(
color: Colors.grey[850],
fontWeight: FontWeight.w600,
),
),
)
: const SizedBox(),
professionals[index].ubicacion == 'ambos'
? Text(
'Disponibilidad a domicilio y en sitio ${professionals[index].tarifa}',
style: const TextStyle(
color: Colors.blue,
),
)
: professionals[index].ubicacion == 'sitio'
? Text(
'Disponibilidad en ${professionals[index].ubicacion} ',
style: const TextStyle(
color: Colors.blue,
),
)
: Text(
'Disponibilidad a ${professionals[index].ubicacion}',
style: const TextStyle(
color: Colors.blue,
),
),
],
),
onTap: () {
if (professionals[index].ubicacion == 'ambos') {
_showChoiceDialog(context).then((String? value) {
if (value != null) {
Navigator.pop(
context, [professionals[index], value]);
}
});
} else if (professionals[index].ubicacion ==
'sitio') {
Navigator.pop(
context, [professionals[index], 'sitio']);
} else {
Navigator.pop(
context, [professionals[index], 'domicilio']);
}
},
);
},
),
onTap: () {
if (professionals[index].ubicacion == 'ambos') {
_showChoiceDialog(context).then((String? value) {
if (value != null) {
Navigator.pop(
context, [professionals[index], value]);
}
});
} else if (professionals[index].ubicacion == 'sitio') {
Navigator.pop(context, [professionals[index], 'sitio']);
} else {
Navigator.pop(
context, [professionals[index], 'domicilio']);
}
},
);
},
),
),
),
],
),
),