25-1/31/1

This commit is contained in:
Hamza-Ayed
2025-01-31 14:57:17 +03:00
parent fd0002ce97
commit 13a7c3db81
100 changed files with 469 additions and 436 deletions

View File

@@ -1,12 +1,12 @@
import 'dart:convert';
import 'dart:io';
import 'package:SEFER/controller/functions/encrypt_decrypt.dart';
import 'package:Tripz/controller/functions/encrypt_decrypt.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:http/http.dart' as http;
import 'package:SEFER/controller/functions/toast.dart';
import 'package:SEFER/views/widgets/elevated_btn.dart';
import 'package:Tripz/controller/functions/toast.dart';
import 'package:Tripz/views/widgets/elevated_btn.dart';
import '../../constant/api_key.dart';
import '../../constant/box_name.dart';
@@ -266,7 +266,7 @@ class FirebaseMessagesController extends GetxController {
Get.find<MapPassengerController>().tripFinishedFromDriver();
NotificationController().showNotification(
'Dont forget your personal belongings.'.tr,
'Please make sure you have all your personal belongings and that any remaining fare, if applicable, has been added to your wallet before leaving. Thank you for choosing the Sefer app'
'Please make sure you have all your personal belongings and that any remaining fare, if applicable, has been added to your wallet before leaving. Thank you for choosing the Tripz app'
.tr,
'ding');
print(267);
@@ -351,7 +351,7 @@ class FirebaseMessagesController extends GetxController {
if (Platform.isAndroid) {
notificationController.showNotification(
'Driver Cancelled Your Trip'.tr,
'you will pay to Driver you will be pay the cost of driver time look to your SEFER Wallet'
'you will pay to Driver you will be pay the cost of driver time look to your Tripz Wallet'
.tr,
'cancel');
}

View File

@@ -0,0 +1,59 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class LiveActivityScreen extends StatefulWidget {
@override
_LiveActivityScreenState createState() => _LiveActivityScreenState();
}
class _LiveActivityScreenState extends State<LiveActivityScreen> {
static const platform = MethodChannel('live_activity_channel');
Future<void> _startLiveActivity() async {
try {
await platform.invokeMethod('startLiveActivity');
} on PlatformException catch (e) {
print("Failed to start Live Activity: '${e.message}'.");
}
}
Future<void> _updateLiveActivity(double progress) async {
try {
await platform.invokeMethod('updateLiveActivity', {"progress": progress});
} on PlatformException catch (e) {
print("Failed to update Live Activity: '${e.message}'.");
}
}
Future<void> _endLiveActivity() async {
try {
await platform.invokeMethod('endLiveActivity');
} on PlatformException catch (e) {
print("Failed to end Live Activity: '${e.message}'.");
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text("Live Activity Test")),
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ElevatedButton(
onPressed: _startLiveActivity,
child: Text("Start Live Activity"),
),
ElevatedButton(
onPressed: () => _updateLiveActivity(0.5),
child: Text("Update Progress to 50%"),
),
ElevatedButton(
onPressed: _endLiveActivity,
child: Text("End Live Activity"),
),
],
),
);
}
}