11/4/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 = 111
|
versionCode = 113
|
||||||
versionName = '1.5.11'
|
versionName = '1.5.13'
|
||||||
multiDexEnabled =true
|
multiDexEnabled =true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -68,6 +68,13 @@ PODS:
|
|||||||
- Mantle
|
- Mantle
|
||||||
- SDWebImage
|
- SDWebImage
|
||||||
- SDWebImageWebPCoder
|
- SDWebImageWebPCoder
|
||||||
|
- flutter_inappwebview_ios (0.0.1):
|
||||||
|
- Flutter
|
||||||
|
- flutter_inappwebview_ios/Core (= 0.0.1)
|
||||||
|
- OrderedSet (~> 6.0.3)
|
||||||
|
- flutter_inappwebview_ios/Core (0.0.1):
|
||||||
|
- Flutter
|
||||||
|
- OrderedSet (~> 6.0.3)
|
||||||
- flutter_local_notifications (0.0.1):
|
- flutter_local_notifications (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- flutter_secure_storage (6.0.0):
|
- flutter_secure_storage (6.0.0):
|
||||||
@@ -202,6 +209,7 @@ PODS:
|
|||||||
- nanopb/encode (= 2.30910.0)
|
- nanopb/encode (= 2.30910.0)
|
||||||
- nanopb/decode (2.30910.0)
|
- nanopb/decode (2.30910.0)
|
||||||
- nanopb/encode (2.30910.0)
|
- nanopb/encode (2.30910.0)
|
||||||
|
- OrderedSet (6.0.3)
|
||||||
- package_info_plus (0.4.5):
|
- package_info_plus (0.4.5):
|
||||||
- Flutter
|
- Flutter
|
||||||
- path_provider_foundation (0.0.1):
|
- path_provider_foundation (0.0.1):
|
||||||
@@ -275,6 +283,7 @@ PODS:
|
|||||||
- Flutter
|
- Flutter
|
||||||
- webview_flutter_wkwebview (0.0.1):
|
- webview_flutter_wkwebview (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
|
- FlutterMacOS
|
||||||
|
|
||||||
DEPENDENCIES:
|
DEPENDENCIES:
|
||||||
- audio_session (from `.symlinks/plugins/audio_session/ios`)
|
- audio_session (from `.symlinks/plugins/audio_session/ios`)
|
||||||
@@ -287,6 +296,7 @@ DEPENDENCIES:
|
|||||||
- Flutter (from `Flutter`)
|
- Flutter (from `Flutter`)
|
||||||
- flutter_contacts (from `.symlinks/plugins/flutter_contacts/ios`)
|
- flutter_contacts (from `.symlinks/plugins/flutter_contacts/ios`)
|
||||||
- flutter_image_compress_common (from `.symlinks/plugins/flutter_image_compress_common/ios`)
|
- flutter_image_compress_common (from `.symlinks/plugins/flutter_image_compress_common/ios`)
|
||||||
|
- flutter_inappwebview_ios (from `.symlinks/plugins/flutter_inappwebview_ios/ios`)
|
||||||
- flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`)
|
- flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`)
|
||||||
- flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`)
|
- flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`)
|
||||||
- flutter_tts (from `.symlinks/plugins/flutter_tts/ios`)
|
- flutter_tts (from `.symlinks/plugins/flutter_tts/ios`)
|
||||||
@@ -312,7 +322,7 @@ DEPENDENCIES:
|
|||||||
- vibration (from `.symlinks/plugins/vibration/ios`)
|
- vibration (from `.symlinks/plugins/vibration/ios`)
|
||||||
- video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/darwin`)
|
- video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/darwin`)
|
||||||
- wakelock_plus (from `.symlinks/plugins/wakelock_plus/ios`)
|
- wakelock_plus (from `.symlinks/plugins/wakelock_plus/ios`)
|
||||||
- webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/ios`)
|
- webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/darwin`)
|
||||||
|
|
||||||
SPEC REPOS:
|
SPEC REPOS:
|
||||||
trunk:
|
trunk:
|
||||||
@@ -341,6 +351,7 @@ SPEC REPOS:
|
|||||||
- MLKitTextRecognitionCommon
|
- MLKitTextRecognitionCommon
|
||||||
- MLKitVision
|
- MLKitVision
|
||||||
- nanopb
|
- nanopb
|
||||||
|
- OrderedSet
|
||||||
- PromisesObjC
|
- PromisesObjC
|
||||||
- RecaptchaInterop
|
- RecaptchaInterop
|
||||||
- SDWebImage
|
- SDWebImage
|
||||||
@@ -376,6 +387,8 @@ EXTERNAL SOURCES:
|
|||||||
:path: ".symlinks/plugins/flutter_contacts/ios"
|
:path: ".symlinks/plugins/flutter_contacts/ios"
|
||||||
flutter_image_compress_common:
|
flutter_image_compress_common:
|
||||||
:path: ".symlinks/plugins/flutter_image_compress_common/ios"
|
:path: ".symlinks/plugins/flutter_image_compress_common/ios"
|
||||||
|
flutter_inappwebview_ios:
|
||||||
|
:path: ".symlinks/plugins/flutter_inappwebview_ios/ios"
|
||||||
flutter_local_notifications:
|
flutter_local_notifications:
|
||||||
:path: ".symlinks/plugins/flutter_local_notifications/ios"
|
:path: ".symlinks/plugins/flutter_local_notifications/ios"
|
||||||
flutter_secure_storage:
|
flutter_secure_storage:
|
||||||
@@ -427,7 +440,7 @@ EXTERNAL SOURCES:
|
|||||||
wakelock_plus:
|
wakelock_plus:
|
||||||
:path: ".symlinks/plugins/wakelock_plus/ios"
|
:path: ".symlinks/plugins/wakelock_plus/ios"
|
||||||
webview_flutter_wkwebview:
|
webview_flutter_wkwebview:
|
||||||
:path: ".symlinks/plugins/webview_flutter_wkwebview/ios"
|
:path: ".symlinks/plugins/webview_flutter_wkwebview/darwin"
|
||||||
|
|
||||||
SPEC CHECKSUMS:
|
SPEC CHECKSUMS:
|
||||||
AppAuth: 501c04eda8a8d11f179dbe8637b7a91bb7e5d2fa
|
AppAuth: 501c04eda8a8d11f179dbe8637b7a91bb7e5d2fa
|
||||||
@@ -448,6 +461,7 @@ SPEC CHECKSUMS:
|
|||||||
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
|
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
|
||||||
flutter_contacts: edb1c5ce76aa433e20e6cb14c615f4c0b66e0983
|
flutter_contacts: edb1c5ce76aa433e20e6cb14c615f4c0b66e0983
|
||||||
flutter_image_compress_common: ec1d45c362c9d30a3f6a0426c297f47c52007e3e
|
flutter_image_compress_common: ec1d45c362c9d30a3f6a0426c297f47c52007e3e
|
||||||
|
flutter_inappwebview_ios: 6f63631e2c62a7c350263b13fa5427aedefe81d4
|
||||||
flutter_local_notifications: 4cde75091f6327eb8517fa068a0a5950212d2086
|
flutter_local_notifications: 4cde75091f6327eb8517fa068a0a5950212d2086
|
||||||
flutter_secure_storage: d33dac7ae2ea08509be337e775f6b59f1ff45f12
|
flutter_secure_storage: d33dac7ae2ea08509be337e775f6b59f1ff45f12
|
||||||
flutter_tts: 0f492aab6accf87059b72354fcb4ba934304771d
|
flutter_tts: 0f492aab6accf87059b72354fcb4ba934304771d
|
||||||
@@ -478,6 +492,7 @@ SPEC CHECKSUMS:
|
|||||||
MLKitTextRecognitionCommon: c0b3a63d529296a19bce1f8bc8a513644ed4d1f6
|
MLKitTextRecognitionCommon: c0b3a63d529296a19bce1f8bc8a513644ed4d1f6
|
||||||
MLKitVision: e858c5f125ecc288e4a31127928301eaba9ae0c1
|
MLKitVision: e858c5f125ecc288e4a31127928301eaba9ae0c1
|
||||||
nanopb: 438bc412db1928dac798aa6fd75726007be04262
|
nanopb: 438bc412db1928dac798aa6fd75726007be04262
|
||||||
|
OrderedSet: e539b66b644ff081c73a262d24ad552a69be3a94
|
||||||
package_info_plus: 58f0028419748fad15bf008b270aaa8e54380b1c
|
package_info_plus: 58f0028419748fad15bf008b270aaa8e54380b1c
|
||||||
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
|
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
|
||||||
permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2
|
permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2
|
||||||
@@ -503,7 +518,7 @@ SPEC CHECKSUMS:
|
|||||||
vibration: 7d883d141656a1c1a6d8d238616b2042a51a1241
|
vibration: 7d883d141656a1c1a6d8d238616b2042a51a1241
|
||||||
video_player_avfoundation: 7c6c11d8470e1675df7397027218274b6d2360b3
|
video_player_avfoundation: 7c6c11d8470e1675df7397027218274b6d2360b3
|
||||||
wakelock_plus: 78ec7c5b202cab7761af8e2b2b3d0671be6c4ae1
|
wakelock_plus: 78ec7c5b202cab7761af8e2b2b3d0671be6c4ae1
|
||||||
webview_flutter_wkwebview: 2a23822e9039b7b1bc52e5add778e5d89ad488d1
|
webview_flutter_wkwebview: 0982481e3d9c78fd5c6f62a002fcd24fc791f1e4
|
||||||
|
|
||||||
PODFILE CHECKSUM: d9271c147dd54ffd9ca5d77bf00ca21a1c9a5961
|
PODFILE CHECKSUM: d9271c147dd54ffd9ca5d77bf00ca21a1c9a5961
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>70</string>
|
<string>72</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleURLTypes</key>
|
<key>CFBundleURLTypes</key>
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
</dict>
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>4.0.70</string>
|
<string>4.0.72</string>
|
||||||
<key>FirebaseAppDelegateProxyEnabled</key>
|
<key>FirebaseAppDelegateProxyEnabled</key>
|
||||||
<string>NO</string>
|
<string>NO</string>
|
||||||
<key>GMSApiKey</key>
|
<key>GMSApiKey</key>
|
||||||
|
|||||||
@@ -314,6 +314,9 @@ class RegisterCaptainController extends GetxController {
|
|||||||
// Get.snackbar('title', 'message');
|
// Get.snackbar('title', 'message');
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
Get.snackbar('Error'.tr, 'you must insert token code '.tr,
|
||||||
|
backgroundColor: AppColor.redColor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import 'dart:convert';
|
|||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'package:SEFER/controller/home/captin/home_captain_controller.dart';
|
import 'package:SEFER/controller/home/captin/home_captain_controller.dart';
|
||||||
import 'package:SEFER/env/env.dart';
|
import 'package:SEFER/env/env.dart';
|
||||||
|
import 'package:SEFER/print.dart';
|
||||||
import 'package:SEFER/views/widgets/mydialoug.dart';
|
import 'package:SEFER/views/widgets/mydialoug.dart';
|
||||||
import 'package:firebase_messaging/firebase_messaging.dart';
|
import 'package:firebase_messaging/firebase_messaging.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -68,6 +69,7 @@ class FirebaseMessagesController extends GetxController {
|
|||||||
|
|
||||||
Future getToken() async {
|
Future getToken() async {
|
||||||
fcmToken.getToken().then((token) {
|
fcmToken.getToken().then((token) {
|
||||||
|
// Log.print('token: ${token}');
|
||||||
box.write(BoxName.tokenDriver, token);
|
box.write(BoxName.tokenDriver, token);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -29,9 +29,11 @@ Future<void> getPermissionOverlay() async {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> closeOverlayIfFound() async {
|
Future<void> closeOverlayIfFound() async {
|
||||||
bool isOverlayActive = await FlutterOverlayWindow.isActive();
|
if (Platform.isAndroid) {
|
||||||
if (isOverlayActive) {
|
bool isOverlayActive = await FlutterOverlayWindow.isActive();
|
||||||
await FlutterOverlayWindow.closeOverlay();
|
if (isOverlayActive) {
|
||||||
|
await FlutterOverlayWindow.closeOverlay();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
68
lib/controller/home/captin/help/video_controller.dart
Normal file
68
lib/controller/home/captin/help/video_controller.dart
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:SEFER/constant/links.dart';
|
||||||
|
import 'package:SEFER/controller/functions/crud.dart';
|
||||||
|
import 'package:SEFER/print.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:video_player/video_player.dart';
|
||||||
|
|
||||||
|
class VideoController extends GetxController {
|
||||||
|
var videos = [];
|
||||||
|
var isLoading = true.obs;
|
||||||
|
final String apiUrl =
|
||||||
|
'${AppLink.seferCairoServer}/ride/videos_driver/get.php';
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onInit() {
|
||||||
|
fetchVideos();
|
||||||
|
super.onInit();
|
||||||
|
}
|
||||||
|
|
||||||
|
late VideoPlayerController videoPlayerController;
|
||||||
|
|
||||||
|
// Initialize the video player with the provided URL
|
||||||
|
Future<void> initializeVideo(String videoUrl) async {
|
||||||
|
videoPlayerController =
|
||||||
|
VideoPlayerController.networkUrl(Uri.parse(videoUrl));
|
||||||
|
await videoPlayerController.initialize();
|
||||||
|
videoPlayerController
|
||||||
|
.setLooping(true); // Set to true if you want the video to loop
|
||||||
|
update(); // Update the UI after the video has been initialized
|
||||||
|
}
|
||||||
|
|
||||||
|
// Play the video
|
||||||
|
void play() {
|
||||||
|
videoPlayerController.play();
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Pause the video
|
||||||
|
void pause() {
|
||||||
|
videoPlayerController.pause();
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onClose() {
|
||||||
|
videoPlayerController
|
||||||
|
.dispose(); // Dispose of the video player controller when not in use
|
||||||
|
super.onClose();
|
||||||
|
}
|
||||||
|
|
||||||
|
void fetchVideos() async {
|
||||||
|
try {
|
||||||
|
var res = await CRUD().get(link: apiUrl, payload: {});
|
||||||
|
if (res != 'failure') {
|
||||||
|
videos = jsonDecode(res)['message'];
|
||||||
|
// Log.print('videos: ${videos}');
|
||||||
|
update();
|
||||||
|
} else {
|
||||||
|
Get.snackbar('Error'.tr, '');
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
Get.snackbar("Error", e.toString());
|
||||||
|
} finally {
|
||||||
|
isLoading(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -364,7 +364,7 @@ class MapDriverController extends GetxController {
|
|||||||
double _distance =
|
double _distance =
|
||||||
await calculateDistanceBetweenDriverAndPassengerLocation();
|
await calculateDistanceBetweenDriverAndPassengerLocation();
|
||||||
|
|
||||||
if (_distance < 70) {
|
if (_distance < 400) {
|
||||||
changeRideToBeginToPassenger();
|
changeRideToBeginToPassenger();
|
||||||
isPassengerInfoWindow = false;
|
isPassengerInfoWindow = false;
|
||||||
isRideStarted = true;
|
isRideStarted = true;
|
||||||
@@ -400,7 +400,7 @@ class MapDriverController extends GetxController {
|
|||||||
// var d = jsonDecode(res);
|
// var d = jsonDecode(res);
|
||||||
|
|
||||||
update();
|
update();
|
||||||
Get.back();
|
// Get.back();
|
||||||
// Start updating location and moving camera
|
// Start updating location and moving camera
|
||||||
// updateLocation();
|
// updateLocation();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -203,6 +203,8 @@ class MyTranslation extends Translations {
|
|||||||
"إذا كنت بحاجة إلى المساعدة، تواصل معنا",
|
"إذا كنت بحاجة إلى المساعدة، تواصل معنا",
|
||||||
'You Can Cancel the Trip and get Cost From ':
|
'You Can Cancel the Trip and get Cost From ':
|
||||||
"يمكنك إلغاء الرحلة والحصول على التكلفة من",
|
"يمكنك إلغاء الرحلة والحصول على التكلفة من",
|
||||||
|
|
||||||
|
'Videos Tutorials': "فيديوهات تعليمية",
|
||||||
'Please go to the pickup location exactly':
|
'Please go to the pickup location exactly':
|
||||||
"يرجى الذهاب إلى موقع الالتقاط بالضبط",
|
"يرجى الذهاب إلى موقع الالتقاط بالضبط",
|
||||||
"Approaching your area. Should be there in 3 minutes.":
|
"Approaching your area. Should be there in 3 minutes.":
|
||||||
@@ -305,6 +307,7 @@ class MyTranslation extends Translations {
|
|||||||
"History Page": "سجل الرحلات ",
|
"History Page": "سجل الرحلات ",
|
||||||
"Finished": "مكتملة",
|
"Finished": "مكتملة",
|
||||||
"Trip Detail": "تفاصيل الرحلة",
|
"Trip Detail": "تفاصيل الرحلة",
|
||||||
|
'you must insert token code ': 'يجب إدخال رمز التحقق',
|
||||||
"Invite code already used": "تم استخدام رمز الدعوة بالفعل",
|
"Invite code already used": "تم استخدام رمز الدعوة بالفعل",
|
||||||
"Price is": "السعر",
|
"Price is": "السعر",
|
||||||
"Times of Trip": "أوقات الرحلة",
|
"Times of Trip": "أوقات الرحلة",
|
||||||
|
|||||||
193
lib/views/home/Captin/About Us/video_page.dart
Normal file
193
lib/views/home/Captin/About Us/video_page.dart
Normal file
@@ -0,0 +1,193 @@
|
|||||||
|
import 'package:SEFER/constant/info.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:video_player/video_player.dart';
|
||||||
|
import 'package:youtube_player_flutter/youtube_player_flutter.dart';
|
||||||
|
|
||||||
|
import '../../../../controller/home/captin/help/video_controller.dart';
|
||||||
|
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
|
||||||
|
class VideoListPage extends StatelessWidget {
|
||||||
|
final VideoController videoController = Get.put(VideoController());
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return CupertinoPageScaffold(
|
||||||
|
navigationBar: CupertinoNavigationBar(
|
||||||
|
middle: Text('Videos Tutorials'.tr),
|
||||||
|
),
|
||||||
|
child: SafeArea(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 16.0,
|
||||||
|
vertical: 10.0), // Outer padding around the list
|
||||||
|
child: GetBuilder<VideoController>(
|
||||||
|
builder: (videoController) {
|
||||||
|
return ListView.builder(
|
||||||
|
itemCount: videoController.videos.length,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
final video = videoController.videos[index];
|
||||||
|
return Container(
|
||||||
|
margin: const EdgeInsets.symmetric(
|
||||||
|
vertical: 8.0), // Spacing between each card
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: CupertinoColors.white,
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.circular(12.0), // Rounded corners
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: CupertinoColors.systemGrey.withOpacity(0.3),
|
||||||
|
offset: const Offset(
|
||||||
|
0, 4), // Offset for shadow to appear below
|
||||||
|
blurRadius: 10.0, // Blur for softer shadow effect
|
||||||
|
),
|
||||||
|
],
|
||||||
|
border: Border.all(
|
||||||
|
color: CupertinoColors.systemGrey4,
|
||||||
|
width: 0.5, // Subtle border for a refined iOS-like look
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: CupertinoListTile(
|
||||||
|
title: Padding(
|
||||||
|
padding: const EdgeInsets.only(bottom: 4.0),
|
||||||
|
child: Text(
|
||||||
|
video['title'],
|
||||||
|
style: const TextStyle(
|
||||||
|
color: CupertinoColors.black,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
subtitle: Text(
|
||||||
|
video['description'],
|
||||||
|
style: const TextStyle(
|
||||||
|
color: CupertinoColors.systemGrey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onTap: () {
|
||||||
|
// Navigate to video player page (iOS-style)
|
||||||
|
Get.to(() => VideoPlayerPage1(videoUrl: video['url']));
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class VideoPlayerPage extends StatelessWidget {
|
||||||
|
final String videoUrl;
|
||||||
|
|
||||||
|
VideoPlayerPage({required this.videoUrl});
|
||||||
|
|
||||||
|
final VideoController videoController = Get.put(VideoController());
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
// Initialize the video when the page is loaded
|
||||||
|
videoController.initializeVideo(videoUrl);
|
||||||
|
|
||||||
|
return CupertinoPageScaffold(
|
||||||
|
navigationBar: const CupertinoNavigationBar(
|
||||||
|
middle: Text(AppInformation.appName),
|
||||||
|
),
|
||||||
|
child: SafeArea(
|
||||||
|
child: Center(
|
||||||
|
child: GetBuilder<VideoController>(
|
||||||
|
builder: (controller) {
|
||||||
|
if (!controller.videoPlayerController.value.isInitialized) {
|
||||||
|
return const CircularProgressIndicator(); // Show loading indicator while initializing
|
||||||
|
}
|
||||||
|
|
||||||
|
return Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
// Video player widget
|
||||||
|
AspectRatio(
|
||||||
|
aspectRatio:
|
||||||
|
controller.videoPlayerController.value.aspectRatio,
|
||||||
|
// child: VideoPlayer(controller.videoPlayerController),
|
||||||
|
child: VideoPlayer(controller.videoPlayerController),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
|
||||||
|
// Play/pause button
|
||||||
|
CupertinoButton(
|
||||||
|
onPressed: () {
|
||||||
|
if (controller.videoPlayerController.value.isPlaying) {
|
||||||
|
controller.pause();
|
||||||
|
} else {
|
||||||
|
controller.play();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: Icon(
|
||||||
|
controller.videoPlayerController.value.isPlaying
|
||||||
|
? CupertinoIcons.pause
|
||||||
|
: CupertinoIcons.play_arrow,
|
||||||
|
color: CupertinoColors.activeBlue,
|
||||||
|
size: 30,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class VideoPlayerPage1 extends StatelessWidget {
|
||||||
|
final String videoUrl;
|
||||||
|
|
||||||
|
VideoPlayerPage1({required this.videoUrl});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
// Extract the video ID from the URL
|
||||||
|
String videoId = YoutubePlayer.convertUrlToId(videoUrl)!;
|
||||||
|
|
||||||
|
// Create a YoutubePlayerController
|
||||||
|
final YoutubePlayerController _controller = YoutubePlayerController(
|
||||||
|
initialVideoId: videoId,
|
||||||
|
flags: const YoutubePlayerFlags(
|
||||||
|
autoPlay: true,
|
||||||
|
loop: true,
|
||||||
|
mute: false,
|
||||||
|
captionLanguage: 'ar',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
return Scaffold(
|
||||||
|
body: Stack(
|
||||||
|
children: [
|
||||||
|
// Full-screen YouTube player
|
||||||
|
Positioned.fill(
|
||||||
|
child: YoutubePlayer(
|
||||||
|
controller: _controller,
|
||||||
|
showVideoProgressIndicator: true,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// Overlay back button in the top left corner for exit
|
||||||
|
Positioned(
|
||||||
|
top: 40.0,
|
||||||
|
left: 16.0,
|
||||||
|
child: IconButton(
|
||||||
|
icon: const Icon(Icons.arrow_back, color: Colors.white),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -19,6 +19,7 @@ import 'package:SEFER/views/notification/notification_captain.dart';
|
|||||||
|
|
||||||
import '../../../../constant/colors.dart';
|
import '../../../../constant/colors.dart';
|
||||||
import '../../../../controller/functions/upload_image.dart';
|
import '../../../../controller/functions/upload_image.dart';
|
||||||
|
import '../About Us/video_page.dart';
|
||||||
import '../assurance_health_page.dart';
|
import '../assurance_health_page.dart';
|
||||||
import '../maintain_center_page.dart';
|
import '../maintain_center_page.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
@@ -97,7 +98,13 @@ class CupertinoDrawerCaptain extends StatelessWidget {
|
|||||||
_buildDrawerItem(
|
_buildDrawerItem(
|
||||||
icon: CupertinoIcons.mail,
|
icon: CupertinoIcons.mail,
|
||||||
text: "Contact Us".tr,
|
text: "Contact Us".tr,
|
||||||
onTap: () => Get.to(() => ContactUsPage()),
|
onTap: () => Get.to(() => const SettingsCaptain()),
|
||||||
|
),
|
||||||
|
_buildDivider(),
|
||||||
|
_buildDrawerItem(
|
||||||
|
icon: CupertinoIcons.settings,
|
||||||
|
text: 'Videos Tutorials'.tr,
|
||||||
|
onTap: () => Get.to(() => VideoListPage()),
|
||||||
),
|
),
|
||||||
_buildDivider(),
|
_buildDivider(),
|
||||||
_buildDrawerItem(
|
_buildDrawerItem(
|
||||||
|
|||||||
@@ -453,6 +453,7 @@ class PassengerInfoWindow extends StatelessWidget {
|
|||||||
() async {
|
() async {
|
||||||
await controller
|
await controller
|
||||||
.startRideFromDriver();
|
.startRideFromDriver();
|
||||||
|
Get.back();
|
||||||
// Close dialog after confirmation
|
// Close dialog after confirmation
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@@ -467,7 +468,7 @@ class PassengerInfoWindow extends StatelessWidget {
|
|||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
if (await controller
|
if (await controller
|
||||||
.calculateDistanceBetweenDriverAndPassengerLocation() <
|
.calculateDistanceBetweenDriverAndPassengerLocation() <
|
||||||
40) {
|
140) {
|
||||||
// Notify Passenger
|
// Notify Passenger
|
||||||
FirebaseMessagesController()
|
FirebaseMessagesController()
|
||||||
.sendNotificationToPassengerToken(
|
.sendNotificationToPassengerToken(
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import firebase_auth
|
|||||||
import firebase_core
|
import firebase_core
|
||||||
import firebase_messaging
|
import firebase_messaging
|
||||||
import flutter_image_compress_macos
|
import flutter_image_compress_macos
|
||||||
|
import flutter_inappwebview_macos
|
||||||
import flutter_local_notifications
|
import flutter_local_notifications
|
||||||
import flutter_secure_storage_macos
|
import flutter_secure_storage_macos
|
||||||
import flutter_tts
|
import flutter_tts
|
||||||
@@ -27,6 +28,7 @@ import sqflite
|
|||||||
import url_launcher_macos
|
import url_launcher_macos
|
||||||
import video_player_avfoundation
|
import video_player_avfoundation
|
||||||
import wakelock_plus
|
import wakelock_plus
|
||||||
|
import webview_flutter_wkwebview
|
||||||
|
|
||||||
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||||
AudioSessionPlugin.register(with: registry.registrar(forPlugin: "AudioSessionPlugin"))
|
AudioSessionPlugin.register(with: registry.registrar(forPlugin: "AudioSessionPlugin"))
|
||||||
@@ -36,6 +38,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
|||||||
FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
|
FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
|
||||||
FLTFirebaseMessagingPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseMessagingPlugin"))
|
FLTFirebaseMessagingPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseMessagingPlugin"))
|
||||||
FlutterImageCompressMacosPlugin.register(with: registry.registrar(forPlugin: "FlutterImageCompressMacosPlugin"))
|
FlutterImageCompressMacosPlugin.register(with: registry.registrar(forPlugin: "FlutterImageCompressMacosPlugin"))
|
||||||
|
InAppWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "InAppWebViewFlutterPlugin"))
|
||||||
FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin"))
|
FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin"))
|
||||||
FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin"))
|
FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin"))
|
||||||
FlutterTtsPlugin.register(with: registry.registrar(forPlugin: "FlutterTtsPlugin"))
|
FlutterTtsPlugin.register(with: registry.registrar(forPlugin: "FlutterTtsPlugin"))
|
||||||
@@ -51,4 +54,5 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
|||||||
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
|
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
|
||||||
FVPVideoPlayerPlugin.register(with: registry.registrar(forPlugin: "FVPVideoPlayerPlugin"))
|
FVPVideoPlayerPlugin.register(with: registry.registrar(forPlugin: "FVPVideoPlayerPlugin"))
|
||||||
WakelockPlusMacosPlugin.register(with: registry.registrar(forPlugin: "WakelockPlusMacosPlugin"))
|
WakelockPlusMacosPlugin.register(with: registry.registrar(forPlugin: "WakelockPlusMacosPlugin"))
|
||||||
|
FLTWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "FLTWebViewFlutterPlugin"))
|
||||||
}
|
}
|
||||||
|
|||||||
82
pubspec.lock
82
pubspec.lock
@@ -630,6 +630,62 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.1.4+1"
|
version: "0.1.4+1"
|
||||||
|
flutter_inappwebview:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: flutter_inappwebview
|
||||||
|
sha256: "3e9a443a18ecef966fb930c3a76ca5ab6a7aafc0c7b5e14a4a850cf107b09959"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "6.0.0"
|
||||||
|
flutter_inappwebview_android:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: flutter_inappwebview_android
|
||||||
|
sha256: "62557c15a5c2db5d195cb3892aab74fcaec266d7b86d59a6f0027abd672cddba"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.1.3"
|
||||||
|
flutter_inappwebview_internal_annotations:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: flutter_inappwebview_internal_annotations
|
||||||
|
sha256: "5f80fd30e208ddded7dbbcd0d569e7995f9f63d45ea3f548d8dd4c0b473fb4c8"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.1.1"
|
||||||
|
flutter_inappwebview_ios:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: flutter_inappwebview_ios
|
||||||
|
sha256: "5818cf9b26cf0cbb0f62ff50772217d41ea8d3d9cc00279c45f8aabaa1b4025d"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.1.2"
|
||||||
|
flutter_inappwebview_macos:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: flutter_inappwebview_macos
|
||||||
|
sha256: c1fbb86af1a3738e3541364d7d1866315ffb0468a1a77e34198c9be571287da1
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.1.2"
|
||||||
|
flutter_inappwebview_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: flutter_inappwebview_platform_interface
|
||||||
|
sha256: cf5323e194096b6ede7a1ca808c3e0a078e4b33cc3f6338977d75b4024ba2500
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.3.0+1"
|
||||||
|
flutter_inappwebview_web:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: flutter_inappwebview_web
|
||||||
|
sha256: d8c680abfb6fec71609a700199635d38a744df0febd5544c5a020bd73de8ee07
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.8"
|
||||||
flutter_launcher_icons:
|
flutter_launcher_icons:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -2052,13 +2108,13 @@ packages:
|
|||||||
source: hosted
|
source: hosted
|
||||||
version: "0.0.1"
|
version: "0.0.1"
|
||||||
video_player:
|
video_player:
|
||||||
dependency: transitive
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: video_player
|
name: video_player
|
||||||
sha256: e30df0d226c4ef82e2c150ebf6834b3522cf3f654d8e2f9419d376cdc071425d
|
sha256: "4a8c3492d734f7c39c2588a3206707a05ee80cef52e8c7f3b2078d430c84bc17"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.9.1"
|
version: "2.9.2"
|
||||||
video_player_android:
|
video_player_android:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -2151,10 +2207,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: webview_flutter
|
name: webview_flutter
|
||||||
sha256: "6869c8786d179f929144b4a1f86e09ac0eddfe475984951ea6c634774c16b522"
|
sha256: ec81f57aa1611f8ebecf1d2259da4ef052281cb5ad624131c93546c79ccc7736
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.8.0"
|
version: "4.9.0"
|
||||||
webview_flutter_android:
|
webview_flutter_android:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -2175,10 +2231,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: webview_flutter_wkwebview
|
name: webview_flutter_wkwebview
|
||||||
sha256: "9c62cc46fa4f2d41e10ab81014c1de470a6c6f26051a2de32111b2ee55287feb"
|
sha256: d4034901d96357beb1b6717ebf7d583c88e40cfc6eb85fe76dd1bf0979a9f251
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.14.0"
|
version: "3.16.0"
|
||||||
win32:
|
win32:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -2219,6 +2275,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.1.2"
|
version: "3.1.2"
|
||||||
|
youtube_player_flutter:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: youtube_player_flutter
|
||||||
|
sha256: "30f84e2f7063c56e536f507e37c1e803546842707cf58e5b5a71253b9ff9b455"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "9.0.4"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=3.4.0 <4.0.0"
|
dart: ">=3.5.0 <4.0.0"
|
||||||
flutter: ">=3.22.0"
|
flutter: ">=3.24.0"
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ dependencies:
|
|||||||
# ref: main
|
# ref: main
|
||||||
record: ^5.0.5
|
record: ^5.0.5
|
||||||
dio: ^5.4.3+1
|
dio: ^5.4.3+1
|
||||||
webview_flutter: ^4.7.0
|
webview_flutter: ^4.9.0
|
||||||
just_audio: ^0.9.37
|
just_audio: ^0.9.37
|
||||||
share: ^2.0.4
|
share: ^2.0.4
|
||||||
google_sign_in: ^6.2.1
|
google_sign_in: ^6.2.1
|
||||||
@@ -85,6 +85,8 @@ dependencies:
|
|||||||
flutter_contacts: ^1.1.8
|
flutter_contacts: ^1.1.8
|
||||||
flutter_overlay_window: ^0.4.4
|
flutter_overlay_window: ^0.4.4
|
||||||
googleapis_auth: ^1.6.0
|
googleapis_auth: ^1.6.0
|
||||||
|
video_player: ^2.9.2
|
||||||
|
youtube_player_flutter: ^9.0.4
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
|||||||
Reference in New Issue
Block a user