Update: 2026-07-12 05:49:17
This commit is contained in:
@@ -22,6 +22,8 @@ class TransitHomePage extends StatelessWidget {
|
|||||||
title: 'Mawasalati'.tr,
|
title: 'Mawasalati'.tr,
|
||||||
isleading: true,
|
isleading: true,
|
||||||
body: [
|
body: [
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: RefreshIndicator(
|
child: RefreshIndicator(
|
||||||
onRefresh: c.fetchMyEnrollments,
|
onRefresh: c.fetchMyEnrollments,
|
||||||
@@ -44,6 +46,8 @@ class TransitHomePage extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,9 @@ class _TransitOrgBrowsePageState extends State<TransitOrgBrowsePage> {
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
Get.find<TransitController>().browseOrgs();
|
Get.find<TransitController>().browseOrgs();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -32,8 +34,11 @@ class _TransitOrgBrowsePageState extends State<TransitOrgBrowsePage> {
|
|||||||
title: 'Choose your institution'.tr,
|
title: 'Choose your institution'.tr,
|
||||||
isleading: true,
|
isleading: true,
|
||||||
body: [
|
body: [
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
padding:
|
||||||
|
const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||||
child: TextField(
|
child: TextField(
|
||||||
controller: _searchCtrl,
|
controller: _searchCtrl,
|
||||||
onSubmitted: (v) => c.browseOrgs(search: v),
|
onSubmitted: (v) => c.browseOrgs(search: v),
|
||||||
@@ -70,10 +75,14 @@ class _TransitOrgBrowsePageState extends State<TransitOrgBrowsePage> {
|
|||||||
side: BorderSide(color: AppColor.borderColor),
|
side: BorderSide(color: AppColor.borderColor),
|
||||||
),
|
),
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
title: Text(org.nameAr, style: AppStyle.title),
|
title:
|
||||||
subtitle: Text(org.city, style: AppStyle.subtitle),
|
Text(org.nameAr, style: AppStyle.title),
|
||||||
trailing: const Icon(Icons.arrow_forward_ios, size: 16),
|
subtitle:
|
||||||
onTap: () => _showActivateSheet(context, c, org),
|
Text(org.city, style: AppStyle.subtitle),
|
||||||
|
trailing: const Icon(Icons.arrow_forward_ios,
|
||||||
|
size: 16),
|
||||||
|
onTap: () =>
|
||||||
|
_showActivateSheet(context, c, org),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@@ -81,10 +90,13 @@ class _TransitOrgBrowsePageState extends State<TransitOrgBrowsePage> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _showActivateSheet(BuildContext context, TransitController c, TransitOrg org) {
|
void _showActivateSheet(
|
||||||
|
BuildContext context, TransitController c, TransitOrg org) {
|
||||||
final idCtrl = TextEditingController();
|
final idCtrl = TextEditingController();
|
||||||
bool loading = false;
|
bool loading = false;
|
||||||
|
|
||||||
@@ -107,7 +119,8 @@ class _TransitOrgBrowsePageState extends State<TransitOrgBrowsePage> {
|
|||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(org.nameAr, style: AppStyle.headTitle2.copyWith(fontSize: 18)),
|
Text(org.nameAr,
|
||||||
|
style: AppStyle.headTitle2.copyWith(fontSize: 18)),
|
||||||
const SizedBox(height: 6),
|
const SizedBox(height: 6),
|
||||||
Text('Enter your student/employee ID to activate membership'.tr,
|
Text('Enter your student/employee ID to activate membership'.tr,
|
||||||
style: AppStyle.subtitle),
|
style: AppStyle.subtitle),
|
||||||
@@ -118,7 +131,8 @@ class _TransitOrgBrowsePageState extends State<TransitOrgBrowsePage> {
|
|||||||
hintText: 'Student ID'.tr,
|
hintText: 'Student ID'.tr,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: AppColor.secondaryColor,
|
fillColor: AppColor.secondaryColor,
|
||||||
border: OutlineInputBorder(borderRadius: BorderRadius.circular(12)),
|
border: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(12)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
@@ -128,7 +142,8 @@ class _TransitOrgBrowsePageState extends State<TransitOrgBrowsePage> {
|
|||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
if (idCtrl.text.trim().isEmpty) return;
|
if (idCtrl.text.trim().isEmpty) return;
|
||||||
setState(() => loading = true);
|
setState(() => loading = true);
|
||||||
final ok = await c.activateEnrollment(org.id, idCtrl.text.trim());
|
final ok =
|
||||||
|
await c.activateEnrollment(org.id, idCtrl.text.trim());
|
||||||
setState(() => loading = false);
|
setState(() => loading = false);
|
||||||
if (ok && ctx.mounted) {
|
if (ok && ctx.mounted) {
|
||||||
Navigator.pop(ctx);
|
Navigator.pop(ctx);
|
||||||
|
|||||||
@@ -21,7 +21,9 @@ class _TransitRoutesPageState extends State<TransitRoutesPage> {
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
Get.find<TransitController>().openOrgRoutes(widget.orgId);
|
Get.find<TransitController>().openOrgRoutes(widget.orgId);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -31,6 +33,8 @@ class _TransitRoutesPageState extends State<TransitRoutesPage> {
|
|||||||
title: widget.orgName,
|
title: widget.orgName,
|
||||||
isleading: true,
|
isleading: true,
|
||||||
body: [
|
body: [
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: c.isLoadingRoutes
|
child: c.isLoadingRoutes
|
||||||
? const Center(child: CircularProgressIndicator())
|
? const Center(child: CircularProgressIndicator())
|
||||||
@@ -69,6 +73,8 @@ class _TransitRoutesPageState extends State<TransitRoutesPage> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user