12/3/1
This commit is contained in:
@@ -1,15 +1,73 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/constant/style.dart';
|
||||
import 'package:ride/controller/auth/captin/notification_captain_controller.dart';
|
||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||
import 'package:ride/views/widgets/my_scafold.dart';
|
||||
import 'package:ride/views/widgets/mycircular.dart';
|
||||
|
||||
class NotificationCaptain extends StatelessWidget {
|
||||
const NotificationCaptain({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(NotificationCaptainController());
|
||||
|
||||
return MyScafolld(
|
||||
title: 'Notifications'.tr,
|
||||
body: [],
|
||||
body: [
|
||||
GetBuilder<NotificationCaptainController>(
|
||||
builder: (notificationCaptainController) =>
|
||||
notificationCaptainController.isloading
|
||||
? const MyCircularProgressIndicator()
|
||||
: SafeArea(
|
||||
child: ListView.builder(
|
||||
itemCount: notificationCaptainController
|
||||
.notificationData['message'].length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
if (notificationCaptainController
|
||||
.notificationData['message'] ==
|
||||
"No notification data found") {
|
||||
Get.defaultDialog();
|
||||
}
|
||||
var res = notificationCaptainController
|
||||
.notificationData['message'][index];
|
||||
return Card(
|
||||
elevation: 4,
|
||||
child: ListTile(
|
||||
onTap: () {
|
||||
Get.defaultDialog(
|
||||
title: res['title'],
|
||||
titleStyle: AppStyle.title,
|
||||
content: SizedBox(
|
||||
width: Get.width * .8,
|
||||
height: Get.height * .4,
|
||||
child: Text(
|
||||
res['body'],
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
confirm: MyElevatedButton(
|
||||
title: 'Ok',
|
||||
onPressed: () {
|
||||
//todo sql readen
|
||||
}));
|
||||
},
|
||||
leading:
|
||||
const Icon(Icons.notification_important),
|
||||
title: Text(
|
||||
res['title'],
|
||||
style: AppStyle.title,
|
||||
),
|
||||
subtitle: Text(
|
||||
res['body'],
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
))
|
||||
],
|
||||
isleading: true,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user