fix: update status string comparisons in service list screens to English
_statusIcon switch cases and tileColor checks were comparing against Spanish status strings (aprobado/iniciado/terminado/denegado); backend returns English (accepted/active/completed/cancelled/denied) so they always fell to default. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
dc99169ef1
commit
9be1c3b678
@@ -92,11 +92,11 @@ class _MyServicesScreenState extends State<MyServicesScreen> {
|
|||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
...filtered.map((event) => ListTile(
|
...filtered.map((event) => ListTile(
|
||||||
tileColor: event.status == 'denegado'
|
tileColor: event.status == 'cancelled' || event.status == 'denied'
|
||||||
? Colors.red[100]
|
? Colors.red[100]
|
||||||
: Colors.blue[100],
|
: Colors.blue[100],
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (event.status == 'terminado') {
|
if (event.status == 'completed') {
|
||||||
if (event.userId == uid) {
|
if (event.userId == uid) {
|
||||||
if (event.userScored) {
|
if (event.userScored) {
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
@@ -204,22 +204,22 @@ class _MyServicesScreenState extends State<MyServicesScreen> {
|
|||||||
|
|
||||||
Widget _statusIcon(String status) {
|
Widget _statusIcon(String status) {
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case 'aprobado':
|
case 'accepted':
|
||||||
return const Column(mainAxisAlignment: MainAxisAlignment.center, children: [
|
return const Column(mainAxisAlignment: MainAxisAlignment.center, children: [
|
||||||
Icon(Icons.check, color: Colors.blue, size: 30),
|
Icon(Icons.check, color: Colors.blue, size: 30),
|
||||||
Text('Aceptado', style: TextStyle(fontSize: 12)),
|
Text('Aceptado', style: TextStyle(fontSize: 12)),
|
||||||
]);
|
]);
|
||||||
case 'iniciado':
|
case 'active':
|
||||||
return const Column(mainAxisAlignment: MainAxisAlignment.center, children: [
|
return const Column(mainAxisAlignment: MainAxisAlignment.center, children: [
|
||||||
Icon(Icons.access_time, color: Colors.blue, size: 30),
|
Icon(Icons.access_time, color: Colors.blue, size: 30),
|
||||||
Text('Iniciado', style: TextStyle(fontSize: 12)),
|
Text('Iniciado', style: TextStyle(fontSize: 12)),
|
||||||
]);
|
]);
|
||||||
case 'pendiente':
|
case 'pending':
|
||||||
return const Column(mainAxisAlignment: MainAxisAlignment.center, children: [
|
return const Column(mainAxisAlignment: MainAxisAlignment.center, children: [
|
||||||
Icon(Icons.access_time_outlined, color: Colors.blue, size: 30),
|
Icon(Icons.access_time_outlined, color: Colors.blue, size: 30),
|
||||||
Text('Pendiente', style: TextStyle(fontSize: 12)),
|
Text('Pendiente', style: TextStyle(fontSize: 12)),
|
||||||
]);
|
]);
|
||||||
case 'terminado':
|
case 'completed':
|
||||||
return const Column(mainAxisAlignment: MainAxisAlignment.center, children: [
|
return const Column(mainAxisAlignment: MainAxisAlignment.center, children: [
|
||||||
Icon(Icons.rocket_launch, color: Colors.blue, size: 30),
|
Icon(Icons.rocket_launch, color: Colors.blue, size: 30),
|
||||||
Text('Finalizado', style: TextStyle(fontSize: 12)),
|
Text('Finalizado', style: TextStyle(fontSize: 12)),
|
||||||
|
|||||||
@@ -86,11 +86,11 @@ class _MyServicesProScreenState extends State<MyServicesProScreen> {
|
|||||||
children: [
|
children: [
|
||||||
...eventos.map(
|
...eventos.map(
|
||||||
(event) => ListTile(
|
(event) => ListTile(
|
||||||
tileColor: event.status == 'denegado'
|
tileColor: event.status == 'cancelled' || event.status == 'denied'
|
||||||
? Colors.red[100]
|
? Colors.red[100]
|
||||||
: Colors.blue[100],
|
: Colors.blue[100],
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (event.status == 'terminado') {
|
if (event.status == 'completed') {
|
||||||
if (event.professionalId == uid) {
|
if (event.professionalId == uid) {
|
||||||
if (event.professionalScored) {
|
if (event.professionalScored) {
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
@@ -179,17 +179,17 @@ class _MyServicesProScreenState extends State<MyServicesProScreen> {
|
|||||||
|
|
||||||
Widget _statusIcon(String status) {
|
Widget _statusIcon(String status) {
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case 'aprobado':
|
case 'accepted':
|
||||||
return const Column(mainAxisAlignment: MainAxisAlignment.center, children: [
|
return const Column(mainAxisAlignment: MainAxisAlignment.center, children: [
|
||||||
Icon(Icons.check, color: Colors.blue, size: 30),
|
Icon(Icons.check, color: Colors.blue, size: 30),
|
||||||
Text('Aceptado', style: TextStyle(fontSize: 12)),
|
Text('Aceptado', style: TextStyle(fontSize: 12)),
|
||||||
]);
|
]);
|
||||||
case 'iniciado':
|
case 'active':
|
||||||
return const Column(mainAxisAlignment: MainAxisAlignment.center, children: [
|
return const Column(mainAxisAlignment: MainAxisAlignment.center, children: [
|
||||||
Icon(Icons.access_time, color: Colors.blue, size: 30),
|
Icon(Icons.access_time, color: Colors.blue, size: 30),
|
||||||
Text('Iniciado', style: TextStyle(fontSize: 12)),
|
Text('Iniciado', style: TextStyle(fontSize: 12)),
|
||||||
]);
|
]);
|
||||||
case 'terminado':
|
case 'completed':
|
||||||
return const Column(mainAxisAlignment: MainAxisAlignment.center, children: [
|
return const Column(mainAxisAlignment: MainAxisAlignment.center, children: [
|
||||||
Icon(Icons.rocket_launch, color: Colors.blue, size: 30),
|
Icon(Icons.rocket_launch, color: Colors.blue, size: 30),
|
||||||
Text('Finalizado', style: TextStyle(fontSize: 12)),
|
Text('Finalizado', style: TextStyle(fontSize: 12)),
|
||||||
|
|||||||
Reference in New Issue
Block a user