9/20/1
This commit is contained in:
@@ -54,8 +54,8 @@ android {
|
|||||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
||||||
minSdk = 23
|
minSdk = 23
|
||||||
targetSdk = flutter.targetSdkVersion
|
targetSdk = flutter.targetSdkVersion
|
||||||
versionCode = 88
|
versionCode = 90
|
||||||
versionName = '1.5.88`'
|
versionName = '1.5.90`'
|
||||||
multiDexEnabled =true
|
multiDexEnabled =true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -54,6 +54,7 @@
|
|||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="com.yalantis.ucrop.UCropActivity"
|
android:name="com.yalantis.ucrop.UCropActivity"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
|
|||||||
BIN
android/app/src/main/res/drawable/launcher_icon.png
Normal file
BIN
android/app/src/main/res/drawable/launcher_icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.8 KiB |
@@ -214,9 +214,9 @@ PODS:
|
|||||||
- record_darwin (1.0.0):
|
- record_darwin (1.0.0):
|
||||||
- Flutter
|
- Flutter
|
||||||
- FlutterMacOS
|
- FlutterMacOS
|
||||||
- SDWebImage (5.19.4):
|
- SDWebImage (5.19.7):
|
||||||
- SDWebImage/Core (= 5.19.4)
|
- SDWebImage/Core (= 5.19.7)
|
||||||
- SDWebImage/Core (5.19.4)
|
- SDWebImage/Core (5.19.7)
|
||||||
- SDWebImageWebPCoder (0.14.6):
|
- SDWebImageWebPCoder (0.14.6):
|
||||||
- libwebp (~> 1.0)
|
- libwebp (~> 1.0)
|
||||||
- SDWebImage/Core (~> 5.17)
|
- SDWebImage/Core (~> 5.17)
|
||||||
@@ -484,7 +484,7 @@ SPEC CHECKSUMS:
|
|||||||
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
|
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
|
||||||
RecaptchaInterop: 7d1a4a01a6b2cb1610a47ef3f85f0c411434cb21
|
RecaptchaInterop: 7d1a4a01a6b2cb1610a47ef3f85f0c411434cb21
|
||||||
record_darwin: df0a677188e5fed18472550298e675f19ddaffbe
|
record_darwin: df0a677188e5fed18472550298e675f19ddaffbe
|
||||||
SDWebImage: 066c47b573f408f18caa467d71deace7c0f8280d
|
SDWebImage: 8a6b7b160b4d710e2a22b6900e25301075c34cb3
|
||||||
SDWebImageWebPCoder: e38c0a70396191361d60c092933e22c20d5b1380
|
SDWebImageWebPCoder: e38c0a70396191361d60c092933e22c20d5b1380
|
||||||
share: 0b2c3e82132f5888bccca3351c504d0003b3b410
|
share: 0b2c3e82132f5888bccca3351c504d0003b3b410
|
||||||
sign_in_with_apple: f3bf75217ea4c2c8b91823f225d70230119b8440
|
sign_in_with_apple: f3bf75217ea4c2c8b91823f225d70230119b8440
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>57</string>
|
<string>58</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleURLTypes</key>
|
<key>CFBundleURLTypes</key>
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
</dict>
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>4.0.57</string>
|
<string>4.0.58</string>
|
||||||
<key>FirebaseAppDelegateProxyEnabled</key>
|
<key>FirebaseAppDelegateProxyEnabled</key>
|
||||||
<string>NO</string>
|
<string>NO</string>
|
||||||
<key>GMSApiKey</key>
|
<key>GMSApiKey</key>
|
||||||
|
|||||||
@@ -174,22 +174,11 @@ class NotificationController extends GetxController {
|
|||||||
// display a dialog with the notification details, tap ok to go to another page
|
// display a dialog with the notification details, tap ok to go to another page
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
|
||||||
// import 'package:get/get.dart';
|
|
||||||
// import 'package:timezone/data/latest.dart' as tz;
|
|
||||||
// import 'package:timezone/timezone.dart' as tz;
|
|
||||||
|
|
||||||
// class NotificationController extends GetxController {
|
// class NotificationController extends GetxController {
|
||||||
// final FlutterLocalNotificationsPlugin _flutterLocalNotificationsPlugin =
|
// final FlutterLocalNotificationsPlugin _flutterLocalNotificationsPlugin =
|
||||||
// FlutterLocalNotificationsPlugin();
|
// FlutterLocalNotificationsPlugin();
|
||||||
|
|
||||||
// @override
|
|
||||||
// void onInit() {
|
|
||||||
// super.onInit();
|
|
||||||
// initNotifications();
|
|
||||||
// tz.initializeTimeZones();
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // Initializes the local notifications plugin
|
// // Initializes the local notifications plugin
|
||||||
// Future<void> initNotifications() async {
|
// Future<void> initNotifications() async {
|
||||||
// const AndroidInitializationSettings android =
|
// const AndroidInitializationSettings android =
|
||||||
@@ -212,29 +201,4 @@ class NotificationController extends GetxController {
|
|||||||
// NotificationDetails details = NotificationDetails(android: android);
|
// NotificationDetails details = NotificationDetails(android: android);
|
||||||
// await _flutterLocalNotificationsPlugin.show(0, title, message, details);
|
// await _flutterLocalNotificationsPlugin.show(0, title, message, details);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// // Schedules a notification for a specific time
|
|
||||||
// Future<void> scheduleNotification(
|
|
||||||
// String title, String body, DateTime scheduledTime) async {
|
|
||||||
// await _flutterLocalNotificationsPlugin.zonedSchedule(
|
|
||||||
// 0,
|
|
||||||
// title,
|
|
||||||
// body,
|
|
||||||
// tz.TZDateTime.from(scheduledTime, tz.local),
|
|
||||||
// const NotificationDetails(
|
|
||||||
// android: AndroidNotificationDetails(
|
|
||||||
// 'your_channel_id',
|
|
||||||
// 'your_channel_name',
|
|
||||||
// channelDescription: 'your_channel_description',
|
|
||||||
// importance: Importance.max,
|
|
||||||
// priority: Priority.high,
|
|
||||||
// showWhen: false,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// androidAllowWhileIdle: true,
|
|
||||||
// uiLocalNotificationDateInterpretation:
|
|
||||||
// UILocalNotificationDateInterpretation.absoluteTime,
|
|
||||||
// matchDateTimeComponents: DateTimeComponents.time,
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
// }
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ class MyTranslation extends Translations {
|
|||||||
@override
|
@override
|
||||||
Map<String, Map<String, String>> get keys => {
|
Map<String, Map<String, String>> get keys => {
|
||||||
"ar": {
|
"ar": {
|
||||||
|
'If you need any help or have questions, this is the right place to do that. You are welcome!':
|
||||||
|
'إذا كنت بحاجة إلى أي مساعدة أو لديك أي أسئلة، فهذا هو المكان المناسب لذلك. أهلاً وسهلاً بك!',
|
||||||
'ID Mismatch': "عدم تطابق الرقم التعريفي",
|
'ID Mismatch': "عدم تطابق الرقم التعريفي",
|
||||||
"face detect": "كشف الوجه",
|
"face detect": "كشف الوجه",
|
||||||
'An error occurred while saving driver data':
|
'An error occurred while saving driver data':
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ class NotificationCaptainController extends GetxController {
|
|||||||
updateNotification(String id) async {
|
updateNotification(String id) async {
|
||||||
await CRUD().post(
|
await CRUD().post(
|
||||||
link: AppLink.updateNotificationCaptain,
|
link: AppLink.updateNotificationCaptain,
|
||||||
payload: {'isShown': true, 'id': id},
|
payload: {'isShown': 'true', 'id': id},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import 'package:SEFER/views/widgets/elevated_btn.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
import '../../constant/links.dart';
|
import '../../constant/links.dart';
|
||||||
|
import '../../views/widgets/mydialoug.dart';
|
||||||
import '../functions/crud.dart';
|
import '../functions/crud.dart';
|
||||||
|
|
||||||
class RideAvailableController extends GetxController {
|
class RideAvailableController extends GetxController {
|
||||||
@@ -18,16 +19,20 @@ class RideAvailableController extends GetxController {
|
|||||||
isLoading = false;
|
isLoading = false;
|
||||||
update();
|
update();
|
||||||
} else {
|
} else {
|
||||||
Get.defaultDialog(
|
MyDialog().getDialog("No Rides Available".tr, '', () {
|
||||||
title: "No Rides Available".tr,
|
Get.back();
|
||||||
middleText: '',
|
Get.back();
|
||||||
titleStyle: AppStyle.title,
|
});
|
||||||
confirm: MyElevatedButton(
|
// Get.defaultDialog(
|
||||||
title: 'Ok'.tr,
|
// title: "No Rides Available".tr,
|
||||||
onPressed: () {
|
// middleText: '',
|
||||||
Get.back();
|
// titleStyle: AppStyle.title,
|
||||||
Get.back();
|
// confirm: MyElevatedButton(
|
||||||
}));
|
// title: 'Ok'.tr,
|
||||||
|
// onPressed: () {
|
||||||
|
// Get.back();
|
||||||
|
// Get.back();
|
||||||
|
// }));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -107,6 +107,8 @@ void main() async {
|
|||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
await WakelockPlus.enable();
|
await WakelockPlus.enable();
|
||||||
|
|
||||||
|
await GetStorage.init();
|
||||||
|
Stripe.publishableKey = AK.publishableKeyStripe;
|
||||||
// Request location permission
|
// Request location permission
|
||||||
// PermissionStatus status = await Permission.location.request();
|
// PermissionStatus status = await Permission.location.request();
|
||||||
// if (status.isDenied) {
|
// if (status.isDenied) {
|
||||||
@@ -120,9 +122,6 @@ void main() async {
|
|||||||
await LocationController().startLocationUpdates();
|
await LocationController().startLocationUpdates();
|
||||||
}
|
}
|
||||||
|
|
||||||
await GetStorage.init();
|
|
||||||
Stripe.publishableKey = AK.publishableKeyStripe;
|
|
||||||
|
|
||||||
if (Platform.isAndroid || Platform.isIOS) {
|
if (Platform.isAndroid || Platform.isIOS) {
|
||||||
await Firebase.initializeApp(
|
await Firebase.initializeApp(
|
||||||
options: DefaultFirebaseOptions.currentPlatform,
|
options: DefaultFirebaseOptions.currentPlatform,
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ class SmsSignupEgypt extends StatelessWidget {
|
|||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 20.0),
|
padding: const EdgeInsets.only(bottom: 20.0),
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
'assets/images/logo.png', // Make sure you have a logo image in your assets folder
|
'assets/images/logo.gif', // Make sure you have a logo image in your assets folder
|
||||||
height: 100,
|
height: 100,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -91,13 +91,16 @@ class SmsSignupEgypt extends StatelessWidget {
|
|||||||
// Submit button
|
// Submit button
|
||||||
registerCaptainController.isLoading
|
registerCaptainController.isLoading
|
||||||
? const MyCircularProgressIndicator()
|
? const MyCircularProgressIndicator()
|
||||||
: MyElevatedButton(
|
: Padding(
|
||||||
onPressed: () async {
|
padding: const EdgeInsets.all(16.0),
|
||||||
!registerCaptainController.isSent
|
child: MyElevatedButton(
|
||||||
? await registerCaptainController.sendOtpMessage()
|
onPressed: () async {
|
||||||
: await registerCaptainController.verifySMSCode();
|
!registerCaptainController.isSent
|
||||||
},
|
? await registerCaptainController.sendOtpMessage()
|
||||||
title: 'Submit'.tr,
|
: await registerCaptainController.verifySMSCode();
|
||||||
|
},
|
||||||
|
title: 'Submit'.tr,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,169 +1,191 @@
|
|||||||
import 'package:SEFER/constant/box_name.dart';
|
import 'package:SEFER/constant/box_name.dart';
|
||||||
import 'package:SEFER/constant/colors.dart';
|
import 'package:SEFER/constant/colors.dart';
|
||||||
import 'package:SEFER/constant/style.dart';
|
|
||||||
import 'package:SEFER/main.dart';
|
import 'package:SEFER/main.dart';
|
||||||
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
|
||||||
import 'package:SEFER/views/widgets/my_textField.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_contacts/contact.dart';
|
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
import '../../../controller/auth/captin/invit_controller.dart';
|
import '../../../controller/auth/captin/invit_controller.dart';
|
||||||
import '../../../print.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
import '../../widgets/elevated_btn.dart';
|
||||||
|
|
||||||
class InviteDriverScreen extends StatelessWidget {
|
class InviteDriverScreen extends StatelessWidget {
|
||||||
final InviteController controller = Get.put(InviteController());
|
final InviteController controller = Get.put(InviteController());
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return CupertinoPageScaffold(
|
||||||
appBar: AppBar(title: Text('Invite a Driver'.tr)),
|
navigationBar: CupertinoNavigationBar(
|
||||||
body: Padding(
|
middle: Text('Invite a Driver'.tr),
|
||||||
padding: const EdgeInsets.all(16),
|
leading: CupertinoNavigationBarBackButton(
|
||||||
child: Column(
|
onPressed: () => Get.back(),
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
),
|
||||||
children: [
|
),
|
||||||
Text(
|
child: SafeArea(
|
||||||
"Invite another driver and both get a gift after he completes 100 trips!"
|
child: SingleChildScrollView(
|
||||||
.tr,
|
padding: const EdgeInsets.all(16),
|
||||||
style: const TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
|
child: Column(
|
||||||
),
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
const SizedBox(height: 20),
|
children: [
|
||||||
Row(
|
Text(
|
||||||
children: [
|
"Invite another driver and both get a gift after he completes 100 trips!"
|
||||||
Expanded(
|
.tr,
|
||||||
child: MyTextForm(
|
style: CupertinoTheme.of(context).textTheme.navTitleTextStyle,
|
||||||
controller: controller.invitePhoneController,
|
),
|
||||||
label: 'Enter driver\'s phone'.tr,
|
const SizedBox(height: 20),
|
||||||
hint: 'Enter driver\'s phone'.tr,
|
Row(
|
||||||
type: TextInputType.phone,
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: CupertinoTextField(
|
||||||
|
controller: controller.invitePhoneController,
|
||||||
|
placeholder: 'Enter driver\'s phone'.tr,
|
||||||
|
keyboardType: TextInputType.phone,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
CupertinoButton(
|
||||||
IconButton(
|
child: const Icon(CupertinoIcons.person_2),
|
||||||
icon: const Icon(Icons.contacts),
|
onPressed: () async {
|
||||||
onPressed: () async {
|
await controller.pickContacts();
|
||||||
await controller.pickContacts();
|
if (controller.contacts.isNotEmpty) {
|
||||||
if (controller.contacts.isNotEmpty) {
|
if (box.read(BoxName.IsSavedPhones) == null) {
|
||||||
if (box.read(BoxName.IsSavedPhones) == null) {
|
controller.savePhoneToServer();
|
||||||
controller.savePhoneToServer();
|
box.write(BoxName.IsSavedPhones, true);
|
||||||
box.write(BoxName.IsSavedPhones, true);
|
}
|
||||||
|
_showContactsDialog(context);
|
||||||
}
|
}
|
||||||
Get.defaultDialog(
|
},
|
||||||
title: 'Choose from contact'.tr,
|
),
|
||||||
content: Column(
|
],
|
||||||
children: [
|
),
|
||||||
SizedBox(
|
const SizedBox(height: 20),
|
||||||
height: 300,
|
Row(
|
||||||
child: ListView.builder(
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
itemCount: controller.contactMaps.length,
|
children: [
|
||||||
itemBuilder: (context, index) {
|
MyElevatedButton(
|
||||||
final contact = controller.contactMaps[index];
|
title: 'Send Invite'.tr,
|
||||||
return InkWell(
|
onPressed: controller.sendInvite,
|
||||||
onTap: () {
|
),
|
||||||
controller.selectPhone(
|
MyElevatedButton(
|
||||||
contact['phones'].toString());
|
title: 'Show Invitations'.tr,
|
||||||
},
|
onPressed: () async {
|
||||||
child: ListTile(
|
controller.fetchDriverStats();
|
||||||
title: Text(contact['name'].toString()),
|
},
|
||||||
subtitle: Text(
|
),
|
||||||
controller.formatPhoneNumber(
|
],
|
||||||
contact['phones'][0].toString())),
|
),
|
||||||
),
|
const SizedBox(height: 20),
|
||||||
);
|
GetBuilder<InviteController>(
|
||||||
|
builder: (controller) {
|
||||||
|
return SizedBox(
|
||||||
|
height: Get.height * .4,
|
||||||
|
child: controller.driverInvitationData.isEmpty
|
||||||
|
? Center(
|
||||||
|
child: Text(
|
||||||
|
"No invitation found yet!".tr,
|
||||||
|
style: CupertinoTheme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.navTitleTextStyle,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: ListView.builder(
|
||||||
|
itemCount: controller.driverInvitationData.length,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
int countOfInvitDriver = int.tryParse(controller
|
||||||
|
.driverInvitationData[index]
|
||||||
|
['countOfInvitDriver']
|
||||||
|
?.toString() ??
|
||||||
|
'0') ??
|
||||||
|
0;
|
||||||
|
|
||||||
|
double progressValue = countOfInvitDriver / 100.0;
|
||||||
|
progressValue = progressValue.clamp(0.0, 1.0);
|
||||||
|
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () async {
|
||||||
|
controller.onSelectDriverInvitation(index);
|
||||||
},
|
},
|
||||||
),
|
child: Container(
|
||||||
),
|
margin:
|
||||||
],
|
const EdgeInsets.symmetric(vertical: 8.0),
|
||||||
),
|
child: Stack(
|
||||||
);
|
alignment: AlignmentDirectional.center,
|
||||||
}
|
children: [
|
||||||
},
|
Container(
|
||||||
),
|
decoration: BoxDecoration(
|
||||||
],
|
borderRadius:
|
||||||
),
|
BorderRadius.circular(12),
|
||||||
const SizedBox(height: 20),
|
color: CupertinoColors.systemGrey5,
|
||||||
Row(
|
),
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
width: Get.width * .85,
|
||||||
children: [
|
height: 35,
|
||||||
MyElevatedButton(
|
child: ClipRRect(
|
||||||
title: 'Send Invite'.tr,
|
borderRadius:
|
||||||
onPressed: controller.sendInvite,
|
BorderRadius.circular(12),
|
||||||
),
|
child: LinearProgressIndicator(
|
||||||
MyElevatedButton(
|
value: progressValue,
|
||||||
title: 'Show Invitations'.tr,
|
backgroundColor:
|
||||||
onPressed: () async {
|
CupertinoColors.systemGrey3,
|
||||||
controller.fetchDriverStats();
|
valueColor:
|
||||||
},
|
const AlwaysStoppedAnimation<
|
||||||
),
|
Color>(
|
||||||
],
|
CupertinoColors.activeBlue),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
),
|
||||||
GetBuilder<InviteController>(builder: (controller) {
|
|
||||||
return SizedBox(
|
|
||||||
height: Get.height * .4,
|
|
||||||
child: controller.driverInvitationData.isEmpty
|
|
||||||
? Center(
|
|
||||||
child: Text(
|
|
||||||
"No invitation found yet!".tr,
|
|
||||||
style: AppStyle.title,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
: ListView.builder(
|
|
||||||
itemCount: controller.driverInvitationData.length,
|
|
||||||
itemBuilder: (context, index) {
|
|
||||||
int countOfInvitDriver = 0;
|
|
||||||
if (controller.driverInvitationData[index]
|
|
||||||
.containsKey('countOfInvitDriver')) {
|
|
||||||
countOfInvitDriver = int.tryParse(controller
|
|
||||||
.driverInvitationData[index]
|
|
||||||
['countOfInvitDriver']
|
|
||||||
.toString()) ??
|
|
||||||
0;
|
|
||||||
}
|
|
||||||
|
|
||||||
double progressValue = countOfInvitDriver / 100.0;
|
|
||||||
if (progressValue > 1.0) progressValue = 1.0;
|
|
||||||
if (progressValue < 0.0) progressValue = 0.0;
|
|
||||||
|
|
||||||
return InkWell(
|
|
||||||
onTap: () async {
|
|
||||||
controller.onSelectDriverInvitation(index);
|
|
||||||
},
|
|
||||||
child: Container(
|
|
||||||
margin: const EdgeInsets.symmetric(vertical: 8.0),
|
|
||||||
child: Stack(
|
|
||||||
alignment: AlignmentDirectional.center,
|
|
||||||
children: [
|
|
||||||
Container(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.circular(12),
|
|
||||||
color:
|
|
||||||
AppColor.accentColor.withOpacity(.5),
|
|
||||||
),
|
|
||||||
width: Get.width * .85,
|
|
||||||
child: ClipRRect(
|
|
||||||
borderRadius: BorderRadius.circular(12),
|
|
||||||
child: LinearProgressIndicator(
|
|
||||||
value: progressValue,
|
|
||||||
color: AppColor.blueColor,
|
|
||||||
backgroundColor: AppColor.accentColor
|
|
||||||
.withOpacity(.3),
|
|
||||||
minHeight: 35,
|
|
||||||
),
|
),
|
||||||
),
|
Text(
|
||||||
|
'${controller.driverInvitationData[index]['invitorName']} ${countOfInvitDriver} / 100 ${'Trip'.tr}',
|
||||||
|
style: CupertinoTheme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.textStyle,
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
Text(
|
),
|
||||||
'${controller.driverInvitationData[index]['invitorName']} ${controller.driverInvitationData[index]['countOfInvitDriver']} / 100 ${'Trip'.tr}',
|
);
|
||||||
),
|
},
|
||||||
],
|
),
|
||||||
),
|
);
|
||||||
),
|
},
|
||||||
);
|
)
|
||||||
},
|
],
|
||||||
),
|
),
|
||||||
);
|
),
|
||||||
})
|
),
|
||||||
],
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void _showContactsDialog(BuildContext context) {
|
||||||
|
showCupertinoModalPopup(
|
||||||
|
context: context,
|
||||||
|
builder: (BuildContext context) => CupertinoActionSheet(
|
||||||
|
title: Text('Choose from contact'.tr),
|
||||||
|
actions: [
|
||||||
|
SizedBox(
|
||||||
|
height: 300,
|
||||||
|
child: CupertinoScrollbar(
|
||||||
|
child: ListView.builder(
|
||||||
|
itemCount: controller.contactMaps.length,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
final contact = controller.contactMaps[index];
|
||||||
|
return CupertinoActionSheetAction(
|
||||||
|
child: Text(
|
||||||
|
'${contact['name']} - ${controller.formatPhoneNumber(contact['phones'][0].toString())}'),
|
||||||
|
onPressed: () {
|
||||||
|
controller.selectPhone(contact['phones'].toString());
|
||||||
|
// Navigator.pop(context);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
cancelButton: CupertinoActionSheetAction(
|
||||||
|
child: Text('Cancel'.tr),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
|
import 'package:SEFER/views/widgets/mydialoug.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
import '../../../../constant/colors.dart';
|
|
||||||
import '../../../../constant/style.dart';
|
|
||||||
import '../../../../controller/auth/captin/history_captain.dart';
|
import '../../../../controller/auth/captin/history_captain.dart';
|
||||||
import '../../../widgets/elevated_btn.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import '../../../widgets/my_scafold.dart';
|
import 'package:get/get.dart';
|
||||||
import '../../../widgets/mycircular.dart';
|
|
||||||
|
|
||||||
class HistoryCaptain extends StatelessWidget {
|
class HistoryCaptain extends StatelessWidget {
|
||||||
const HistoryCaptain({super.key});
|
const HistoryCaptain({super.key});
|
||||||
@@ -14,42 +12,57 @@ class HistoryCaptain extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
Get.put(HistoryCaptainController());
|
Get.put(HistoryCaptainController());
|
||||||
return MyScafolld(
|
return CupertinoPageScaffold(
|
||||||
title: 'History Page'.tr,
|
navigationBar: CupertinoNavigationBar(
|
||||||
body: [
|
middle: Text('History Page'.tr),
|
||||||
GetBuilder<HistoryCaptainController>(
|
leading: CupertinoNavigationBarBackButton(
|
||||||
builder: (historyCaptainController) => historyCaptainController
|
onPressed: () => Get.back(),
|
||||||
.isloading
|
),
|
||||||
? const MyCircularProgressIndicator()
|
),
|
||||||
: historyCaptainController.historyData['message'].length < 1
|
child: SafeArea(
|
||||||
? Center(
|
child: GetBuilder<HistoryCaptainController>(
|
||||||
child: Text(
|
builder: (historyCaptainController) => historyCaptainController
|
||||||
'No ride Yet.'.tr,
|
.isloading
|
||||||
style: AppStyle.headTitle,
|
? const Center(child: CupertinoActivityIndicator())
|
||||||
),
|
: historyCaptainController.historyData['message'].length < 1
|
||||||
)
|
? Center(
|
||||||
: ListView.builder(
|
child: Text(
|
||||||
itemCount: historyCaptainController
|
'No ride Yet.'.tr,
|
||||||
.historyData['message'].length,
|
style: CupertinoTheme.of(context)
|
||||||
itemBuilder: (BuildContext context, int index) {
|
.textTheme
|
||||||
var list = historyCaptainController
|
.navTitleTextStyle,
|
||||||
.historyData['message'][index];
|
),
|
||||||
return InkWell(
|
)
|
||||||
onTap: () {
|
: ListView.builder(
|
||||||
list['status'] != 'Cancel'
|
itemCount: historyCaptainController
|
||||||
? historyCaptainController
|
.historyData['message'].length,
|
||||||
.getHistoryDetails(list['order_id'])
|
itemBuilder: (BuildContext context, int index) {
|
||||||
: Get.defaultDialog(
|
var list = historyCaptainController
|
||||||
title: 'This Trip Cancelled'.tr,
|
.historyData['message'][index];
|
||||||
middleText: '',
|
return Padding(
|
||||||
titleStyle: AppStyle.title,
|
padding: const EdgeInsets.all(4.0),
|
||||||
confirm: MyElevatedButton(
|
child: Container(
|
||||||
title: 'Ok'.tr,
|
decoration: BoxDecoration(
|
||||||
onPressed: () => Get.back()));
|
border: Border.all(
|
||||||
},
|
color: CupertinoColors.systemGrey, width: 1),
|
||||||
child: Card(
|
borderRadius:
|
||||||
child: Padding(
|
const BorderRadius.all(Radius.circular(8.0)),
|
||||||
padding: const EdgeInsets.all(8.0),
|
),
|
||||||
|
child: CupertinoButton(
|
||||||
|
onPressed: () {
|
||||||
|
if (list['status'] != 'Cancel') {
|
||||||
|
historyCaptainController
|
||||||
|
.getHistoryDetails(list['order_id']);
|
||||||
|
} else {
|
||||||
|
MyDialog().getDialog(
|
||||||
|
'This Trip Cancelled'.tr,
|
||||||
|
'This Trip Cancelled'.tr,
|
||||||
|
() => Get.back(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
margin: const EdgeInsets.all(8),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment:
|
||||||
MainAxisAlignment.spaceBetween,
|
MainAxisAlignment.spaceBetween,
|
||||||
@@ -60,11 +73,15 @@ class HistoryCaptain extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'OrderId'.tr,
|
'OrderId'.tr,
|
||||||
style: AppStyle.title,
|
style: CupertinoTheme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.navTitleTextStyle,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
list['order_id'],
|
list['order_id'],
|
||||||
style: AppStyle.subtitle,
|
style: CupertinoTheme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.textStyle,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -74,34 +91,51 @@ class HistoryCaptain extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'created time'.tr,
|
'created time'.tr,
|
||||||
style: AppStyle.title,
|
style: CupertinoTheme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.navTitleTextStyle,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
list['created_at'],
|
list['created_at'],
|
||||||
style: AppStyle.subtitle,
|
style: CupertinoTheme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.textStyle,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
list['status'],
|
list['status'],
|
||||||
style: list['status'] == 'Apply'
|
style: list['status'] == 'Apply'
|
||||||
? AppStyle.title.copyWith(
|
? CupertinoTheme.of(context)
|
||||||
color: AppColor.greenColor)
|
.textTheme
|
||||||
|
.navTitleTextStyle
|
||||||
|
.copyWith(
|
||||||
|
color: CupertinoColors
|
||||||
|
.systemGreen)
|
||||||
: list['status'] == 'Refused'
|
: list['status'] == 'Refused'
|
||||||
? AppStyle.title.copyWith(
|
? CupertinoTheme.of(context)
|
||||||
color: AppColor.redColor)
|
.textTheme
|
||||||
: AppStyle.title.copyWith(
|
.navTitleTextStyle
|
||||||
color: AppColor.yellowColor),
|
.copyWith(
|
||||||
|
color: CupertinoColors
|
||||||
|
.systemRed)
|
||||||
|
: CupertinoTheme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.navTitleTextStyle
|
||||||
|
.copyWith(
|
||||||
|
color: CupertinoColors
|
||||||
|
.systemYellow),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
),
|
||||||
},
|
);
|
||||||
))
|
},
|
||||||
],
|
),
|
||||||
isleading: true,
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,204 +1,238 @@
|
|||||||
import 'package:SEFER/controller/functions/location_controller.dart';
|
import 'package:SEFER/controller/functions/location_controller.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:SEFER/constant/colors.dart';
|
|
||||||
import 'package:SEFER/constant/style.dart';
|
|
||||||
import 'package:SEFER/controller/auth/captin/history_captain.dart';
|
import 'package:SEFER/controller/auth/captin/history_captain.dart';
|
||||||
import 'package:SEFER/controller/functions/launch.dart';
|
import 'package:SEFER/controller/functions/launch.dart';
|
||||||
import 'package:SEFER/views/widgets/my_scafold.dart';
|
|
||||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||||
|
|
||||||
import '../../../widgets/mycircular.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
|
|
||||||
class HistoryDetailsPage extends StatelessWidget {
|
class HistoryDetailsPage extends StatelessWidget {
|
||||||
HistoryDetailsPage({super.key});
|
HistoryDetailsPage({super.key});
|
||||||
HistoryCaptainController historyCaptainController =
|
HistoryCaptainController historyCaptainController =
|
||||||
Get.put(HistoryCaptainController());
|
Get.put(HistoryCaptainController());
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MyScafolld(
|
return CupertinoPageScaffold(
|
||||||
title: 'Trip Detail'.tr,
|
navigationBar: CupertinoNavigationBar(
|
||||||
body: [
|
middle: Text('Trip Detail'.tr),
|
||||||
GetBuilder<HistoryCaptainController>(
|
leading: CupertinoButton(
|
||||||
builder: (historyCaptainController) {
|
padding: EdgeInsets.zero,
|
||||||
|
child: const Icon(CupertinoIcons.back),
|
||||||
|
onPressed: () => Navigator.pop(context),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: GetBuilder<HistoryCaptainController>(
|
||||||
|
builder: (historyCaptainController) {
|
||||||
var res = historyCaptainController.historyDetailsData['data'];
|
var res = historyCaptainController.historyDetailsData['data'];
|
||||||
return historyCaptainController.isloading
|
return historyCaptainController.isloading
|
||||||
? const MyCircularProgressIndicator()
|
? const Center(
|
||||||
: SingleChildScrollView(
|
child: CupertinoActivityIndicator(),
|
||||||
child: Center(
|
)
|
||||||
child: Column(
|
: CupertinoScrollbar(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
child: SingleChildScrollView(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
child: Padding(
|
||||||
children: [
|
padding: const EdgeInsets.all(8.0),
|
||||||
Container(
|
child: Column(
|
||||||
width: Get.width * .8,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
decoration: BoxDecoration(
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
border: Border.all(
|
children: [
|
||||||
color: AppColor.blueColor, width: 2)),
|
const SizedBox(
|
||||||
child: TextButton(
|
height: 20,
|
||||||
|
),
|
||||||
|
CupertinoButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
String mapUrl =
|
String mapUrl =
|
||||||
'https://www.google.com/maps/dir/${res['start_location']}/${res['end_location']}/';
|
'https://www.google.com/maps/dir/${res['start_location']}/${res['end_location']}/';
|
||||||
showInBrowser(mapUrl);
|
showInBrowser(mapUrl);
|
||||||
},
|
},
|
||||||
child: Column(
|
child: Container(
|
||||||
children: [
|
width: MediaQuery.of(context).size.width * 0.9,
|
||||||
SizedBox(
|
padding: const EdgeInsets.all(12.0),
|
||||||
height: Get.height * .2,
|
decoration: BoxDecoration(
|
||||||
width: Get.width * .75,
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
child: GoogleMap(
|
border: Border.all(
|
||||||
initialCameraPosition: CameraPosition(
|
color: CupertinoColors.activeBlue,
|
||||||
target: Get.find<LocationController>()
|
width: 2),
|
||||||
.myLocation, // Assuming passenger location is available
|
),
|
||||||
tilt: 80, zoom: 13,
|
child: Column(
|
||||||
),
|
children: [
|
||||||
zoomControlsEnabled: true,
|
const SizedBox(
|
||||||
// liteModeEnabled: true,
|
height: 20,
|
||||||
polylines: {
|
|
||||||
Polyline(
|
|
||||||
zIndex: 2,
|
|
||||||
consumeTapEvents: true,
|
|
||||||
geodesic: true,
|
|
||||||
endCap: Cap.buttCap,
|
|
||||||
startCap: Cap.buttCap,
|
|
||||||
visible: true,
|
|
||||||
polylineId: const PolylineId('route'),
|
|
||||||
points: [
|
|
||||||
LatLng(
|
|
||||||
double.parse(res['start_location']
|
|
||||||
.toString()
|
|
||||||
.split(',')[0]),
|
|
||||||
double.parse(res['start_location']
|
|
||||||
.toString()
|
|
||||||
.split(',')[1]),
|
|
||||||
),
|
|
||||||
LatLng(
|
|
||||||
double.parse(res['end_location']
|
|
||||||
.toString()
|
|
||||||
.split(',')[0]),
|
|
||||||
double.parse(res['end_location']
|
|
||||||
.toString()
|
|
||||||
.split(',')[1]),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
color: AppColor.primaryColor,
|
|
||||||
width: 5,
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
),
|
SizedBox(
|
||||||
const SizedBox(
|
height: MediaQuery.of(context).size.height *
|
||||||
height: 10,
|
0.3,
|
||||||
),
|
child: GoogleMap(
|
||||||
Row(
|
initialCameraPosition: CameraPosition(
|
||||||
mainAxisAlignment:
|
target: Get.find<LocationController>()
|
||||||
MainAxisAlignment.spaceEvenly,
|
.myLocation,
|
||||||
children: [
|
tilt: 80,
|
||||||
Text(
|
zoom: 13,
|
||||||
'${'Order ID'.tr} ${res['id']}',
|
),
|
||||||
style: AppStyle.title,
|
zoomControlsEnabled: true,
|
||||||
|
polylines: {
|
||||||
|
Polyline(
|
||||||
|
polylineId: const PolylineId('route'),
|
||||||
|
points: [
|
||||||
|
LatLng(
|
||||||
|
double.parse(res['start_location']
|
||||||
|
.toString()
|
||||||
|
.split(',')[0]),
|
||||||
|
double.parse(res['start_location']
|
||||||
|
.toString()
|
||||||
|
.split(',')[1]),
|
||||||
|
),
|
||||||
|
LatLng(
|
||||||
|
double.parse(res['end_location']
|
||||||
|
.toString()
|
||||||
|
.split(',')[0]),
|
||||||
|
double.parse(res['end_location']
|
||||||
|
.toString()
|
||||||
|
.split(',')[1]),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
color: CupertinoColors.activeGreen,
|
||||||
|
width: 5,
|
||||||
|
),
|
||||||
|
},
|
||||||
),
|
),
|
||||||
Text(
|
),
|
||||||
res['date'].toString(),
|
const SizedBox(height: 10),
|
||||||
style: AppStyle.title,
|
Row(
|
||||||
),
|
mainAxisAlignment:
|
||||||
],
|
MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'${'Order ID'.tr} ${res['id']}',
|
||||||
|
style: CupertinoTheme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.navActionTextStyle,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
res['date'].toString(),
|
||||||
|
style: CupertinoTheme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.navActionTextStyle,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
Container(
|
||||||
|
width: MediaQuery.of(context).size.width * 0.9,
|
||||||
|
padding: const EdgeInsets.all(12.0),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
|
border: Border.all(
|
||||||
|
color: CupertinoColors.activeGreen, width: 2),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'${'Price is'.tr} ${res['price_for_driver']}',
|
||||||
|
style: CupertinoTheme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.textStyle,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'${'Distance is'.tr} ${res['distance']} KM',
|
||||||
|
style: CupertinoTheme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.textStyle,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(height: 20),
|
||||||
const SizedBox(
|
Text(
|
||||||
height: 10,
|
'Times of Trip'.tr,
|
||||||
),
|
style: CupertinoTheme.of(context)
|
||||||
Container(
|
.textTheme
|
||||||
width: Get.width * .8,
|
.navTitleTextStyle,
|
||||||
decoration: BoxDecoration(
|
|
||||||
border: Border.all(
|
|
||||||
color: AppColor.greenColor, width: 2)),
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
'${'Price is'.tr} ${res['price_for_driver']}',
|
|
||||||
style: AppStyle.title,
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
'${'Distance is'.tr} ${res['distance']} KM',
|
|
||||||
style: AppStyle.title,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(height: 10),
|
||||||
const SizedBox(
|
Container(
|
||||||
height: 10,
|
width: MediaQuery.of(context).size.width * 0.9,
|
||||||
),
|
padding: const EdgeInsets.all(12.0),
|
||||||
Text(
|
decoration: BoxDecoration(
|
||||||
'Times of Trip'.tr,
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
style: AppStyle.title,
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 10,
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
width: Get.width * .8,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: AppColor.redColor, width: 2)),
|
color: CupertinoColors.destructiveRed,
|
||||||
child: Column(
|
width: 2),
|
||||||
children: [
|
),
|
||||||
Text(
|
child: Column(
|
||||||
'${'Time to Passenger is'.tr} ${res['DriverIsGoingToPassenger']}',
|
children: [
|
||||||
style: AppStyle.title,
|
Text(
|
||||||
),
|
'${'Time to Passenger is'.tr} ${res['DriverIsGoingToPassenger']}',
|
||||||
Text(
|
style: CupertinoTheme.of(context)
|
||||||
'${'TimeStart is'.tr} ${res['rideTimeStart']}',
|
.textTheme
|
||||||
style: AppStyle.title,
|
.textStyle,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
'${'Time Finish is'.tr} ${res['rideTimeFinish']}',
|
'${'TimeStart is'.tr} ${res['rideTimeStart']}',
|
||||||
style: AppStyle.title,
|
style: CupertinoTheme.of(context)
|
||||||
),
|
.textTheme
|
||||||
],
|
.textStyle,
|
||||||
),
|
),
|
||||||
),
|
Text(
|
||||||
const SizedBox(
|
'${'Time Finish is'.tr} ${res['rideTimeFinish']}',
|
||||||
height: 10,
|
style: CupertinoTheme.of(context)
|
||||||
),
|
.textTheme
|
||||||
Container(
|
.textStyle,
|
||||||
width: Get.width * .8,
|
),
|
||||||
decoration: BoxDecoration(
|
],
|
||||||
border: Border.all(
|
|
||||||
color: AppColor.greenColor, width: 2)),
|
|
||||||
child: Center(
|
|
||||||
child: Text(
|
|
||||||
'${'Passenger Name is'.tr} ${res['first_name']} ${res['last_name']} ',
|
|
||||||
style: AppStyle.title,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(height: 20),
|
||||||
const SizedBox(
|
Container(
|
||||||
height: 10,
|
width: MediaQuery.of(context).size.width * 0.9,
|
||||||
),
|
padding: const EdgeInsets.all(12.0),
|
||||||
Container(
|
decoration: BoxDecoration(
|
||||||
width: Get.width * .8,
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
decoration: BoxDecoration(
|
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: AppColor.yellowColor, width: 2)),
|
color: CupertinoColors.systemGreen, width: 2),
|
||||||
child: Center(
|
),
|
||||||
child: Text(
|
child: Center(
|
||||||
'${'Status is'.tr} ${res['status']}',
|
child: Text(
|
||||||
style: AppStyle.title,
|
'${'Passenger Name is'.tr} ${res['first_name']} ${res['last_name']}',
|
||||||
|
style: CupertinoTheme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.textStyle,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(height: 20),
|
||||||
],
|
Container(
|
||||||
|
width: MediaQuery.of(context).size.width * 0.9,
|
||||||
|
padding: const EdgeInsets.all(12.0),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
|
border: Border.all(
|
||||||
|
color: CupertinoColors.systemYellow,
|
||||||
|
width: 2),
|
||||||
|
),
|
||||||
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
'${'Status is'.tr} ${res['status']}',
|
||||||
|
style: CupertinoTheme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.textStyle,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
})
|
},
|
||||||
],
|
),
|
||||||
isleading: true,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import 'package:SEFER/constant/api_key.dart';
|
import 'package:SEFER/constant/api_key.dart';
|
||||||
import 'package:SEFER/constant/links.dart';
|
import 'package:SEFER/constant/links.dart';
|
||||||
import 'package:SEFER/constant/style.dart';
|
|
||||||
import 'package:SEFER/controller/home/captin/home_captain_controller.dart';
|
import 'package:SEFER/controller/home/captin/home_captain_controller.dart';
|
||||||
import 'package:SEFER/views/auth/captin/contact_us_page.dart';
|
import 'package:SEFER/views/auth/captin/contact_us_page.dart';
|
||||||
import 'package:SEFER/views/auth/captin/invite_driver_screen.dart';
|
import 'package:SEFER/views/auth/captin/invite_driver_screen.dart';
|
||||||
@@ -9,7 +8,6 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
|
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:SEFER/constant/box_name.dart';
|
import 'package:SEFER/constant/box_name.dart';
|
||||||
import 'package:SEFER/constant/colors.dart';
|
|
||||||
import 'package:SEFER/main.dart';
|
import 'package:SEFER/main.dart';
|
||||||
import 'package:SEFER/views/auth/captin/logout_captain.dart';
|
import 'package:SEFER/views/auth/captin/logout_captain.dart';
|
||||||
import 'package:SEFER/views/home/Captin/history/history_captain.dart';
|
import 'package:SEFER/views/home/Captin/history/history_captain.dart';
|
||||||
@@ -19,98 +17,97 @@ import 'package:SEFER/views/home/my_wallet/walet_captain.dart';
|
|||||||
import 'package:SEFER/views/home/profile/profile_captain.dart';
|
import 'package:SEFER/views/home/profile/profile_captain.dart';
|
||||||
import 'package:SEFER/views/notification/notification_captain.dart';
|
import 'package:SEFER/views/notification/notification_captain.dart';
|
||||||
|
|
||||||
|
import '../../../../constant/colors.dart';
|
||||||
import '../../../../controller/functions/upload_image.dart';
|
import '../../../../controller/functions/upload_image.dart';
|
||||||
import '../maintain_center_page.dart';
|
import '../maintain_center_page.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
|
||||||
class DrawerCaptain extends StatelessWidget {
|
class CupertinoDrawerCaptain extends StatelessWidget {
|
||||||
ImageController imageController = Get.put(ImageController());
|
final ImageController imageController = Get.put(ImageController());
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Drawer(
|
return CupertinoPageScaffold(
|
||||||
child: ListView(
|
navigationBar: CupertinoNavigationBar(
|
||||||
padding: EdgeInsets.zero,
|
middle: Text('Menu'.tr),
|
||||||
children: [
|
),
|
||||||
const UserAccountHeader(),
|
child: SafeArea(
|
||||||
_buildDivider(),
|
child: CustomScrollView(
|
||||||
_buildDrawerItem(
|
slivers: [
|
||||||
icon: Icons.account_balance_wallet,
|
const SliverToBoxAdapter(child: const UserAccountHeader()),
|
||||||
text: 'Wallet'.tr,
|
SliverList(
|
||||||
onTap: () =>
|
delegate: SliverChildListDelegate([
|
||||||
Get.to(() => WalletCaptain(), transition: Transition.native),
|
_buildDivider(),
|
||||||
),
|
_buildDrawerItem(
|
||||||
_buildDivider(),
|
icon: CupertinoIcons.money_dollar,
|
||||||
_buildDrawerItem(
|
text: 'Wallet'.tr,
|
||||||
icon: Icons.person,
|
onTap: () => Get.to(() => WalletCaptain()),
|
||||||
text: 'Profile'.tr,
|
),
|
||||||
onTap: () => Get.to(() => ProfileCaptain(),
|
_buildDivider(),
|
||||||
transition: Transition.rightToLeftWithFade),
|
_buildDrawerItem(
|
||||||
),
|
icon: CupertinoIcons.person,
|
||||||
_buildDivider(),
|
text: 'Profile'.tr,
|
||||||
_buildDrawerItem(
|
onTap: () => Get.to(() => ProfileCaptain()),
|
||||||
icon: Icons.history,
|
),
|
||||||
text: 'History of Trip'.tr,
|
_buildDivider(),
|
||||||
onTap: () => Get.to(() => const HistoryCaptain(),
|
_buildDrawerItem(
|
||||||
transition: Transition.downToUp),
|
icon: CupertinoIcons.clock,
|
||||||
),
|
text: 'History of Trip'.tr,
|
||||||
_buildDivider(),
|
onTap: () => Get.to(() => const HistoryCaptain()),
|
||||||
_buildDrawerItem(
|
),
|
||||||
icon: Icons.phonelink_ring_rounded,
|
_buildDivider(),
|
||||||
text: 'Available for rides'.tr,
|
_buildDrawerItem(
|
||||||
onTap: () => Get.to(() => const AvailableRidesPage(),
|
icon: CupertinoIcons.car_detailed,
|
||||||
transition: Transition.rightToLeftWithFade),
|
text: 'Available for rides'.tr,
|
||||||
),
|
onTap: () => Get.to(() => const AvailableRidesPage()),
|
||||||
_buildDivider(),
|
),
|
||||||
_buildDrawerItem(
|
_buildDivider(),
|
||||||
icon: Icons.notifications,
|
_buildDrawerItem(
|
||||||
text: 'Notifications'.tr,
|
icon: CupertinoIcons.bell,
|
||||||
onTap: () => Get.to(() => const NotificationCaptain(),
|
text: 'Notifications'.tr,
|
||||||
transition: Transition.upToDown),
|
onTap: () => Get.to(() => const NotificationCaptain()),
|
||||||
),
|
),
|
||||||
_buildDivider(),
|
_buildDivider(),
|
||||||
_buildDrawerItem(
|
_buildDrawerItem(
|
||||||
icon: Icons.help,
|
icon: CupertinoIcons.question_circle,
|
||||||
text: 'Helping Center'.tr,
|
text: 'Helping Center'.tr,
|
||||||
onTap: () =>
|
onTap: () => Get.to(() => HelpCaptain()),
|
||||||
Get.to(() => HelpCaptain(), transition: Transition.size),
|
),
|
||||||
),
|
_buildDivider(),
|
||||||
_buildDivider(),
|
_buildDrawerItem(
|
||||||
_buildDrawerItem(
|
icon: CupertinoIcons.share,
|
||||||
icon: Icons.share_outlined,
|
text: 'Share App'.tr,
|
||||||
text: 'Share App'.tr,
|
onTap: () => Get.to(() => InviteDriverScreen()),
|
||||||
onTap: () =>
|
),
|
||||||
Get.to(() => InviteDriverScreen(), transition: Transition.size),
|
_buildDivider(),
|
||||||
),
|
_buildDrawerItem(
|
||||||
_buildDivider(),
|
icon: CupertinoIcons.wrench,
|
||||||
_buildDrawerItem(
|
text: "Maintenance Center".tr,
|
||||||
icon: Icons.car_repair_outlined,
|
onTap: () => Get.to(() => MaintainCenterPage()),
|
||||||
text: "Maintenance Center".tr,
|
),
|
||||||
onTap: () =>
|
_buildDivider(),
|
||||||
Get.to(() => MaintainCenterPage(), transition: Transition.size),
|
_buildDrawerItem(
|
||||||
),
|
icon: CupertinoIcons.mail,
|
||||||
_buildDivider(),
|
text: "Contact Us".tr,
|
||||||
_buildDrawerItem(
|
onTap: () => Get.to(() => ContactUsPage()),
|
||||||
icon: Icons.contact_mail_rounded,
|
),
|
||||||
text: "Contact Us".tr,
|
_buildDivider(),
|
||||||
onTap: () =>
|
_buildDrawerItem(
|
||||||
Get.to(() => ContactUsPage(), transition: Transition.cupertino),
|
icon: CupertinoIcons.settings,
|
||||||
),
|
text: 'Settings'.tr,
|
||||||
_buildDivider(),
|
onTap: () => Get.to(() => const SettingsCaptain()),
|
||||||
_buildDrawerItem(
|
),
|
||||||
icon: Icons.settings,
|
_buildDivider(),
|
||||||
text: 'Settings'.tr,
|
_buildDrawerItem(
|
||||||
onTap: () => Get.to(() => const SettingsCaptain(),
|
icon: CupertinoIcons.square_arrow_right,
|
||||||
transition: Transition.cupertino),
|
text: 'Sign Out'.tr,
|
||||||
),
|
onTap: () => Get.to(() => const LogoutCaptain()),
|
||||||
_buildDivider(),
|
),
|
||||||
_buildDrawerItem(
|
_buildDivider(),
|
||||||
icon: Icons.exit_to_app,
|
]),
|
||||||
text: 'Sign Out'.tr,
|
),
|
||||||
onTap: () => Get.to(() => const LogoutCaptain(),
|
],
|
||||||
transition: Transition.cupertinoDialog),
|
),
|
||||||
),
|
|
||||||
_buildDivider(),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -119,19 +116,27 @@ class DrawerCaptain extends StatelessWidget {
|
|||||||
return const Divider(
|
return const Divider(
|
||||||
thickness: 1,
|
thickness: 1,
|
||||||
height: 1,
|
height: 1,
|
||||||
color: AppColor.accentColor,
|
color: CupertinoColors.systemGrey4,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildDrawerItem({
|
Widget _buildDrawerItem({
|
||||||
required IconData icon,
|
required IconData icon,
|
||||||
required String text,
|
required String text,
|
||||||
required GestureTapCallback onTap,
|
required VoidCallback onTap,
|
||||||
}) {
|
}) {
|
||||||
return ListTile(
|
return CupertinoButton(
|
||||||
leading: Icon(icon, color: AppColor.accentColor),
|
onPressed: onTap,
|
||||||
title: Text(text, style: AppStyle.title),
|
child: Row(
|
||||||
onTap: onTap,
|
children: [
|
||||||
|
Icon(icon, color: CupertinoColors.activeBlue),
|
||||||
|
const SizedBox(width: 10),
|
||||||
|
Text(text, style: const TextStyle(color: CupertinoColors.label)),
|
||||||
|
const Spacer(),
|
||||||
|
const Icon(CupertinoIcons.right_chevron,
|
||||||
|
color: CupertinoColors.systemGrey),
|
||||||
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -141,90 +146,102 @@ class UserAccountHeader extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return UserAccountsDrawerHeader(
|
return Container(
|
||||||
decoration: BoxDecoration(
|
padding: const EdgeInsets.all(16),
|
||||||
color: AppColor.greenColor,
|
decoration: const BoxDecoration(
|
||||||
gradient: LinearGradient(
|
gradient: LinearGradient(
|
||||||
colors: AppColor.gradientStartEnd,
|
colors: [AppColor.blueColor, AppColor.twitterColor],
|
||||||
begin: Alignment.topLeft,
|
begin: Alignment.topLeft,
|
||||||
end: Alignment.bottomRight,
|
end: Alignment.bottomRight,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
currentAccountPictureSize: const Size.square(100),
|
child: Column(
|
||||||
arrowColor: AppColor.deepPurpleAccent,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
accountName: Padding(
|
children: [
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
GetBuilder<ImageController>(
|
||||||
child: Row(
|
builder: (imageController) {
|
||||||
children: [
|
return Stack(
|
||||||
Text(
|
children: [
|
||||||
box.read(BoxName.nameDriver).toString(),
|
imageController.isloading
|
||||||
style: AppStyle.title.copyWith(color: AppColor.secondaryColor),
|
? const CupertinoActivityIndicator()
|
||||||
),
|
: Container(
|
||||||
const Spacer(),
|
width: 100,
|
||||||
Column(
|
height: 100,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
decoration: BoxDecoration(
|
||||||
children: [
|
shape: BoxShape.circle,
|
||||||
Text(
|
image: DecorationImage(
|
||||||
Get.find<HomeCaptainController>().rating.toString(),
|
fit: BoxFit.cover,
|
||||||
style: AppStyle.number.copyWith(color: Colors.amber),
|
image: NetworkImage(
|
||||||
),
|
'${AK.serverPHP}/portrate_captain_image/${box.read(BoxName.driverID)}.jpg',
|
||||||
Container(
|
),
|
||||||
padding:
|
),
|
||||||
const EdgeInsets.symmetric(horizontal: 4, vertical: 1),
|
),
|
||||||
color: AppColor.greenColor,
|
),
|
||||||
child: RatingBar.builder(
|
Positioned(
|
||||||
initialRating: double.parse(
|
right: 0,
|
||||||
Get.find<HomeCaptainController>().rating.toString()),
|
top: 0,
|
||||||
minRating: 1,
|
child: CupertinoButton(
|
||||||
direction: Axis.horizontal,
|
onPressed: () {
|
||||||
itemCount: 5,
|
imageController.choosImagePicture(
|
||||||
itemSize: 20,
|
AppLink.uploadImage1, 'portrait');
|
||||||
itemPadding: const EdgeInsets.symmetric(horizontal: 2),
|
},
|
||||||
itemBuilder: (context, _) => const Icon(
|
child: const Icon(CupertinoIcons.pencil_circle_fill,
|
||||||
Icons.star,
|
color: CupertinoColors.white),
|
||||||
color: Colors.amber,
|
|
||||||
),
|
|
||||||
onRatingUpdate: (rating) {},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
accountEmail: Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
|
||||||
child: Text(
|
|
||||||
box.read(BoxName.emailDriver),
|
|
||||||
style: AppStyle.title.copyWith(color: AppColor.secondaryColor),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
currentAccountPicture:
|
|
||||||
GetBuilder<ImageController>(builder: (imageController) {
|
|
||||||
return Stack(
|
|
||||||
children: [
|
|
||||||
imageController.isloading
|
|
||||||
? const CircularProgressIndicator()
|
|
||||||
: CircleAvatar(
|
|
||||||
radius: 45,
|
|
||||||
backgroundImage: NetworkImage(
|
|
||||||
'${AK.serverPHP}/portrate_captain_image/${box.read(BoxName.driverID)}.jpg',
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Positioned(
|
],
|
||||||
right: 0,
|
);
|
||||||
top: 0,
|
},
|
||||||
child: IconButton(
|
),
|
||||||
onPressed: () {
|
const SizedBox(height: 10),
|
||||||
imageController.choosImagePicture(
|
Text(
|
||||||
AppLink.uploadImage1, 'portrait');
|
box.read(BoxName.nameDriver).toString(),
|
||||||
},
|
style: const TextStyle(
|
||||||
icon: const Icon(Icons.edit),
|
color: CupertinoColors.white,
|
||||||
|
fontSize: 18,
|
||||||
|
fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 5),
|
||||||
|
Text(
|
||||||
|
box.read(BoxName.emailDriver),
|
||||||
|
style: const TextStyle(color: CupertinoColors.white, fontSize: 14),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
Get.find<HomeCaptainController>().rating.toString(),
|
||||||
|
style: const TextStyle(
|
||||||
|
color: CupertinoColors.systemYellow, fontSize: 16),
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(width: 5),
|
||||||
],
|
// You might want to replace this with a Cupertino-style rating widget
|
||||||
);
|
// For now, we'll use text to represent stars
|
||||||
}),
|
// const Text('★★★★★',
|
||||||
|
// style: TextStyle(color: CupertinoColors.systemYellow)),
|
||||||
|
|
||||||
|
Container(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 4, vertical: 1),
|
||||||
|
color: AppColor.greenColor,
|
||||||
|
child: RatingBar.builder(
|
||||||
|
initialRating: double.parse(
|
||||||
|
Get.find<HomeCaptainController>().rating.toString()),
|
||||||
|
minRating: 1,
|
||||||
|
direction: Axis.horizontal,
|
||||||
|
itemCount: 5,
|
||||||
|
itemSize: 20,
|
||||||
|
itemPadding: const EdgeInsets.symmetric(horizontal: 2),
|
||||||
|
itemBuilder: (context, _) => const Icon(
|
||||||
|
Icons.star,
|
||||||
|
color: Colors.amber,
|
||||||
|
),
|
||||||
|
onRatingUpdate: (rating) {},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,9 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:SEFER/constant/colors.dart';
|
|
||||||
import 'package:SEFER/constant/style.dart';
|
|
||||||
import 'package:SEFER/controller/home/captin/help/help_controller.dart';
|
import 'package:SEFER/controller/home/captin/help/help_controller.dart';
|
||||||
import 'package:SEFER/views/home/Captin/home_captain/help_details_replay_page.dart';
|
import 'package:SEFER/views/home/Captin/home_captain/help_details_replay_page.dart';
|
||||||
import 'package:SEFER/views/widgets/my_scafold.dart';
|
|
||||||
|
|
||||||
import '../../../widgets/elevated_btn.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import '../../../widgets/mycircular.dart';
|
|
||||||
|
|
||||||
class HelpCaptain extends StatelessWidget {
|
class HelpCaptain extends StatelessWidget {
|
||||||
HelpCaptain({super.key});
|
HelpCaptain({super.key});
|
||||||
@@ -15,152 +11,159 @@ class HelpCaptain extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
Get.put(HelpController());
|
Get.put(HelpController());
|
||||||
return MyScafolld(
|
return CupertinoPageScaffold(
|
||||||
title: 'Helping Page'.tr,
|
navigationBar: CupertinoNavigationBar(
|
||||||
body: [
|
middle: Text('Helping Page'.tr),
|
||||||
Column(
|
leading: CupertinoButton(
|
||||||
children: [
|
padding: EdgeInsets.zero,
|
||||||
Padding(
|
child: Icon(CupertinoIcons.back),
|
||||||
padding: const EdgeInsets.all(8.0),
|
onPressed: () => Navigator.pop(context),
|
||||||
child: Container(
|
),
|
||||||
decoration: AppStyle.boxDecoration1,
|
),
|
||||||
child: Padding(
|
child: SafeArea(
|
||||||
padding: const EdgeInsets.all(8.0),
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(16.0),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 12.0),
|
||||||
|
child: Container(
|
||||||
|
padding: const EdgeInsets.all(16.0),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
|
border: Border.all(
|
||||||
|
color: CupertinoColors.systemGrey2,
|
||||||
|
),
|
||||||
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
'If you need any help or have question this is right site to do that and your welcome'
|
'If you need any help or have questions, this is the right place to do that. You are welcome!'
|
||||||
.tr,
|
.tr,
|
||||||
style: AppStyle.title,
|
style: CupertinoTheme.of(context).textTheme.textStyle,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
Card(
|
||||||
Card(
|
|
||||||
elevation: 3,
|
elevation: 3,
|
||||||
color: AppColor.secondaryColor,
|
color: CupertinoColors.systemGrey6,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
|
),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(16.0),
|
||||||
child: GetBuilder<HelpController>(
|
child: GetBuilder<HelpController>(
|
||||||
builder: (helpController) => Form(
|
builder: (helpController) => Form(
|
||||||
key: helpController.formKey,
|
key: helpController.formKey,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
CupertinoTextField(
|
||||||
width: Get.width * .8,
|
controller: helpController.helpQuestionController,
|
||||||
child: TextFormField(
|
placeholder: 'Enter your Question here'.tr,
|
||||||
controller:
|
decoration: BoxDecoration(
|
||||||
helpController.helpQuestionController,
|
borderRadius: BorderRadius.circular(12),
|
||||||
decoration: InputDecoration(
|
border: Border.all(
|
||||||
border: const OutlineInputBorder(),
|
color: CupertinoColors.systemGrey,
|
||||||
hintText: 'Enter your Question here'.tr,
|
|
||||||
labelText: 'Question'.tr,
|
|
||||||
),
|
|
||||||
validator: (value) {
|
|
||||||
if (value == null || value.isEmpty) {
|
|
||||||
return 'Please enter your Question.'.tr;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
padding: const EdgeInsets.all(16),
|
||||||
helpController.isLoading
|
clearButtonMode: OverlayVisibilityMode.editing,
|
||||||
? const MyCircularProgressIndicator()
|
),
|
||||||
: MyElevatedButton(
|
const SizedBox(height: 20),
|
||||||
onPressed: () {
|
helpController.isLoading
|
||||||
if (helpController.formKey.currentState!
|
? const CupertinoActivityIndicator()
|
||||||
.validate()) {
|
: CupertinoButton.filled(
|
||||||
helpController.addHelpQuestion();
|
onPressed: () {
|
||||||
|
if (helpController.formKey.currentState!
|
||||||
|
.validate()) {
|
||||||
|
helpController.addHelpQuestion();
|
||||||
|
|
||||||
// Clear the feedback form
|
// Clear the feedback form
|
||||||
helpController.formKey.currentState!
|
helpController.formKey.currentState!
|
||||||
.reset();
|
.reset();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
title: 'Submit Question'.tr,
|
child: Text('Submit Question'.tr),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)),
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
)),
|
),
|
||||||
GetBuilder<HelpController>(
|
),
|
||||||
builder: (helpController) => Padding(
|
const SizedBox(height: 20),
|
||||||
padding: const EdgeInsets.all(10),
|
Expanded(
|
||||||
child: Container(
|
child: GetBuilder<HelpController>(
|
||||||
height: Get.height * .45,
|
builder: (helpController) => Padding(
|
||||||
decoration: AppStyle.boxDecoration,
|
padding: const EdgeInsets.all(10),
|
||||||
child: ListView.builder(
|
child: Container(
|
||||||
itemCount:
|
decoration: BoxDecoration(
|
||||||
helpController.helpQuestionDate['message'] != null
|
border: Border.all(
|
||||||
? helpController
|
color: CupertinoColors.systemGrey2,
|
||||||
.helpQuestionDate['message'].length
|
),
|
||||||
: 0,
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
itemBuilder: (BuildContext context, int index) {
|
),
|
||||||
// if (helpController.helpQuestionDate['message'] ==
|
child: ListView.builder(
|
||||||
// null) {
|
itemCount: helpController.helpQuestionDate['message'] !=
|
||||||
// return const CircularProgressIndicator();
|
null
|
||||||
// }
|
? helpController.helpQuestionDate['message'].length
|
||||||
var list = helpController
|
: 0,
|
||||||
.helpQuestionDate['message'][index];
|
itemBuilder: (BuildContext context, int index) {
|
||||||
return helpController
|
var list =
|
||||||
.helpQuestionDate['message'].length ==
|
helpController.helpQuestionDate['message'][index];
|
||||||
0
|
return Padding(
|
||||||
? SizedBox()
|
padding: const EdgeInsets.all(3),
|
||||||
: Padding(
|
child: Container(
|
||||||
padding: const EdgeInsets.all(3),
|
padding: const EdgeInsets.symmetric(
|
||||||
child: Container(
|
vertical: 12, horizontal: 16),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: AppColor.greenColor,
|
color: CupertinoColors.activeGreen,
|
||||||
width: 3,
|
width: 2,
|
||||||
),
|
),
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(12),
|
||||||
BorderRadius.circular(11)),
|
),
|
||||||
// elevation: 3,
|
child: GestureDetector(
|
||||||
// color: AppColor.greenColor,
|
onTap: () {
|
||||||
child: GestureDetector(
|
helpController.getIndex(
|
||||||
onTap: () {
|
list['id'], list['helpQuestion']);
|
||||||
helpController.getIndex(
|
helpController
|
||||||
list['id'], list['helpQuestion']);
|
.getHelpRepley(list['id'].toString());
|
||||||
helpController.getHelpRepley(
|
Get.to(() => const HelpDetailsReplayPage());
|
||||||
list['id'].toString());
|
},
|
||||||
Get.to(
|
child: Row(
|
||||||
() => const HelpDetailsReplayPage(),
|
mainAxisAlignment:
|
||||||
);
|
MainAxisAlignment.spaceBetween,
|
||||||
},
|
children: [
|
||||||
child: Padding(
|
Expanded(
|
||||||
padding: const EdgeInsets.all(2),
|
child: Text(
|
||||||
child: Row(
|
list['helpQuestion'],
|
||||||
mainAxisAlignment:
|
style: CupertinoTheme.of(context)
|
||||||
MainAxisAlignment.spaceBetween,
|
.textTheme
|
||||||
children: [
|
.textStyle,
|
||||||
SizedBox(
|
overflow: TextOverflow.ellipsis,
|
||||||
width: Get.width * .6,
|
|
||||||
child: Text(
|
|
||||||
list['helpQuestion'],
|
|
||||||
style: AppStyle.title,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
width: Get.width * .3,
|
|
||||||
child: Text(
|
|
||||||
list['datecreated'],
|
|
||||||
style: AppStyle.subtitle,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
Text(
|
||||||
},
|
list['datecreated'],
|
||||||
),
|
style: CupertinoTheme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.tabLabelTextStyle,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
)),
|
),
|
||||||
],
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
isleading: true,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ class HomeCaptain extends StatelessWidget {
|
|||||||
// ),
|
// ),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
drawer: DrawerCaptain(),
|
drawer: CupertinoDrawerCaptain(),
|
||||||
body: Stack(
|
body: Stack(
|
||||||
children: [
|
children: [
|
||||||
GetBuilder<HomeCaptainController>(
|
GetBuilder<HomeCaptainController>(
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:SEFER/constant/box_name.dart';
|
import 'package:SEFER/constant/box_name.dart';
|
||||||
|
import 'package:SEFER/controller/firebase/local_notification.dart';
|
||||||
import 'package:SEFER/main.dart';
|
import 'package:SEFER/main.dart';
|
||||||
import 'package:SEFER/views/auth/captin/cards/egypt_card_a_i.dart';
|
import 'package:SEFER/views/auth/captin/cards/egypt_card_a_i.dart';
|
||||||
import 'package:SEFER/views/auth/captin/cards/sms_signup.dart';
|
import 'package:SEFER/views/auth/captin/cards/sms_signup.dart';
|
||||||
@@ -219,13 +220,14 @@ GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
|
|||||||
// 'Order'.tr,
|
// 'Order'.tr,
|
||||||
// 'from: ',
|
// 'from: ',
|
||||||
// // jsonDecode(value)['message'].toString(),
|
// // jsonDecode(value)['message'].toString(),
|
||||||
// // 'd3JaCCFAQeu8QTxRnlC1sB:APA91bFuRjbVK32obIFYXFTI4iwsZEPrrgwvPouob2bXivID-W4aXz51J_OIJ2nHpNU2ocOvGLD1Ip65rLViAFx5qHVE-c8FabBwBi5fSQ-lDTQfe36xxKsc9DU-sTyj_FoYrrMnLNVi',
|
// 'dUEVBJDPQfKiMuGgDjdyfX:APA91bE3DKYAYs3LIxGmzy55-ojLAZWv0ym4a9Zy9UxdkyRUOgQP8bf1WwU9LJAof0DjfaIxciVYPnue7EdwhujzQe67SImfOF9yI1YgGsKLDH6yo6FsFaAYpsbrSCqlaoRp14lLqymi',
|
||||||
// 'dN7B10MgQKOR13R5wnBqTN:APA91bHAlcfrOhxXdMYB8akJeeJzQ4lxfx7UhOpP0dcjGtRdKXSD9x6jiEoz6ULnQK5Hc030_VRUAV6Q8qGj-RmlbLAm4wppc4gv_Ri4oEbHHwONP5c41-341YkVqsFYTCRaHz7VpUoj',
|
|
||||||
// d,
|
// d,
|
||||||
// 'order.wav');
|
// 'order.wav');
|
||||||
// try {} catch (e) {
|
// // NotificationController()
|
||||||
// print('Error showing overlay: $e');
|
// // .showNotification('VIP Order'.tr, '', 'order', '');
|
||||||
// }
|
// // try {} catch (e) {
|
||||||
|
// // print('Error showing overlay: $e');
|
||||||
|
// // }
|
||||||
// // final Bubble _bubble = Bubble(showCloseButton: true);
|
// // final Bubble _bubble = Bubble(showCloseButton: true);
|
||||||
// // try {
|
// // try {
|
||||||
// // await _bubble.startBubbleHead(sendAppToBackground: false);
|
// // await _bubble.startBubbleHead(sendAppToBackground: false);
|
||||||
@@ -254,7 +256,7 @@ GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
|
|||||||
// );
|
// );
|
||||||
// }),
|
// }),
|
||||||
// ),
|
// ),
|
||||||
// // AnimatedContainer(
|
// AnimatedContainer(
|
||||||
// duration: const Duration(microseconds: 200),
|
// duration: const Duration(microseconds: 200),
|
||||||
// width: controller.widthMapTypeAndTraffic,
|
// width: controller.widthMapTypeAndTraffic,
|
||||||
// decoration: BoxDecoration(
|
// decoration: BoxDecoration(
|
||||||
@@ -264,16 +266,16 @@ GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
|
|||||||
// child: Builder(builder: (context) {
|
// child: Builder(builder: (context) {
|
||||||
// return IconButton(
|
// return IconButton(
|
||||||
// onPressed: () async {
|
// onPressed: () async {
|
||||||
// // FirebaseMessagesController().sendNotificationToAnyWithoutData(
|
// FirebaseMessagesController().sendNotificationToAnyWithoutData(
|
||||||
// // 'Order'.tr,
|
// 'Order'.tr,
|
||||||
// // 'from: ',
|
// 'from: ',
|
||||||
// // // jsonDecode(value)['message'].toString(),
|
// // jsonDecode(value)['message'].toString(),
|
||||||
// // 'dEugS-JOT4Ka5riF4s5TEN:APA91bEDL_W7BuEQGbyL-RMaKiMWDlURXhFuaybe5WurTUV8K5eIooSGe22yY22_U2hEZcfPr46ig1v--l00dbOGiivazxvmTyhUyQQW6lJsuIN-wordGtBxtREyeYtEKvxIa1J4ApEu',
|
// 'dEugS-JOT4Ka5riF4s5TEN:APA91bEDL_W7BuEQGbyL-RMaKiMWDlURXhFuaybe5WurTUV8K5eIooSGe22yY22_U2hEZcfPr46ig1v--l00dbOGiivazxvmTyhUyQQW6lJsuIN-wordGtBxtREyeYtEKvxIa1J4ApEu',
|
||||||
// // 'order.wav'
|
// 'order.wav'
|
||||||
|
|
||||||
// // // polylineCoordinates.toString()
|
// // polylineCoordinates.toString()
|
||||||
// // );
|
// );
|
||||||
// Get.to(SmsSignupEgypt());
|
// // Get.to(SmsSignupEgypt());
|
||||||
// // print(AppLink.addDriverPaymentPoints);
|
// // print(AppLink.addDriverPaymentPoints);
|
||||||
// },
|
// },
|
||||||
// icon: const Icon(
|
// icon: const Icon(
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import 'package:SEFER/controller/notification/ride_available_controller.dart';
|
|||||||
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
||||||
import 'package:SEFER/views/widgets/my_scafold.dart';
|
import 'package:SEFER/views/widgets/my_scafold.dart';
|
||||||
import 'package:SEFER/views/widgets/mycircular.dart';
|
import 'package:SEFER/views/widgets/mycircular.dart';
|
||||||
|
import 'package:SEFER/views/widgets/mydialoug.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
@@ -119,20 +120,26 @@ class AvailableRidesPage extends StatelessWidget {
|
|||||||
// .then((value) {
|
// .then((value) {
|
||||||
// var json = jsonDecode(res);
|
// var json = jsonDecode(res);
|
||||||
if (res == "failure") {
|
if (res == "failure") {
|
||||||
Get.defaultDialog(
|
MyDialog().getDialog(
|
||||||
title:
|
"This ride is already taken by another driver."
|
||||||
"This ride is already taken by another driver."
|
.tr,
|
||||||
.tr,
|
'', () {
|
||||||
middleText: '',
|
Get.back();
|
||||||
titleStyle: AppStyle.title,
|
});
|
||||||
middleTextStyle: AppStyle.title,
|
// Get.defaultDialog(
|
||||||
confirm: MyElevatedButton(
|
// title:
|
||||||
title: 'Ok'.tr,
|
// "This ride is already taken by another driver."
|
||||||
onPressed: () {
|
// .tr,
|
||||||
Get.back();
|
// middleText: '',
|
||||||
// Get.back();
|
// titleStyle: AppStyle.title,
|
||||||
// Get.back();
|
// middleTextStyle: AppStyle.title,
|
||||||
}));
|
// confirm: MyElevatedButton(
|
||||||
|
// title: 'Ok'.tr,
|
||||||
|
// onPressed: () {
|
||||||
|
// Get.back();
|
||||||
|
// // Get.back();
|
||||||
|
// // Get.back();
|
||||||
|
// }));
|
||||||
} else if (jsonDecode(res)['status'] ==
|
} else if (jsonDecode(res)['status'] ==
|
||||||
"success") {
|
"success") {
|
||||||
List<String> bodyToPassenger = [
|
List<String> bodyToPassenger = [
|
||||||
|
|||||||
@@ -1,77 +1,88 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:SEFER/constant/style.dart';
|
|
||||||
import 'package:SEFER/controller/notification/notification_captain_controller.dart';
|
import 'package:SEFER/controller/notification/notification_captain_controller.dart';
|
||||||
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:SEFER/views/widgets/my_scafold.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:SEFER/views/widgets/mycircular.dart';
|
|
||||||
|
|
||||||
class NotificationCaptain extends StatelessWidget {
|
class NotificationCaptain extends StatelessWidget {
|
||||||
const NotificationCaptain({super.key});
|
const NotificationCaptain({Key? key}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
Get.put(NotificationCaptainController());
|
Get.put(NotificationCaptainController());
|
||||||
|
|
||||||
return MyScafolld(
|
return CupertinoPageScaffold(
|
||||||
title: 'Notifications'.tr,
|
navigationBar: CupertinoNavigationBar(
|
||||||
body: [
|
middle: Text('Notifications'.tr),
|
||||||
GetBuilder<NotificationCaptainController>(
|
leading: CupertinoNavigationBarBackButton(
|
||||||
builder: (notificationCaptainController) =>
|
onPressed: () => Get.back(),
|
||||||
notificationCaptainController.isLoading
|
),
|
||||||
? const MyCircularProgressIndicator()
|
),
|
||||||
: SafeArea(
|
child: SafeArea(
|
||||||
child: ListView.builder(
|
child: GetBuilder<NotificationCaptainController>(
|
||||||
itemCount: notificationCaptainController
|
builder: (notificationCaptainController) =>
|
||||||
.notificationData['message'].length,
|
notificationCaptainController.isLoading
|
||||||
itemBuilder: (BuildContext context, int index) {
|
? const Center(child: CupertinoActivityIndicator())
|
||||||
if (notificationCaptainController
|
: ListView.builder(
|
||||||
.notificationData['message'] ==
|
itemCount: notificationCaptainController
|
||||||
"No notification data found") {
|
.notificationData['message'].length,
|
||||||
Get.defaultDialog();
|
itemBuilder: (BuildContext context, int index) {
|
||||||
}
|
if (notificationCaptainController
|
||||||
var res = notificationCaptainController
|
.notificationData['message'] ==
|
||||||
.notificationData['message'][index];
|
"No notification data found") {
|
||||||
return Card(
|
_showCupertinoDialog(context, 'No Notifications',
|
||||||
elevation: 4,
|
'There are no notifications at this time.');
|
||||||
child: ListTile(
|
return const SizedBox.shrink();
|
||||||
onTap: () {
|
}
|
||||||
Get.defaultDialog(
|
var res = notificationCaptainController
|
||||||
title: res['title'],
|
.notificationData['message'][index];
|
||||||
titleStyle: AppStyle.title.copyWith(
|
return CupertinoListTile(
|
||||||
fontWeight: FontWeight.bold),
|
leading: const Icon(CupertinoIcons.bell_fill),
|
||||||
content: SizedBox(
|
title: Text(
|
||||||
width: Get.width * .8,
|
res['title'],
|
||||||
height: Get.height * .4,
|
style:
|
||||||
child: Text(
|
CupertinoTheme.of(context).textTheme.textStyle,
|
||||||
res['body'],
|
),
|
||||||
style: AppStyle.subtitle,
|
subtitle: Text(
|
||||||
),
|
res['body'],
|
||||||
),
|
style: CupertinoTheme.of(context)
|
||||||
confirm: MyElevatedButton(
|
.textTheme
|
||||||
title: 'Ok',
|
.tabLabelTextStyle,
|
||||||
onPressed: () {
|
),
|
||||||
//todo sql readen
|
onTap: () {
|
||||||
notificationCaptainController
|
_showCupertinoDialog(
|
||||||
.updateNotification(res['id']);
|
context,
|
||||||
}));
|
res['title'],
|
||||||
},
|
res['body'],
|
||||||
leading:
|
onConfirm: () {
|
||||||
const Icon(Icons.notification_important),
|
notificationCaptainController
|
||||||
title: Text(
|
.updateNotification(res['id'].toString());
|
||||||
res['title'],
|
Navigator.of(context).pop();
|
||||||
style: AppStyle.title,
|
},
|
||||||
),
|
|
||||||
subtitle: Text(
|
|
||||||
res['body'],
|
|
||||||
style: AppStyle.subtitle,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
);
|
||||||
))
|
},
|
||||||
],
|
),
|
||||||
isleading: true,
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void _showCupertinoDialog(BuildContext context, String title, String content,
|
||||||
|
{VoidCallback? onConfirm}) {
|
||||||
|
showCupertinoDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (BuildContext context) => CupertinoAlertDialog(
|
||||||
|
title: Text(title),
|
||||||
|
content: Text(content),
|
||||||
|
actions: <CupertinoDialogAction>[
|
||||||
|
CupertinoDialogAction(
|
||||||
|
child: const Text('OK'),
|
||||||
|
onPressed: onConfirm ?? () => Navigator.of(context).pop(),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user