Implement schedule status update functionality for driver workflows; enhance navigation button behavior to reflect status changes

This commit is contained in:
Sven laptop
2026-05-08 19:19:57 +02:00
parent 3415cfa2b9
commit b00b93e7f0
5 changed files with 113 additions and 38 deletions
+9 -1
View File
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import '../models/schedule.dart' as schedule;
import '../screens/navigation_screen.dart';
import '../services/schedule_service.dart';
/// Route card widget showing route details
class RouteCard extends StatelessWidget {
@@ -56,7 +57,14 @@ class RouteCard extends StatelessWidget {
return Material(
color: Colors.transparent,
child: InkWell(
onTap: () {
onTap: () async {
try {
final scheduleService = ScheduleService();
await scheduleService.updateRouteStatus(route.id, 'in_progress');
} catch (_) {
// Ignore status update errors here; navigation should still open.
}
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => NavigationScreen(route: route),