This commit is contained in:
Hamza-Ayed
2023-09-13 15:29:32 +03:00
parent d8edc47230
commit 35f2bd61a2
12 changed files with 453 additions and 141 deletions

View File

@@ -8,6 +8,7 @@ import 'package:ride/constant/colors.dart';
import 'package:ride/constant/style.dart';
import 'package:ride/controller/functions/crud.dart';
import 'package:ride/controller/functions/launch.dart';
import 'package:ride/controller/home/map_page_controller.dart';
import 'package:ride/views/home/profile/promos_passenger_page.dart';
import 'package:ride/views/widgets/elevated_btn.dart';
@@ -206,19 +207,84 @@ class FirebasMessagesController extends GetxController {
print(passengerList);
print('9999999999999my Apply Ride 999999999999999');
var myList = jsonDecode(passengerList) as List<dynamic>;
Get.defaultDialog(
barrierDismissible: false,
title: message.notification!.title.toString(),
content: Row(
children: [Text(myList[1].toString())],
Get.snackbar(
'Captin Applied the Ride for You'.tr,
'message',
colorText: AppColor.greenColor,
duration: const Duration(seconds: 11),
instantInit: true,
snackPosition: SnackPosition.TOP,
titleText: Text(
'Applied'.tr,
style: const TextStyle(color: AppColor.redColor),
),
messageText: Text(
'Captin Applied the Ride for You'.tr,
style: AppStyle.title,
),
icon: const Icon(Icons.approval),
shouldIconPulse: true,
maxWidth: double.infinity,
margin: const EdgeInsets.all(16),
padding: const EdgeInsets.all(16),
borderRadius: 8,
borderColor: AppColor.primaryColor,
borderWidth: 2,
backgroundColor: AppColor.secondaryColor,
leftBarIndicatorColor: AppColor.greenColor,
boxShadows: [
BoxShadow(
color: Colors.black.withOpacity(0.25),
blurRadius: 4,
spreadRadius: 2,
offset: const Offset(0, 4),
),
confirm: MyElevatedButton(
title: 'Ok',
onPressed: () {
// MapController().rideConfirm = true;
},
));
],
backgroundGradient: const LinearGradient(
colors: [AppColor.greenColor, AppColor.accentColor],
begin: Alignment.topLeft,
end: Alignment.bottomRight,
),
onTap: (GetSnackBar snackBar) {
// Do something when the snackbar is tapped.
// MapController().rideConfirm = false;
// update();
},
isDismissible: true,
showProgressIndicator: false,
dismissDirection: DismissDirection.up,
progressIndicatorController: null,
progressIndicatorBackgroundColor: Colors.transparent,
progressIndicatorValueColor: null,
snackStyle: SnackStyle.GROUNDED,
forwardAnimationCurve: Curves.easeInToLinear,
reverseAnimationCurve: Curves.easeInOut,
animationDuration: const Duration(milliseconds: 4000),
barBlur: 8,
overlayBlur: 0,
snackbarStatus: null,
overlayColor: AppColor.primaryColor.withOpacity(0.5),
userInputForm: null,
);
// Get.defaultDialog(
// barrierDismissible: false,
// title: message.notification!.title.toString(),
// content: Row(
// children: [Text(myList[1].toString())],
// ),
// confirm: MyElevatedButton(
// title: 'Ok',
// onPressed: () {
// // MapController().rideConfirm = true;
// },
// ),
// cancel: MyElevatedButton(
// title: 'Cancel',
// onPressed: () {
// Get.back();
// },
// ));
} else if (message.notification!.title!.contains('Promo')) {
Get.to(const PromosPassengerPage());
}
@@ -370,9 +436,6 @@ class FirebasMessagesController extends GetxController {
}
}
// void sendNotificationToManager(String title, body) async {
// // tokens = box.read(BoxName.tokenManager);
// for (var i = 0; i < tokens.length; i++) {
// http
// .post(Uri.parse('https://fcm.googleapis.com/fcm/send'),