7/6/2
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
class AppInformation {
|
||||
static const String companyName = 'Mobile-App';
|
||||
static const String companyName = 'Sefer llc';
|
||||
static const String appName = 'SEFER';
|
||||
static const String phoneNumber = '962798583052';
|
||||
static const String linkedInProfile =
|
||||
'https://www.linkedin.com/in/hamza-ayed/';
|
||||
static const String website = 'https://mobile-app.store';
|
||||
static const String email = 'hamzaayed@mobile-app.store';
|
||||
static const String website = 'https://sefer.live';
|
||||
static const String email = 'hamzaayed@sefer.live';
|
||||
|
||||
static const String privacyPolicy =
|
||||
'''
|
||||
static const String privacyPolicy = '''
|
||||
|
||||
<body monica-version="2.4.0" monica-id="ofpnmcalabcbjgholdjcjblkibolbppb">
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ class AppLink {
|
||||
static String getTokenParent = "$server/ride/firebase/getTokenParent.php";
|
||||
static String addTokens = "$server/ride/firebase/add.php";
|
||||
static String addTokensDriver = "$server/ride/firebase/addDriver.php";
|
||||
static String packageInfo = "$server/auth/packageInfo.php";
|
||||
|
||||
//=======================Wallet===================
|
||||
static String wallet = '$server/ride/passengerWallet';
|
||||
|
||||
67
lib/controller/functions/package_info.dart
Normal file
67
lib/controller/functions/package_info.dart
Normal file
@@ -0,0 +1,67 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
import 'package:SEFER/constant/links.dart';
|
||||
import 'package:SEFER/controller/functions/crud.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import '../../constant/info.dart';
|
||||
|
||||
Future<void> checkForUpdate(BuildContext context) async {
|
||||
final packageInfo = await PackageInfo.fromPlatform();
|
||||
final currentVersion = packageInfo.buildNumber;
|
||||
print('currentVersion is : $currentVersion');
|
||||
// Fetch the latest version from your server
|
||||
String latestVersion = await getPackageInfo();
|
||||
|
||||
if (latestVersion.isNotEmpty && latestVersion != currentVersion) {
|
||||
showUpdateDialog(context);
|
||||
}
|
||||
}
|
||||
|
||||
Future<String> getPackageInfo() async {
|
||||
final response = await CRUD().get(link: AppLink.packageInfo, payload: {
|
||||
"platform": Platform.isAndroid ? 'android' : 'ios',
|
||||
"appName": AppInformation.appName,
|
||||
});
|
||||
|
||||
if (response != 'failure') {
|
||||
return jsonDecode(response)['message'][0]['version'];
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
void showUpdateDialog(BuildContext context) {
|
||||
final String storeUrl = Platform.isAndroid
|
||||
? 'https://play.google.com/store/apps/details?id=com.mobileapp.store.ride'
|
||||
: 'https://apps.apple.com/ae/app/sefer/id6458734951';
|
||||
showCupertinoDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (BuildContext context) {
|
||||
return CupertinoAlertDialog(
|
||||
title: Text('Update Available'.tr),
|
||||
content: Text(
|
||||
'A new version of the app is available. Please update to the latest version.'
|
||||
.tr,
|
||||
),
|
||||
actions: <Widget>[
|
||||
CupertinoDialogAction(
|
||||
child: Text('Update'.tr),
|
||||
onPressed: () async {
|
||||
if (await canLaunchUrl(Uri.parse(storeUrl))) {
|
||||
await launchUrl(Uri.parse(storeUrl));
|
||||
} else {
|
||||
print('Could not launch $storeUrl');
|
||||
}
|
||||
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -3,6 +3,7 @@ import 'dart:async';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/views/auth/login_page.dart';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
|
||||
import '../../constant/box_name.dart';
|
||||
import '../../main.dart';
|
||||
@@ -15,10 +16,23 @@ class SplashScreenController extends GetxController
|
||||
late Animation<double> zoomInAnimation;
|
||||
late Animation<double> zoomOutAnimation;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
String packageInfo = '';
|
||||
late String version = '1.5.48';
|
||||
Future<void> checkForUpdate() async {
|
||||
final packageInfo = await PackageInfo.fromPlatform();
|
||||
final currentVersion = packageInfo.buildNumber;
|
||||
final version1 = packageInfo.version;
|
||||
print('currentVersion is : $currentVersion');
|
||||
// Fetch the latest version from your server
|
||||
version = version1.toString();
|
||||
print('version: ${version}');
|
||||
update();
|
||||
}
|
||||
|
||||
@override
|
||||
void onInit() async {
|
||||
super.onInit();
|
||||
checkForUpdate();
|
||||
animationController = AnimationController(
|
||||
vsync: this,
|
||||
duration: const Duration(seconds: 4),
|
||||
|
||||
@@ -4,6 +4,13 @@ class MyTranslation extends Translations {
|
||||
@override
|
||||
Map<String, Map<String, String>> get keys => {
|
||||
"ar": {
|
||||
"Update Available": "تحديث متوفر",
|
||||
"A new version of the app is available. Please update to the latest version.":
|
||||
"تتوفر نسخة جديدة من التطبيق. يرجى التحديث إلى أحدث إصدار.",
|
||||
"We use location to get accurate and nearest passengers for you":
|
||||
"نستخدم الموقع للحصول على أقرب الركاب وأكثرهم دقة لك",
|
||||
"This ride is already applied by another driver.":
|
||||
"هذه الرحلة قام بقبولها سائق آخر بالفعل.",
|
||||
"We use your precise location to find the nearest available driver and provide accurate pickup and dropoff information. You can manage this in Settings.":
|
||||
"نستخدم موقعك الدقيق للعثور على أقرب سائق متاح وتوفير معلومات دقيقة عن مكان الاستلام والوجهة. يمكنك إدارة ذلك في الإعدادات.",
|
||||
'message From Driver': 'رسالة من السائق',
|
||||
@@ -733,7 +740,7 @@ iOS [https://getapp.cc/app/6458734951]
|
||||
"حَتَّى لَو مَفِيش كَارت SIM, مَاتِخَافْش! تُقَدِّر تِكَلِّم سِوَاقَك بِمَنْتَهَى البَسَاطَة عَن طَرِيق التَّطْبِيق بِتَاعِنَا. احنَا بِنَسْتَخْدِم تِكْنُولُوجْيَا حَدِيثَة عَشَان نِحافِظ عَلَى خَصُوصِيَّتَك",
|
||||
"This ride type allows changes, but the price may increase":
|
||||
"ده نوع الرحلات بيسمح بالتغيير بس السعر ممكن يزيد",
|
||||
"message From passenger": "رسالة من الراكب",
|
||||
|
||||
"Select one message": "اختر رسالة",
|
||||
"My location is correct. You can search for me using the navigation app":
|
||||
"المَكَان اللِّي أنا فِيه صَحِيح، مُمْكِن تُدَوِّر عَليَّا مِن خِلَال تَطْبِيق المُلاحَة",
|
||||
|
||||
@@ -59,7 +59,14 @@ class SplashScreen extends StatelessWidget {
|
||||
AppStyle.title.copyWith(color: AppColor.primaryColor),
|
||||
speed: const Duration(milliseconds: 200),
|
||||
),
|
||||
], isRepeatingAnimation: false)
|
||||
], isRepeatingAnimation: false),
|
||||
const SizedBox(
|
||||
height: 100,
|
||||
),
|
||||
Text(
|
||||
splashScreenController.version.toString(),
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import '../../constant/box_name.dart';
|
||||
import '../../constant/colors.dart';
|
||||
import '../../controller/functions/package_info.dart';
|
||||
import '../../controller/home/map_passenger_controller.dart';
|
||||
import '../../main.dart';
|
||||
import '../../views/home/map_widget.dart/cancel_raide_page.dart';
|
||||
@@ -30,6 +31,9 @@ class MapPagePassenger extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(MapPassengerController());
|
||||
Get.put(MyMenuController());
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
checkForUpdate(context);
|
||||
});
|
||||
return Scaffold(
|
||||
body: SafeArea(
|
||||
child: Stack(
|
||||
|
||||
@@ -26,7 +26,7 @@ class ApplyOrderWidget extends StatelessWidget {
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
decoration: AppStyle.boxDecoration,
|
||||
height: Get.height * .35,
|
||||
child: ListView(
|
||||
children: [
|
||||
@@ -88,7 +88,7 @@ class ApplyOrderWidget extends StatelessWidget {
|
||||
Container(
|
||||
height: Get.height * .3,
|
||||
width: Get.width * .9,
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
decoration: AppStyle.boxDecoration,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
@@ -185,7 +185,7 @@ class ApplyOrderWidget extends StatelessWidget {
|
||||
title: 'Select one message'.tr,
|
||||
titleStyle: AppStyle.title,
|
||||
content: SizedBox(
|
||||
width: Get.width * .6,
|
||||
width: 300,
|
||||
height: Get.height * .5,
|
||||
child: ListView(
|
||||
children: [
|
||||
@@ -203,7 +203,7 @@ class ApplyOrderWidget extends StatelessWidget {
|
||||
},
|
||||
child: Container(
|
||||
decoration:
|
||||
AppStyle.boxDecoration1,
|
||||
AppStyle.boxDecoration,
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.all(
|
||||
@@ -233,7 +233,7 @@ class ApplyOrderWidget extends StatelessWidget {
|
||||
},
|
||||
child: Container(
|
||||
decoration:
|
||||
AppStyle.boxDecoration1,
|
||||
AppStyle.boxDecoration,
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.all(
|
||||
@@ -263,7 +263,7 @@ class ApplyOrderWidget extends StatelessWidget {
|
||||
},
|
||||
child: Container(
|
||||
decoration:
|
||||
AppStyle.boxDecoration1,
|
||||
AppStyle.boxDecoration,
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.all(
|
||||
@@ -292,7 +292,7 @@ class ApplyOrderWidget extends StatelessWidget {
|
||||
},
|
||||
child: Container(
|
||||
decoration:
|
||||
AppStyle.boxDecoration1,
|
||||
AppStyle.boxDecoration,
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.all(
|
||||
@@ -309,7 +309,7 @@ class ApplyOrderWidget extends StatelessWidget {
|
||||
height: 5,
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .5,
|
||||
width: 190,
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
@@ -318,7 +318,7 @@ class ApplyOrderWidget extends StatelessWidget {
|
||||
key: controller
|
||||
.messagesFormKey,
|
||||
child: SizedBox(
|
||||
width: Get.width * .4,
|
||||
width: 160,
|
||||
child: MyTextForm(
|
||||
controller: controller
|
||||
.messageToDriver,
|
||||
@@ -455,13 +455,13 @@ class TimeDriverToPassenger extends StatelessWidget {
|
||||
return controller.isDriverInPassengerWay == false ||
|
||||
controller.timeToPassengerFromDriverAfterApplied > 0
|
||||
? Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
decoration: AppStyle.boxDecoration,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 4, vertical: 1),
|
||||
child: Stack(
|
||||
children: [
|
||||
Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
decoration: AppStyle.boxDecoration,
|
||||
width: Get.width * .7,
|
||||
height: 35,
|
||||
// color: AppColor.yellowColor,
|
||||
|
||||
@@ -31,7 +31,7 @@ class RideBeginPassenger extends StatelessWidget {
|
||||
right: 10,
|
||||
bottom: 4,
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
decoration: AppStyle.boxDecoration,
|
||||
height: controller.statusRide == 'Begin' ? Get.height * .33 : 0,
|
||||
// width: 100,
|
||||
child: Padding(
|
||||
|
||||
Reference in New Issue
Block a user