25-1/31/1
This commit is contained in:
@@ -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(
|
||||
'Don’t 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');
|
||||
}
|
||||
|
||||
59
lib/controller/firebase/live_activity.dart
Normal file
59
lib/controller/firebase/live_activity.dart
Normal 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"),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user