This commit is contained in:
Hamza-Ayed
2024-07-06 10:02:06 +03:00
parent 002b33af49
commit 819a32eec1
14 changed files with 144 additions and 44 deletions

View File

@@ -55,8 +55,8 @@ android {
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 23
targetSdkVersion 33
versionCode 48
versionName '1.5.48'
versionCode 49
versionName '1.5.49'
// manifestPlaceholders = [mapsApiKey: 'android/app/src/main/AndroidManifest.xml']
}

View File

@@ -415,7 +415,7 @@ SPEC CHECKSUMS:
local_auth_ios: c6cf091ded637a88f24f86a8875d8b0f526e2605
location: d5cf8598915965547c3f36761ae9cc4f4e87d22e
nanopb: 438bc412db1928dac798aa6fd75726007be04262
package_info_plus: 115f4ad11e0698c8c1c5d8a689390df880f47e85
package_info_plus: 58f0028419748fad15bf008b270aaa8e54380b1c
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943
permission_handler_apple: 036b856153a2b1f61f21030ff725f3e6fece2b78
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
@@ -437,7 +437,7 @@ SPEC CHECKSUMS:
url_launcher_ios: bf5ce03e0e2088bad9cc378ea97fa0ed5b49673b
vibration: 7d883d141656a1c1a6d8d238616b2042a51a1241
video_player_avfoundation: e9e6f9cae7d7a6d9b43519b0aab382bca60fcfd1
wakelock_plus: 8b09852c8876491e4b6d179e17dfe2a0b5f60d47
wakelock_plus: 78ec7c5b202cab7761af8e2b2b3d0671be6c4ae1
webview_flutter_wkwebview: be0f0d33777f1bfd0c9fdcb594786704dbf65f36
PODFILE CHECKSUM: 0bad49c413ac3d5029f2e67f7b21b01b6b7d5085

View File

@@ -37,11 +37,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>41</string>
<string>42</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>4.3.41</string>
<string>4.3.42</string>
<key>FirebaseAppDelegateProxyEnabled</key>
<string>NO</string>
<key>GMSApiKey</key>

View File

@@ -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">

View File

@@ -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';

View 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();
},
),
],
);
},
);
}

View File

@@ -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),

View File

@@ -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":
"المَكَان اللِّي أنا فِيه صَحِيح، مُمْكِن تُدَوِّر عَليَّا مِن خِلَال تَطْبِيق المُلاحَة",

View File

@@ -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,
),
],
),
),

View File

@@ -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(

View File

@@ -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,

View File

@@ -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(

View File

@@ -341,10 +341,10 @@ packages:
dependency: transitive
description:
name: ffi
sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878"
sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21"
url: "https://pub.dev"
source: hosted
version: "2.1.0"
version: "2.1.2"
file:
dependency: transitive
description:
@@ -1281,21 +1281,21 @@ packages:
source: hosted
version: "2.1.0"
package_info_plus:
dependency: transitive
dependency: "direct main"
description:
name: package_info_plus
sha256: "7e76fad405b3e4016cd39d08f455a4eb5199723cf594cd1b8916d47140d93017"
sha256: b93d8b4d624b4ea19b0a5a208b2d6eff06004bc3ce74c06040b120eeadd00ce0
url: "https://pub.dev"
source: hosted
version: "4.2.0"
version: "8.0.0"
package_info_plus_platform_interface:
dependency: transitive
description:
name: package_info_plus_platform_interface
sha256: "9bc8ba46813a4cc42c66ab781470711781940780fd8beddd0c3da62506d3a6c6"
sha256: f49918f3433a3146047372f9d4f1f847511f2acd5cd030e1f44fe5a50036b70e
url: "https://pub.dev"
source: hosted
version: "2.0.1"
version: "3.0.0"
path:
dependency: "direct main"
description:
@@ -1428,10 +1428,10 @@ packages:
dependency: transitive
description:
name: plugin_platform_interface
sha256: f4f88d4a900933e7267e2b353594774fc0d07fb072b47eedcd5b54e1ea3269f8
sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02"
url: "https://pub.dev"
source: hosted
version: "2.1.7"
version: "2.1.8"
pool:
dependency: transitive
description:
@@ -1897,18 +1897,18 @@ packages:
dependency: "direct main"
description:
name: wakelock_plus
sha256: f268ca2116db22e57577fb99d52515a24bdc1d570f12ac18bb762361d43b043d
sha256: "14758533319a462ffb5aa3b7ddb198e59b29ac3b02da14173a1715d65d4e6e68"
url: "https://pub.dev"
source: hosted
version: "1.1.4"
version: "1.2.5"
wakelock_plus_platform_interface:
dependency: transitive
description:
name: wakelock_plus_platform_interface
sha256: "40fabed5da06caff0796dc638e1f07ee395fb18801fbff3255a2372db2d80385"
sha256: "422d1cdbb448079a8a62a5a770b69baa489f8f7ca21aef47800c726d404f9d16"
url: "https://pub.dev"
source: hosted
version: "1.1.0"
version: "1.2.1"
watcher:
dependency: transitive
description:
@@ -1969,10 +1969,10 @@ packages:
dependency: transitive
description:
name: win32
sha256: b0f37db61ba2f2e9b7a78a1caece0052564d1bc70668156cf3a29d676fe4e574
sha256: a79dbe579cb51ecd6d30b17e0cae4e0ea15e2c0e66f69ad4198f22a6789e94f4
url: "https://pub.dev"
source: hosted
version: "5.1.1"
version: "5.5.1"
win32_registry:
dependency: transitive
description:
@@ -2006,5 +2006,5 @@ packages:
source: hosted
version: "3.1.2"
sdks:
dart: ">=3.3.0 <4.0.0"
dart: ">=3.4.0 <4.0.0"
flutter: ">=3.19.0"

View File

@@ -56,6 +56,7 @@ dependencies:
google_sign_in: ^6.2.1
sign_in_with_apple: ^6.1.0
firebase_auth: ^4.19.6
package_info_plus: ^8.0.0
dev_dependencies:
flutter_test: