1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
import 'package:flutter/material.dart';
class Route {
final String name;
final String startLocation;
final String endLocation;
Route(
{required this.name,
required this.startLocation,
required this.endLocation});
}
class RoutesPage extends StatelessWidget {
final List<Route> dummyRoutes = [
Route(
name: 'Morning Ride - Gate 3 to Abdu-Basha',
startLocation: 'Gate 3',
endLocation: 'Abdu-Basha'),
Route(
name: 'Afternoon Ride - Abdu-Basha to Gate 3',
startLocation: 'Abdu-Basha',
endLocation: 'Gate 3'),
];
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('Routes')),
body: ListView.builder(
itemCount: dummyRoutes.length,
itemBuilder: (BuildContext context, int index) {
final Route route = dummyRoutes[index];
return ListTile(
title: Text(route.name),
subtitle:
Text('From: ${route.startLocation} - To: ${route.endLocation}'),
onTap: () {
// Handle route selection here, if needed
print('Selected route: ${route.name}');
},
);
},
),
);
}
}
|