diff --git a/lib/screens/user/user_map_screen.dart b/lib/screens/user/user_map_screen.dart index a328e27..b60ec64 100644 --- a/lib/screens/user/user_map_screen.dart +++ b/lib/screens/user/user_map_screen.dart @@ -214,6 +214,12 @@ class _UserMapScreenState extends State { } + /// "a, b y c" — join(' y ') read as "a y b y c". + String _enumerar(List items) { + if (items.length <= 1) return items.join(); + return '${items.sublist(0, items.length - 1).join(', ')} y ${items.last}'; + } + /// Re-reads the professional's agenda right before creating the service. /// /// Returns true when the slot is still free, or when the agenda cannot be @@ -596,7 +602,7 @@ class _UserMapScreenState extends State { ScaffoldMessenger.of(context).clearSnackBars(); ScaffoldMessenger.of(context).showSnackBar(SnackBar( content: Text( - 'Falta ${faltan.join(' y ')} para pedir la cita'), + 'Falta ${_enumerar(faltan)} para pedir la cita'), )); return; }