Update: 2026-07-12 05:49:17
This commit is contained in:
@@ -21,7 +21,9 @@ class _TransitRoutesPageState extends State<TransitRoutesPage> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
Get.find<TransitController>().openOrgRoutes(widget.orgId);
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
Get.find<TransitController>().openOrgRoutes(widget.orgId);
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -31,41 +33,45 @@ class _TransitRoutesPageState extends State<TransitRoutesPage> {
|
||||
title: widget.orgName,
|
||||
isleading: true,
|
||||
body: [
|
||||
Expanded(
|
||||
child: c.isLoadingRoutes
|
||||
? const Center(child: CircularProgressIndicator())
|
||||
: c.currentOrgRoutes.isEmpty
|
||||
? Center(
|
||||
child: Text('No active routes currently'.tr, style: AppStyle.title),
|
||||
)
|
||||
: ListView.builder(
|
||||
padding: const EdgeInsets.all(16),
|
||||
itemCount: c.currentOrgRoutes.length,
|
||||
itemBuilder: (_, i) {
|
||||
final r = c.currentOrgRoutes[i];
|
||||
return Card(
|
||||
margin: const EdgeInsets.only(bottom: 10),
|
||||
color: AppColor.cardColor,
|
||||
elevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
side: BorderSide(color: AppColor.borderColor),
|
||||
),
|
||||
child: ListTile(
|
||||
leading: CircleAvatar(
|
||||
backgroundColor: AppColor.accentColor.withOpacity(0.15),
|
||||
child: Icon(Icons.directions_bus, color: AppColor.accentColor),
|
||||
),
|
||||
title: Text(r.nameAr, style: AppStyle.title),
|
||||
subtitle: Text('${r.stopCount} ${'Stops'.tr}', style: AppStyle.subtitle),
|
||||
trailing: const Icon(Icons.arrow_forward_ios, size: 16),
|
||||
onTap: () => Get.to(
|
||||
() => TransitLiveMapPage(routeId: r.id, routeName: r.nameAr),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: c.isLoadingRoutes
|
||||
? const Center(child: CircularProgressIndicator())
|
||||
: c.currentOrgRoutes.isEmpty
|
||||
? Center(
|
||||
child: Text('No active routes currently'.tr, style: AppStyle.title),
|
||||
)
|
||||
: ListView.builder(
|
||||
padding: const EdgeInsets.all(16),
|
||||
itemCount: c.currentOrgRoutes.length,
|
||||
itemBuilder: (_, i) {
|
||||
final r = c.currentOrgRoutes[i];
|
||||
return Card(
|
||||
margin: const EdgeInsets.only(bottom: 10),
|
||||
color: AppColor.cardColor,
|
||||
elevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
side: BorderSide(color: AppColor.borderColor),
|
||||
),
|
||||
child: ListTile(
|
||||
leading: CircleAvatar(
|
||||
backgroundColor: AppColor.accentColor.withOpacity(0.15),
|
||||
child: Icon(Icons.directions_bus, color: AppColor.accentColor),
|
||||
),
|
||||
title: Text(r.nameAr, style: AppStyle.title),
|
||||
subtitle: Text('${r.stopCount} ${'Stops'.tr}', style: AppStyle.subtitle),
|
||||
trailing: const Icon(Icons.arrow_forward_ios, size: 16),
|
||||
onTap: () => Get.to(
|
||||
() => TransitLiveMapPage(routeId: r.id, routeName: r.nameAr),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user