12/8/1
This commit is contained in:
@@ -51,6 +51,7 @@ class AK {
|
||||
X.r(X.r(X.r(Env.payMobApikey, cn), cC), cs);
|
||||
static final String integrationIdPayMobWallet =
|
||||
X.r(X.r(X.r(Env.integrationIdPayMobWallet, cn), cC), cs);
|
||||
static final String apiKeyHere = Env.apiKeyHere;
|
||||
static final String smsPasswordEgypt =
|
||||
X.r(X.r(X.r(Env.smsPasswordEgypt, cn), cC), cs);
|
||||
static final String ocpApimSubscriptionKey = Env.ocpApimSubscriptionKey;
|
||||
|
||||
@@ -24,6 +24,7 @@ class BoxName {
|
||||
static const String agreeTerms = "agreeTerms";
|
||||
static const String addWork = 'addWork';
|
||||
static const String addHome = 'addHome';
|
||||
static const String placesDestination = 'placesDestination';
|
||||
static const String tipPercentage = 'tipPercentage';
|
||||
static const String accountIdStripeConnect = "accountIdStripeConnect";
|
||||
static const String faceDetectTimes = "faceDetectTimes";
|
||||
|
||||
@@ -14,6 +14,8 @@ class AppLink {
|
||||
// static final String server = Env.serverPHP;
|
||||
|
||||
static String googleMapsLink = 'https://maps.googleapis.com/maps/api/';
|
||||
static String searcMaps =
|
||||
'https://autosuggest.search.hereapi.com/v1/autosuggest';
|
||||
static String llama = 'https://api.llama-api.com/chat/completions';
|
||||
static String gemini =
|
||||
'https://generativelanguage.googleapis.com/v1beta3/models/text-bison-001:generateText';
|
||||
@@ -185,6 +187,8 @@ class AppLink {
|
||||
|
||||
// =====================================
|
||||
static String addRateToPassenger = "$ride/rate/add.php";
|
||||
static String savePlacesServer = "$ride/places/add.php";
|
||||
static String getapiKey = "$ride/apiKey/get.php";
|
||||
static String addRateToDriver = "$ride/rate/addRateToDriver.php";
|
||||
static String getDriverRate = "$ride/rate/getDriverRate.php";
|
||||
static String getPassengerRate = "$ride/rate/getPassengerRate.php";
|
||||
@@ -265,6 +269,8 @@ class AppLink {
|
||||
static String getAccount = "$authCaptin/getAccount.php";
|
||||
static String updatePassengersInvitation =
|
||||
"$server/ride/invitor/updatePassengersInvitation.php";
|
||||
static String updateDriverInvitationDirectly =
|
||||
"$server/ride/invitor/updateDriverInvitationDirectly.php";
|
||||
//===================Admin Captin============
|
||||
|
||||
static String getPassengerDetailsByPassengerID =
|
||||
|
||||
@@ -5,35 +5,39 @@ import 'package:google_fonts/google_fonts.dart';
|
||||
import 'colors.dart';
|
||||
|
||||
class AppStyle {
|
||||
static TextStyle headTitle = TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 40,
|
||||
color: AppColor.accentColor,
|
||||
fontFamily: box.read(BoxName.lang) == 'ar'
|
||||
// ?GoogleFonts.notoNaskhArabic().fontFamily
|
||||
? GoogleFonts.notoNaskhArabic().fontFamily
|
||||
: GoogleFonts.roboto().fontFamily);
|
||||
static TextStyle headTitle2 = TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 26,
|
||||
color: AppColor.writeColor,
|
||||
fontFamily: box.read(BoxName.lang) == 'ar'
|
||||
? GoogleFonts.notoNaskhArabic().fontFamily
|
||||
: GoogleFonts.roboto().fontFamily);
|
||||
static TextStyle headTitle = const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 40,
|
||||
color: AppColor.accentColor,
|
||||
// fontFamily: box.read(BoxName.lang) == 'ar'
|
||||
// // ?GoogleFonts.notoNaskhArabic().fontFamily
|
||||
// ? GoogleFonts.notoNaskhArabic().fontFamily
|
||||
// : GoogleFonts.roboto().fontFamily,
|
||||
);
|
||||
static TextStyle headTitle2 = const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 22,
|
||||
color: AppColor.writeColor,
|
||||
// fontFamily: box.read(BoxName.lang) == 'ar'
|
||||
// ? GoogleFonts.notoNaskhArabic().fontFamily
|
||||
// : GoogleFonts.roboto().fontFamily
|
||||
);
|
||||
static TextStyle title = TextStyle(
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: box.read(BoxName.lang) == 'ar' ? 14 : 16,
|
||||
color: AppColor.writeColor,
|
||||
fontFamily: box.read(BoxName.lang) == 'ar'
|
||||
? GoogleFonts.notoNaskhArabic().fontFamily
|
||||
: GoogleFonts.roboto().fontFamily);
|
||||
static TextStyle subtitle = TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 13,
|
||||
color: AppColor.writeColor,
|
||||
fontFamily: box.read(BoxName.lang) == 'ar'
|
||||
? GoogleFonts.notoNaskhArabic().fontFamily
|
||||
: GoogleFonts.roboto().fontFamily);
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: box.read(BoxName.lang) == 'ar' ? 14 : 16,
|
||||
color: AppColor.writeColor,
|
||||
// fontFamily: box.read(BoxName.lang) == 'ar'
|
||||
// ? GoogleFonts.notoNaskhArabic().fontFamily
|
||||
// : GoogleFonts.roboto().fontFamily
|
||||
);
|
||||
static TextStyle subtitle = const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 13,
|
||||
color: AppColor.writeColor,
|
||||
// fontFamily: box.read(BoxName.lang) == 'ar'
|
||||
// ? GoogleFonts.notoNaskhArabic().fontFamily
|
||||
// : GoogleFonts.roboto().fontFamily
|
||||
);
|
||||
static TextStyle number = const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 14,
|
||||
|
||||
@@ -166,7 +166,7 @@ class RegisterController extends GetxController {
|
||||
await sendOtp(phoneNumber, randomNumber, isEgyptianNumber,
|
||||
smsEgyptController);
|
||||
}
|
||||
} else {
|
||||
} else if (phoneNumber.length > 9) {
|
||||
sendOtp(
|
||||
phoneNumber, randomNumber, isEgyptianNumber, smsEgyptController);
|
||||
}
|
||||
@@ -191,12 +191,57 @@ class RegisterController extends GetxController {
|
||||
SmsEgyptController controller) async {
|
||||
// Trim any leading or trailing whitespace from the phone number
|
||||
phoneNumber = phoneNumber.trim();
|
||||
await CRUD().post(link: AppLink.sendVerifyOtpMessage, payload: {
|
||||
var dd = await CRUD().post(link: AppLink.sendVerifyOtpMessage, payload: {
|
||||
'phone_number': phoneNumber,
|
||||
'token': otp.toString(),
|
||||
});
|
||||
Log.print('dd: ${dd}');
|
||||
if (isEgyptian) {
|
||||
await controller.sendSmsEgypt(phoneNumber, otp.toString());
|
||||
await CRUD().post(link: AppLink.updatePhoneInvalidSMSPassenger, payload: {
|
||||
"phone_number": Get.find<RegisterController>().phoneController.text
|
||||
});
|
||||
box.write(BoxName.phoneDriver, phoneController.text);
|
||||
var nameParts = box.read(BoxName.name).toString().split(' ');
|
||||
var firstName = nameParts.isNotEmpty ? nameParts[0] : 'unknown';
|
||||
var lastName = nameParts.length > 1 ? nameParts[1] : 'unknown';
|
||||
|
||||
var payload = {
|
||||
'id': box.read(BoxName.passengerID),
|
||||
'phone': phoneController.text,
|
||||
'email': box.read(BoxName.email),
|
||||
'password': 'unknown',
|
||||
'gender': 'unknown',
|
||||
'birthdate': '2002-01-01',
|
||||
'site': box.read(BoxName.passengerPhotoUrl) ?? 'unknown',
|
||||
'first_name': firstName,
|
||||
'last_name': lastName,
|
||||
};
|
||||
|
||||
var res1 = await CRUD().post(
|
||||
link: AppLink.signUp,
|
||||
payload: payload,
|
||||
);
|
||||
|
||||
if (res1 != 'failure') {
|
||||
await CRUD().post(
|
||||
link: '${AppLink.seferAlexandriaServer}/auth/signup.php',
|
||||
payload: payload,
|
||||
);
|
||||
await CRUD().post(
|
||||
link: '${AppLink.seferGizaServer}/auth/signup.php',
|
||||
payload: payload,
|
||||
);
|
||||
|
||||
box.write(BoxName.isVerified, '1');
|
||||
box.write(BoxName.isFirstTime, '0');
|
||||
box.write(BoxName.phone, phoneController.text);
|
||||
|
||||
Get.put(LoginController()).loginUsingCredentials(
|
||||
box.read(BoxName.passengerID).toString(),
|
||||
box.read(BoxName.email).toString(),
|
||||
);
|
||||
}
|
||||
// await controller.sendSmsEgypt(phoneNumber, otp.toString());
|
||||
} else {
|
||||
await CRUD().sendWhatsAppAuth(phoneNumber, otp.toString());
|
||||
}
|
||||
|
||||
@@ -214,7 +214,7 @@ class FirebaseMessagesController extends GetxController {
|
||||
driverArrivePassengerDialoge();
|
||||
|
||||
update();
|
||||
} else if (message.notification!.title! == "Cancel Trip from driver".tr) {
|
||||
} else if (message.notification!.title! == "Cancel Trip from driver") {
|
||||
Get.back();
|
||||
if (Platform.isAndroid) {
|
||||
notificationController.showNotification("Cancel Trip from driver".tr,
|
||||
@@ -243,7 +243,7 @@ class FirebaseMessagesController extends GetxController {
|
||||
// .searchNewDriverAfterRejectingFromDriver();
|
||||
);
|
||||
} else if (message.notification!.title! == 'Driver Finish Trip'.tr) {
|
||||
var myListString = message.data['passengerList'];
|
||||
var myListString = message.data['DriverList'];
|
||||
var driverList = jsonDecode(myListString) as List<dynamic>;
|
||||
if (Platform.isAndroid) {
|
||||
notificationController.showNotification(
|
||||
@@ -262,6 +262,11 @@ class FirebaseMessagesController extends GetxController {
|
||||
'rideId': driverList[1].toString(),
|
||||
'price': driverList[3].toString()
|
||||
});
|
||||
notificationController.showNotification(
|
||||
'Don’t forget your personal belongings.'.tr,
|
||||
'Please make sure you have all your personal belongings and that any remaining fare, if applicable, has been added to your wallet before leaving. Thank you for choosing the Sefer app'
|
||||
.tr,
|
||||
'ding');
|
||||
// }
|
||||
} else if (message.notification!.title! == "Finish Monitor".tr) {
|
||||
Get.defaultDialog(
|
||||
|
||||
@@ -99,7 +99,7 @@ class NotificationController extends GetxController {
|
||||
for (int day = 0; day < 7; day++) {
|
||||
// Schedule for 8:00 AM
|
||||
await _scheduleNotificationForTime(
|
||||
day, 8, 0, title, message, details, day * 1000 + 1); // Unique ID
|
||||
day, 8, 0, title, message, details, day * 1000 + 1);
|
||||
|
||||
// Schedule for 3:00 PM
|
||||
await _scheduleNotificationForTime(
|
||||
|
||||
@@ -509,6 +509,26 @@ class CRUD {
|
||||
return (jsonData['status']);
|
||||
}
|
||||
|
||||
Future<dynamic> getHereMap({
|
||||
required String link,
|
||||
}) async {
|
||||
var url = Uri.parse(link);
|
||||
try {
|
||||
var response = await http.get(url);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
// Ensure the response body is decoded as UTF-8
|
||||
var decodedBody = utf8.decode(response.bodyBytes);
|
||||
var data = jsonDecode(decodedBody);
|
||||
return data;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Future<dynamic> update({
|
||||
required String endpoint,
|
||||
required Map<String, dynamic> data,
|
||||
|
||||
@@ -11,6 +11,7 @@ import 'package:SEFER/views/widgets/elevated_btn.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
import '../../print.dart';
|
||||
import '../auth/register_controller.dart';
|
||||
import 'crud.dart';
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -58,15 +58,15 @@ class VipOrderController extends GetxController {
|
||||
tripData.value = decodedResponse['message'];
|
||||
} else {
|
||||
tripData.clear(); // Ensure empty list if no data
|
||||
mySnackeBarError('No trip data found');
|
||||
// mySnackeBarError('No trip data found');
|
||||
}
|
||||
} else {
|
||||
tripData.clear();
|
||||
mySnackeBarError('Failed to fetch trip data');
|
||||
// mySnackeBarError('Failed to fetch trip data');
|
||||
}
|
||||
} catch (e) {
|
||||
tripData.clear();
|
||||
mySnackeBarError('An error occurred: $e');
|
||||
// mySnackeBarError('An error occurred: $e');
|
||||
} finally {
|
||||
isLoading.value = false;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,13 @@ class MyTranslation extends Translations {
|
||||
@override
|
||||
Map<String, Map<String, String>> get keys => {
|
||||
"ar": {
|
||||
"Home Page": "الصفحة الرئيسية",
|
||||
"To change Language the App": "لتغيير لغة التطبيق",
|
||||
"Learn more about our app and mission":
|
||||
"تعرف على المزيد حول تطبيقنا ورسالتنا",
|
||||
"Promos For Today": "عروض اليوم",
|
||||
'Bonus gift': 'بونص', "Pay": "ادفع",
|
||||
"Get": "احصل على",
|
||||
"Send to Driver Again": "إرسال إلى السائق مرة أخرى",
|
||||
"Driver Name:": "اسم السائق:",
|
||||
'No trip data available': "لا توجد بيانات رحلة متاحة",
|
||||
@@ -79,6 +86,7 @@ class MyTranslation extends Translations {
|
||||
"Pick from map destination": "حدد وجهتك على الخريطة",
|
||||
"Pick or Tap to confirm": "حدد أو انقر للتأكيد",
|
||||
"Select Order Type": "حدد نوع الطلب",
|
||||
'Accepted your order': "تم قبول طلبك",
|
||||
"Choose who this order is for": "اختر لمن هذا الطلب",
|
||||
"Order Accepted": "تم قبول الطلب", "with type": "مع النوع",
|
||||
"accepted your order at price": "قبل طلبك بالسعر",
|
||||
@@ -473,7 +481,7 @@ iOS [https://getapp.cc/app/6458734951]
|
||||
"Go to this Target": "الانْتِقَال إِلَى هَذَا الهَدَف",
|
||||
"My Profile": "مَلَفِي الشَّخْصِي",
|
||||
"Sign Out": "تَسْجِيل الخُرُوج",
|
||||
"Home Page": "الصَّفْحَة الرَّئِيسِيَّة",
|
||||
|
||||
"Are you want to go to this site":
|
||||
"هَل تَرْغَب فِي الانْتِقَال إِلَى هَذَا المَوْقِع",
|
||||
"MyLocation": "مَوْقِعِي",
|
||||
@@ -550,11 +558,11 @@ iOS [https://getapp.cc/app/6458734951]
|
||||
"Bachelor's Degree": "بَكَالُورِيُوس",
|
||||
"Master's Degree": "مَاجِسْتِير",
|
||||
"Doctoral Degree": "دُكْتُورَاه",
|
||||
"Promos For today": "الْعُرُوض التَّرْوِيجِيَّة لِلْيَوْم",
|
||||
|
||||
"Copy this Promo to use it in your Ride!":
|
||||
"انْسَخْ هَذَا الْعَرْض لِاسْتِخْدَامِهِ فِي رِحْلَتِك!",
|
||||
"To change some Settings": "لِتَغْيِير بَعْض الإِعْدَادَات",
|
||||
"To change Language the App": "لِتَغْيِير لُغَة التَّطْبِيق",
|
||||
|
||||
"Order Request Page": "صَفْحَة طَلَب الطَّلَب",
|
||||
"Rouats of Trip": "طُرُق الرِّحْلَة",
|
||||
"Passenger Name is ": "اسْم الرَّاكِب هُوَ ",
|
||||
@@ -607,6 +615,24 @@ iOS [https://getapp.cc/app/6458734951]
|
||||
"Do you want to pay Tips for this Driver":
|
||||
"هَل تُرِيد دَفْع أُكْرَامِيَّة لِهَذَا السَّائِق؟",
|
||||
"Tip is ": " مَبْلَغ الأُكْرَامِيَّة هُوَ",
|
||||
"Are you sure to delete this location?":
|
||||
"هل أنت متأكد من حذف هذا الموقع؟",
|
||||
"deleted": "تم الحذف",
|
||||
'Trip is begin': "الرحلة قد بدأت",
|
||||
'This price is fixed even if the route changes for the driver.':
|
||||
"هذا السعر مثبت حتى لو تغير المسار للسائق",
|
||||
'The price may increase if the route changes.':
|
||||
"احتمالية زيادة السعر عند تغيير المسار",
|
||||
"The captain is responsible for the route.":
|
||||
"الكابتن مسؤول عن المسار",
|
||||
"يمكنك الاتصال أو تسجيل صوت لهذه الرحلة":
|
||||
"You can call or record audio of this trip",
|
||||
|
||||
'The trip has started! Feel free to contact emergency numbers, share your trip, or activate voice recording for the journey':
|
||||
"بدأت الرحلة! لا تتردد في الاتصال بأرقام الطوارئ، مشاركة رحلتك، أو تفعيل التسجيل الصوتي للرحلة",
|
||||
'Please make sure you have all your personal belongings and that any remaining fare, if applicable, has been added to your wallet before leaving. Thank you for choosing the Sefer app':
|
||||
'الرجاء التأكد من جميع أغراضك الشخصية وأنه تم إضافة باقي الأجرة إن وجد إلى محفظتك قبل النزول. شكرا لاختيارك تطبيق سفر',
|
||||
'Don’t forget your personal belongings.': "لا تنسى متعلقاتك الشخصية",
|
||||
"Tip is": " مَبْلَغ الأُكْرَامِيَّة هُوَ",
|
||||
"Camera Access Denied.": "تَمَّ رَفْض الْوُصُول إِلَى الْكَامِيرَا.",
|
||||
"Open Settings": "افْتَحْ الإِعْدَادَات",
|
||||
|
||||
@@ -700,8 +700,9 @@ class PaymentController extends GetxController {
|
||||
);
|
||||
// Log.print('response.message!: ${response!.responseCode!}');
|
||||
// if (response!.success == true && response.responseCode == '200') {
|
||||
if (response!.responseCode.toString() == '200' &&
|
||||
response.success == true) {
|
||||
|
||||
if (response!.success == true &&
|
||||
response!.message.toString() == 'Approved') {
|
||||
// Log.print('transactionID wewer: ${response.transactionID}');
|
||||
Toast.show(context, 'Payment Successful'.tr, AppColor.greenColor);
|
||||
method();
|
||||
|
||||
@@ -81,34 +81,28 @@ class RateController extends GetxController {
|
||||
}
|
||||
}
|
||||
await CRUD().post(
|
||||
link: "${AppLink.seferCairoServer}/rate/addRateToDriver.php",
|
||||
link: "${AppLink.seferCairoServer}/ride/rate/addRateToDriver.php",
|
||||
payload: {
|
||||
'passenger_id': box.read(BoxName.passengerID).toString(),
|
||||
'driver_id': driverId,
|
||||
'ride_id': rideId,
|
||||
'driver_id': driverId.toString(),
|
||||
'ride_id': rideId.toString(),
|
||||
'rating': selectedRateItemId.toString(),
|
||||
'comment': comment.text,
|
||||
}).then((value) {
|
||||
});
|
||||
|
||||
if (AppLink.endPoint != AppLink.seferCairoServer) {
|
||||
CRUD().post(
|
||||
link: "${AppLink.seferAlexandriaServer}/rate/addRateToDriver.php",
|
||||
link: "${AppLink.endPoint}/ride/rate/addRateToDriver.php",
|
||||
payload: {
|
||||
'passenger_id': box.read(BoxName.passengerID).toString(),
|
||||
'driver_id': driverId,
|
||||
'ride_id': rideId,
|
||||
'driver_id': driverId.toString(),
|
||||
'ride_id': rideId.toString(),
|
||||
'rating': selectedRateItemId.toString(),
|
||||
'comment': comment.text,
|
||||
});
|
||||
CRUD().post(
|
||||
link: "${AppLink.seferGizaServer}/rate/addRateToDriver.php",
|
||||
payload: {
|
||||
'passenger_id': box.read(BoxName.passengerID).toString(),
|
||||
'driver_id': driverId,
|
||||
'ride_id': rideId,
|
||||
'rating': selectedRateItemId.toString(),
|
||||
'comment': comment.text,
|
||||
});
|
||||
Get.find<MapPassengerController>().restCounter();
|
||||
Get.offAll(const MapPagePassenger());
|
||||
});
|
||||
}
|
||||
|
||||
Get.find<MapPassengerController>().restCounter();
|
||||
Get.offAll(const MapPagePassenger());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,18 +37,21 @@ class DbSql {
|
||||
latitude REAL,
|
||||
longitude REAL,
|
||||
name TEXT UNIQUE,
|
||||
rate TEXT
|
||||
rate TEXT,
|
||||
createdAt TEXT
|
||||
)
|
||||
''');
|
||||
await db.execute('DROP TABLE IF EXISTS ${TableName.recentLocations}');
|
||||
await db.execute('''
|
||||
CREATE TABLE IF NOT EXISTS ${TableName.recentLocations}(
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
latitude REAL,
|
||||
longitude REAL,
|
||||
name TEXT ,
|
||||
rate TEXT
|
||||
)
|
||||
''');
|
||||
CREATE TABLE ${TableName.recentLocations}(
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
latitude REAL,
|
||||
longitude REAL,
|
||||
name TEXT,
|
||||
rate TEXT,
|
||||
createdAt TEXT
|
||||
)
|
||||
''');
|
||||
await db.execute('''
|
||||
CREATE TABLE IF NOT EXISTS ${TableName.driverOrdersRefuse}(
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
@@ -97,6 +100,34 @@ class DbSql {
|
||||
return await db.insert(table, map);
|
||||
}
|
||||
|
||||
Future<int> insertMapLocation(Map<String, dynamic> map, String table) async {
|
||||
Database db = await instance.database;
|
||||
|
||||
// Check if the record already exists (based on latitude, longitude, and name)
|
||||
var existing = await db.query(
|
||||
table,
|
||||
where: 'latitude = ? AND longitude = ? AND name = ?',
|
||||
whereArgs: [map['latitude'], map['longitude'], map['name']],
|
||||
);
|
||||
|
||||
if (existing.isNotEmpty) {
|
||||
// If record exists, update the createdAt field with the current timestamp
|
||||
var updatedMap = Map<String, dynamic>.from(map);
|
||||
updatedMap['createdAt'] =
|
||||
DateTime.now().toIso8601String(); // Update timestamp
|
||||
return await db.update(
|
||||
table,
|
||||
updatedMap,
|
||||
where: 'id = ?',
|
||||
whereArgs: [existing.first['id']], // Update the existing row
|
||||
);
|
||||
} else {
|
||||
// If record doesn't exist, insert new record with the current timestamp
|
||||
map['createdAt'] = DateTime.now().toIso8601String();
|
||||
return await db.insert(table, map);
|
||||
}
|
||||
}
|
||||
|
||||
Future<int> updateData(Map<String, dynamic> map, String table, int id) async {
|
||||
Database db = await instance.database;
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ class RateDriverFromPassenger extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Text(
|
||||
'${'Total price to '.tr}${Get.find<MapPassengerController>().firstName}',
|
||||
'${'Total price to '.tr}${Get.find<MapPassengerController>().driverName}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Row(
|
||||
|
||||
@@ -12,6 +12,7 @@ import 'package:SEFER/constant/style.dart';
|
||||
import 'package:SEFER/main.dart';
|
||||
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
||||
import 'package:SEFER/views/widgets/my_scafold.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
|
||||
import '../../constant/info.dart';
|
||||
import '../../controller/auth/apple_signin_controller.dart';
|
||||
@@ -456,6 +457,16 @@ class LoginPage extends StatelessWidget {
|
||||
textAlign: TextAlign.center,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
// Optionally, navigate to app settings for manual permission control
|
||||
openAppSettings();
|
||||
},
|
||||
child: Text(
|
||||
"Open Settings".tr,
|
||||
style: const TextStyle(color: AppColor.blueColor),
|
||||
),
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: 'Next'.tr,
|
||||
onPressed: () async {
|
||||
|
||||
@@ -23,9 +23,9 @@ class ContactUsPage extends StatelessWidget {
|
||||
body: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
child: ListView(
|
||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
import 'package:SEFER/controller/home/home_page_controller.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/constant/colors.dart';
|
||||
import 'package:SEFER/constant/style.dart';
|
||||
import 'package:SEFER/views/lang/languages.dart';
|
||||
import 'package:SEFER/views/widgets/my_scafold.dart';
|
||||
|
||||
import 'HomePage/about_page.dart';
|
||||
import 'HomePage/frequentlyQuestionsPage.dart';
|
||||
@@ -18,121 +16,108 @@ class HomePage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(HomePageController());
|
||||
return MyScafolld(
|
||||
isleading: true,
|
||||
title: 'Home Page'.tr,
|
||||
body: [
|
||||
ListView(
|
||||
return CupertinoPageScaffold(
|
||||
navigationBar: CupertinoNavigationBar(
|
||||
middle: Text('Home Page'.tr),
|
||||
leading: CupertinoButton(
|
||||
padding: EdgeInsets.zero,
|
||||
child: const Icon(CupertinoIcons.back),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
),
|
||||
child: SafeArea(
|
||||
child: ListView(
|
||||
children: [
|
||||
ListTile(
|
||||
CupertinoListTile(
|
||||
onTap: () {
|
||||
Get.to(() => const Language());
|
||||
},
|
||||
title: Text(
|
||||
'Language'.tr,
|
||||
style: AppStyle.headTitle2,
|
||||
),
|
||||
subtitle: Text(
|
||||
'To change Language the App'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
trailing: const Icon(
|
||||
Icons.arrow_forward_ios,
|
||||
size: 30,
|
||||
color: AppColor.primaryColor,
|
||||
),
|
||||
leading: const Icon(
|
||||
Icons.language_sharp,
|
||||
color: AppColor.primaryColor,
|
||||
),
|
||||
leading: const Icon(CupertinoIcons.globe,
|
||||
color: CupertinoColors.activeBlue),
|
||||
title: Text('Language'.tr),
|
||||
subtitle: Text('To change Language the App'.tr),
|
||||
trailing: const CupertinoListTileChevron(),
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.location_city_outlined),
|
||||
title: Text(
|
||||
'Change Country'.tr,
|
||||
style: AppStyle.headTitle2,
|
||||
),
|
||||
subtitle: Text(
|
||||
'You can change the Country to get all features'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
onTap: () => Get.to(MyScafolld(
|
||||
title: 'Change Country'.tr,
|
||||
body: [CountryPickerFromSetting()],
|
||||
isleading: true)),
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.question_answer),
|
||||
title: Text(
|
||||
'Frequently Questions'.tr,
|
||||
style: AppStyle.headTitle2,
|
||||
),
|
||||
subtitle: Text(
|
||||
'You can change the Country to get all features'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
onTap: () => Get.to(() => const FrequentlyQuestionsPage()),
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.vibration),
|
||||
title: GetBuilder<HomePageController>(builder: (controller) {
|
||||
return SwitchListTile(
|
||||
title: Text(
|
||||
'Vibration'.tr,
|
||||
style: AppStyle.headTitle2,
|
||||
CupertinoListTile(
|
||||
onTap: () {
|
||||
Get.to(CupertinoPageScaffold(
|
||||
navigationBar: CupertinoNavigationBar(
|
||||
middle: Text('Change Country'.tr),
|
||||
),
|
||||
value: controller.isVibrate,
|
||||
onChanged: controller.changeVibrateOption,
|
||||
activeColor: AppColor.primaryColor,
|
||||
);
|
||||
}),
|
||||
subtitle: Text(
|
||||
"You can change the vibration feedback for all buttons".tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
onTap: () => Get.to(() => const FrequentlyQuestionsPage()),
|
||||
child: SafeArea(
|
||||
child: CountryPickerFromSetting(),
|
||||
),
|
||||
));
|
||||
},
|
||||
leading: const Icon(CupertinoIcons.location,
|
||||
color: CupertinoColors.activeBlue),
|
||||
title: Text('Change Country'.tr),
|
||||
subtitle:
|
||||
Text('You can change the Country to get all features'.tr),
|
||||
trailing: const CupertinoListTileChevron(),
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.record_voice_over_outlined),
|
||||
title: Text(
|
||||
'Trips recorded'.tr,
|
||||
style: AppStyle.headTitle2,
|
||||
),
|
||||
subtitle: Text(
|
||||
'Here recorded trips audio'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
onTap: () async {
|
||||
Get.to(() => TripsRecordedPage());
|
||||
}),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.account_balance_outlined),
|
||||
title: Text(
|
||||
'About Us'.tr,
|
||||
style: AppStyle.headTitle2,
|
||||
),
|
||||
subtitle: Text(
|
||||
'You can change the Country to get all features'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
onTap: () => Get.to(() => const AboutPage()),
|
||||
CupertinoListTile(
|
||||
onTap: () {
|
||||
Get.to(() => const FrequentlyQuestionsPage());
|
||||
},
|
||||
leading: const Icon(CupertinoIcons.question,
|
||||
color: CupertinoColors.activeBlue),
|
||||
title: Text('Frequently Questions'.tr),
|
||||
subtitle: Text('Find answers to common questions'.tr),
|
||||
trailing: const CupertinoListTileChevron(),
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.share),
|
||||
title: Text(
|
||||
'Share App'.tr,
|
||||
style: AppStyle.headTitle2,
|
||||
CupertinoListTile(
|
||||
leading: const Icon(Icons.vibration,
|
||||
color: CupertinoColors.activeBlue),
|
||||
title: Text('Vibration'.tr),
|
||||
trailing: GetBuilder<HomePageController>(
|
||||
builder: (controller) {
|
||||
return CupertinoSwitch(
|
||||
value: controller.isVibrate,
|
||||
onChanged: controller.changeVibrateOption,
|
||||
);
|
||||
},
|
||||
),
|
||||
subtitle: Text(
|
||||
'You can share the SEFER App with your friends and earn rewards for rides they take using your code'
|
||||
.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
onTap: () => Get.to(() => ShareAppPage()),
|
||||
'You can change the vibration feedback for all buttons'.tr),
|
||||
),
|
||||
CupertinoListTile(
|
||||
onTap: () {
|
||||
Get.to(() => const TripsRecordedPage());
|
||||
},
|
||||
leading: const Icon(CupertinoIcons.mic_circle,
|
||||
color: CupertinoColors.activeBlue),
|
||||
title: Text('Trips recorded'.tr),
|
||||
subtitle: Text('Here recorded trips audio'.tr),
|
||||
trailing: const CupertinoListTileChevron(),
|
||||
),
|
||||
CupertinoListTile(
|
||||
onTap: () {
|
||||
Get.to(() => const AboutPage());
|
||||
},
|
||||
leading: const Icon(CupertinoIcons.info_circle,
|
||||
color: CupertinoColors.activeBlue),
|
||||
title: Text('About Us'.tr),
|
||||
subtitle: Text('Learn more about our app and mission'.tr),
|
||||
trailing: const CupertinoListTileChevron(),
|
||||
),
|
||||
CupertinoListTile(
|
||||
onTap: () {
|
||||
Get.to(() => ShareAppPage());
|
||||
},
|
||||
leading: const Icon(CupertinoIcons.share,
|
||||
color: CupertinoColors.activeBlue),
|
||||
title: Text('Share App'.tr),
|
||||
subtitle: Text(
|
||||
'You can share the SEFER App with your friends and earn rewards for rides they take using your code'
|
||||
.tr),
|
||||
trailing: const CupertinoListTileChevron(),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,6 +66,7 @@ class MapPagePassenger extends StatelessWidget {
|
||||
const RideBeginPassenger(),
|
||||
const VipRideBeginPassenger(),
|
||||
const RideFromStartApp(),
|
||||
|
||||
cancelRidePage(),
|
||||
const MenuIconMapPageWidget(),
|
||||
PointsPageForRider()
|
||||
@@ -85,7 +86,7 @@ class CancelRidePageShow extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder<MapPassengerController>(
|
||||
builder: (controller) =>
|
||||
(controller.data.isNotEmpty && controller.remainingTime > 0)
|
||||
(controller.data.isNotEmpty && controller.statusRide != 'Begin')
|
||||
// ||
|
||||
// controller.timeToPassengerFromDriverAfterApplied == 0
|
||||
? Positioned(
|
||||
|
||||
@@ -17,6 +17,21 @@ class ApplyOrderWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Color _parseColor(String colorHex) {
|
||||
if (colorHex.isEmpty) {
|
||||
return Colors.grey; // Fallback for empty color
|
||||
}
|
||||
|
||||
// Ensure the string starts with '0xff' for ARGB format
|
||||
String processedHex = colorHex.replaceFirst('#', '0xff').trim();
|
||||
|
||||
if (!processedHex.startsWith('0xff')) {
|
||||
processedHex = '0xff$processedHex'; // Add '0xff' if missing
|
||||
}
|
||||
|
||||
return Color(int.parse(processedHex));
|
||||
}
|
||||
|
||||
return GetBuilder<MapPassengerController>(builder: (controller) {
|
||||
if (controller.statusRide == 'Apply' &&
|
||||
controller.isSearchingWindow == false) {
|
||||
@@ -108,36 +123,43 @@ class ApplyOrderWidget extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Image.asset(
|
||||
box.read(BoxName.carType) == 'Comfort'
|
||||
? 'assets/images/blob.png'
|
||||
: box.read(BoxName.carType) == 'Lady'
|
||||
? 'assets/images/lady.png' // Assuming there's an image for Lady
|
||||
: box.read(BoxName.carType) == 'Speed'
|
||||
? 'assets/images/carspeed.png'
|
||||
: box.read(BoxName.carType) ==
|
||||
'Scooter'
|
||||
? 'assets/images/moto.png'
|
||||
: box.read(BoxName.carType) ==
|
||||
'Mishwar Vip'
|
||||
? 'assets/images/freeRide.png'
|
||||
: box.read(BoxName
|
||||
.carType) ==
|
||||
'Awfar Car'
|
||||
? 'assets/images/balash.png'
|
||||
: box.read(BoxName
|
||||
.carType) ==
|
||||
'Pink Bike'
|
||||
? 'assets/images/pinkBike.png'
|
||||
: box.read(BoxName
|
||||
.carType) ==
|
||||
'Rayeh Gai'
|
||||
? 'assets/images/roundtrip.png'
|
||||
: 'assets/images/carspeed.png', // Default image if none of the above
|
||||
width: 80,
|
||||
),
|
||||
// ColorFiltered(
|
||||
// colorFilter: ColorFilter.mode(
|
||||
// _parseColor(controller.colorHex),
|
||||
// BlendMode.srcIn,
|
||||
// ),
|
||||
// child: Image.asset(
|
||||
// box.read(BoxName.carType) == 'Comfort'
|
||||
// ? 'assets/images/blob.png'
|
||||
// : box.read(BoxName.carType) == 'Lady'
|
||||
// ? 'assets/images/lady.png' // Assuming there's an image for Lady
|
||||
// : box.read(BoxName.carType) == 'Speed'
|
||||
// ? 'assets/images/carspeed.png'
|
||||
// : box.read(BoxName.carType) ==
|
||||
// 'Scooter'
|
||||
// ? 'assets/images/moto.png'
|
||||
// : box.read(BoxName.carType) ==
|
||||
// 'Mishwar Vip'
|
||||
// ? 'assets/images/freeRide.png'
|
||||
// : box.read(BoxName
|
||||
// .carType) ==
|
||||
// 'Awfar Car'
|
||||
// ? 'assets/images/balash.png'
|
||||
// : box.read(BoxName
|
||||
// .carType) ==
|
||||
// 'Pink Bike'
|
||||
// ? 'assets/images/pinkBike.png'
|
||||
// : box.read(BoxName
|
||||
// .carType) ==
|
||||
// 'Rayeh Gai'
|
||||
// ? 'assets/images/roundtrip.png'
|
||||
// : 'assets/images/carspeed.png', // Default image if none of the above
|
||||
// width: 80,
|
||||
// ),
|
||||
// ),
|
||||
|
||||
Column(
|
||||
children: [
|
||||
Text(
|
||||
@@ -152,14 +174,31 @@ class ApplyOrderWidget extends StatelessWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Text(
|
||||
// 'Black',
|
||||
controller.carColor,
|
||||
controller.carColor.toString(),
|
||||
style: AppStyle.title,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
ColorFiltered(
|
||||
colorFilter: ColorFilter.mode(
|
||||
_parseColor(controller.colorHex),
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
child: Image.asset(
|
||||
box.read(BoxName.carType) == 'Scooter' ||
|
||||
box.read(BoxName.carType) ==
|
||||
'Pink Bike'
|
||||
? 'assets/images/moto.png'
|
||||
: 'assets/images/car3.png',
|
||||
width: 80,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Padding(
|
||||
@@ -218,7 +257,7 @@ class ApplyOrderWidget extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
// 'fadi ahmad',
|
||||
controller.firstName,
|
||||
controller.driverName,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
|
||||
@@ -242,109 +242,127 @@ GetBuilder<MapPassengerController> formSearchPlacesDestenation() {
|
||||
// )
|
||||
// : const SizedBox(),
|
||||
Container(
|
||||
height: controller.placesDestination.isNotEmpty
|
||||
? controller.height
|
||||
: 0,
|
||||
color: AppColor.secondaryColor,
|
||||
child: ListView.builder(
|
||||
itemCount: controller.placesDestination.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
var res = controller.placesDestination[index];
|
||||
return InkWell(
|
||||
onTap: () async {
|
||||
controller.changeHeightPlaces();
|
||||
await sql.insertData({
|
||||
'latitude': res['geometry']['location']['lat'],
|
||||
'longitude': res['geometry']['location']['lng'],
|
||||
'name': res['name'].toString(),
|
||||
'rate': res['rating'].toString(),
|
||||
}, TableName.recentLocations);
|
||||
height: controller.placesDestination.isNotEmpty
|
||||
? controller.height
|
||||
: 0,
|
||||
color: AppColor.secondaryColor,
|
||||
child: ListView.builder(
|
||||
itemCount: controller.placesDestination.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
var res = controller.placesDestination[index];
|
||||
|
||||
controller.changeHeightPlaces();
|
||||
// Extract fields with null safety
|
||||
var title = res['title']?.toString() ?? 'Unknown Place';
|
||||
var position = res['position'];
|
||||
var latitude = position?['lat'];
|
||||
var longitude = position?['lng'];
|
||||
var address =
|
||||
res['address']?['label'] ?? 'Unknown Address';
|
||||
var categories = res['categories'] ?? [];
|
||||
var primaryCategory = categories.isNotEmpty
|
||||
? categories[0]['name']
|
||||
: 'Unknown Category';
|
||||
|
||||
controller.passengerLocation = controller.newMyLocation;
|
||||
controller.myDestination = LatLng(
|
||||
double.parse(
|
||||
res['geometry']['location']['lat'].toString()),
|
||||
double.parse(
|
||||
res['geometry']['location']['lng'].toString()),
|
||||
);
|
||||
controller.convertHintTextDestinationNewPlaces(index);
|
||||
return InkWell(
|
||||
onTap: () async {
|
||||
if (latitude != null && longitude != null) {
|
||||
sql.insertMapLocation({
|
||||
'latitude': latitude,
|
||||
'longitude': longitude,
|
||||
'name': title,
|
||||
'rate': 'N/A',
|
||||
'createdAt': DateTime.now().toIso8601String(),
|
||||
// No rating in this structure, adjust as needed
|
||||
}, TableName.recentLocations);
|
||||
|
||||
controller.placesDestination = [];
|
||||
controller.placeDestinationController.clear();
|
||||
controller.changeMainBottomMenuMap();
|
||||
controller.passengerStartLocationFromMap = true;
|
||||
controller.isPickerShown = true;
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
Image.network(
|
||||
res['icon'],
|
||||
width: 20,
|
||||
controller.passengerLocation =
|
||||
controller.newMyLocation;
|
||||
controller.myDestination =
|
||||
LatLng(latitude, longitude);
|
||||
controller
|
||||
.convertHintTextDestinationNewPlaces(index);
|
||||
|
||||
controller.placesDestination = [];
|
||||
controller.placeDestinationController.clear();
|
||||
controller.changeMainBottomMenuMap();
|
||||
controller.passengerStartLocationFromMap = true;
|
||||
controller.isPickerShown = true;
|
||||
} else {
|
||||
Toast.show(
|
||||
context,
|
||||
'Invalid location data',
|
||||
AppColor.redColor,
|
||||
);
|
||||
}
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
const Icon(Icons.place,
|
||||
size: 20), // Fallback icon for places
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
if (latitude != null &&
|
||||
longitude != null) {
|
||||
await sql.insertMapLocation({
|
||||
'latitude': latitude,
|
||||
'longitude': longitude,
|
||||
'name': title,
|
||||
'rate': 'N/A',
|
||||
}, TableName.placesFavorite);
|
||||
Toast.show(
|
||||
context,
|
||||
'$title ${'Saved Successfully'.tr}',
|
||||
AppColor.primaryColor,
|
||||
);
|
||||
} else {
|
||||
Toast.show(
|
||||
context,
|
||||
'Invalid location data',
|
||||
AppColor.redColor,
|
||||
);
|
||||
}
|
||||
},
|
||||
icon: const Icon(Icons.favorite_border),
|
||||
),
|
||||
],
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
address,
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
Text(
|
||||
primaryCategory,
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
],
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
await sql.insertData({
|
||||
'latitude': res['geometry']
|
||||
['location']['lat'],
|
||||
'longitude': res['geometry']
|
||||
['location']['lng'],
|
||||
'name': res['name'].toString(),
|
||||
'rate': res['rating'].toString(),
|
||||
}, TableName.placesFavorite);
|
||||
Toast.show(
|
||||
context,
|
||||
'${res['name']} ${'Saved Sucssefully'.tr}',
|
||||
AppColor.primaryColor);
|
||||
},
|
||||
icon: const Icon(Icons.favorite_border),
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Text(
|
||||
res['name'].toString(),
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
res['vicinity'].toString(),
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Text(
|
||||
'rate',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
Text(
|
||||
res['rating'].toString(),
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
const Divider(
|
||||
thickness: 1,
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
const Divider(thickness: 1),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
)
|
||||
);
|
||||
},
|
||||
))
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ GetBuilder<MapPassengerController> formSearchPlacesStart() {
|
||||
// controller.myLocation =
|
||||
// controller.newStartPointLocation;
|
||||
// }
|
||||
await sql.insertData({
|
||||
await sql.insertMapLocation({
|
||||
'latitude': res['geometry']['location']['lat'],
|
||||
'longitude': res['geometry']['location']['lng'],
|
||||
'name': res['name'].toString(),
|
||||
@@ -130,7 +130,7 @@ GetBuilder<MapPassengerController> formSearchPlacesStart() {
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
await sql.insertData({
|
||||
await sql.insertMapLocation({
|
||||
'latitude': res['geometry']
|
||||
['location']['lat'],
|
||||
'longitude': res['geometry']
|
||||
|
||||
@@ -109,7 +109,7 @@ GetBuilder<MapPassengerController> formSearchPlaces(int index) {
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
await sql.insertData({
|
||||
await sql.insertMapLocation({
|
||||
'latitude': res['geometry']
|
||||
['location']['lat'],
|
||||
'longitude': res['geometry']
|
||||
|
||||
@@ -8,7 +8,7 @@ import '../../../controller/home/map_passenger_controller.dart';
|
||||
import '../../../controller/home/vip_waitting_page.dart';
|
||||
|
||||
GetBuilder<MapPassengerController> leftMainMenuIcons() {
|
||||
final textToSpeechController = Get.put(TextToSpeechController());
|
||||
Get.put(TextToSpeechController());
|
||||
return GetBuilder<MapPassengerController>(
|
||||
builder: (controller) => Positioned(
|
||||
top: Get.height * .008,
|
||||
@@ -108,7 +108,9 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
|
||||
// borderRadius: BorderRadius.circular(15)),
|
||||
// child: IconButton(
|
||||
// onPressed: () async {
|
||||
// print(Get.put(MapPassengerController()).data);
|
||||
// controller.statusRide == 'Apply' &&
|
||||
// controller.isSearchingWindow == false;
|
||||
// controller.update();
|
||||
// },
|
||||
// icon: const Icon(
|
||||
// Octicons
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import 'package:SEFER/views/widgets/my_dialog.dart';
|
||||
import 'package:SEFER/views/widgets/my_textField.dart';
|
||||
import 'package:SEFER/views/widgets/mysnakbar.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -14,6 +16,7 @@ import '../../../constant/colors.dart';
|
||||
import '../../../constant/table_names.dart';
|
||||
import '../../../controller/functions/toast.dart';
|
||||
import '../../../controller/functions/tts.dart';
|
||||
import '../../../print.dart';
|
||||
import 'form_search_start.dart';
|
||||
|
||||
class MainBottomMenuMap extends StatelessWidget {
|
||||
@@ -46,24 +49,34 @@ class MainBottomMenuMap extends StatelessWidget {
|
||||
child: Container(
|
||||
width: Get.width * .8,
|
||||
height: Get.height * .1,
|
||||
decoration: const BoxDecoration(
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Color.fromARGB(
|
||||
255, 237, 230, 230),
|
||||
blurRadius: 5,
|
||||
offset: Offset(2, 4)),
|
||||
BoxShadow(
|
||||
color: Color.fromARGB(
|
||||
255, 242, 237, 237),
|
||||
blurRadius: 5,
|
||||
offset: Offset(-2, -2))
|
||||
],
|
||||
color: AppColor.blueColor,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.elliptical(15, 30),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 20, vertical: 10),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
AppColor.blueColor.withOpacity(0.8),
|
||||
AppColor.blueColor.withOpacity(0.6),
|
||||
],
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
),
|
||||
boxShadow: const [
|
||||
BoxShadow(
|
||||
color: Color.fromARGB(
|
||||
255, 237, 230, 230),
|
||||
blurRadius: 8,
|
||||
offset: Offset(4, 8),
|
||||
),
|
||||
BoxShadow(
|
||||
color: Color.fromARGB(
|
||||
255, 242, 237, 237),
|
||||
blurRadius: 8,
|
||||
offset: Offset(-4, -4),
|
||||
),
|
||||
],
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
),
|
||||
|
||||
// decoration: AppStyle.boxDecoration1,
|
||||
child: DefaultTextStyle(
|
||||
style: AppStyle.title.copyWith(
|
||||
@@ -350,6 +363,18 @@ class MainBottomMenuMap extends StatelessWidget {
|
||||
},
|
||||
));
|
||||
},
|
||||
onLongPress: () {
|
||||
MyDialog().getDialog(
|
||||
"Are you sure to delete this location?".tr, '', () {
|
||||
sql.deleteData(TableName.recentLocations,
|
||||
controller.recentPlaces[index]['id']);
|
||||
|
||||
controller.getFavioratePlaces();
|
||||
controller.update();
|
||||
Get.back();
|
||||
mySnackbarSuccess('deleted'.tr);
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: Padding(
|
||||
|
||||
@@ -53,7 +53,7 @@ class RideBeginPassenger extends StatelessWidget {
|
||||
Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
child: Text(
|
||||
controller.firstName,
|
||||
controller.driverName,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import 'package:SEFER/views/widgets/my_dialog.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
@@ -12,11 +11,8 @@ import '../../../controller/functions/toast.dart';
|
||||
import '../../../controller/home/payment/credit_card_controller.dart';
|
||||
import '../../../controller/payment/payment_controller.dart';
|
||||
import '../../../main.dart';
|
||||
import '../../../models/model/painter_copoun.dart';
|
||||
import '../../../print.dart';
|
||||
import '../../widgets/elevated_btn.dart';
|
||||
import '../../widgets/my_scafold.dart';
|
||||
import '../../widgets/my_textField.dart';
|
||||
import 'passenger_wallet_dialoge.dart';
|
||||
|
||||
class PassengerWallet extends StatelessWidget {
|
||||
@@ -51,33 +47,33 @@ class PassengerWallet extends StatelessWidget {
|
||||
},
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 80, vertical: 10),
|
||||
child: MyElevatedButton(
|
||||
kolor: AppColor.yellowColor,
|
||||
title: 'Bounus gift'.tr,
|
||||
onPressed: () {
|
||||
Get.dialog(
|
||||
AlertDialog(
|
||||
contentPadding: EdgeInsets
|
||||
.zero, // Removes the padding around the content
|
||||
content: SizedBox(
|
||||
width: 300, // Match the width of PromoBanner
|
||||
// height: 250, // Match the height of PromoBanner
|
||||
child: PromoBanner(
|
||||
promoCode: box.read(BoxName.promo),
|
||||
discountPercentage: box.read(BoxName.discount),
|
||||
validity: box.read(BoxName.validity),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
Log.print(
|
||||
'box.read(BoxName.isGiftToken).toString(): ${box.read(BoxName.isGiftToken).toString()}');
|
||||
},
|
||||
),
|
||||
)
|
||||
// Padding(
|
||||
// padding:
|
||||
// const EdgeInsets.symmetric(horizontal: 80, vertical: 10),
|
||||
// child: MyElevatedButton(
|
||||
// kolor: AppColor.yellowColor,
|
||||
// title: 'Bonus gift'.tr,
|
||||
// onPressed: () {
|
||||
// Get.dialog(
|
||||
// AlertDialog(
|
||||
// contentPadding: EdgeInsets
|
||||
// .zero, // Removes the padding around the content
|
||||
// content: SizedBox(
|
||||
// width: 300, // Match the width of PromoBanner
|
||||
// // height: 250, // Match the height of PromoBanner
|
||||
// child: PromoBanner(
|
||||
// promoCode: box.read(BoxName.promo),
|
||||
// discountPercentage: box.read(BoxName.discount),
|
||||
// validity: box.read(BoxName.validity),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// );
|
||||
// Log.print(
|
||||
// 'box.read(BoxName.isGiftToken).toString(): ${box.read(BoxName.isGiftToken).toString()}');
|
||||
// },
|
||||
// ),
|
||||
// )
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -98,7 +94,8 @@ class PassengerWallet extends StatelessWidget {
|
||||
MyElevatedButton(
|
||||
title: 'Show Promos to Charge'.tr,
|
||||
onPressed: () {
|
||||
controller.changePromoSheetDialogue();
|
||||
// controller.changePromoSheetDialogue();
|
||||
showPaymentBottomSheet(context);
|
||||
},
|
||||
),
|
||||
const SizedBox(
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import 'package:SEFER/constant/style.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/constant/box_name.dart';
|
||||
import 'package:SEFER/constant/colors.dart';
|
||||
@@ -89,6 +91,147 @@ class PassengerWalletDialog extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
// class PassengerWalletDialog extends StatelessWidget {
|
||||
// const PassengerWalletDialog({
|
||||
// super.key,
|
||||
// });
|
||||
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// return GetBuilder<PaymentController>(
|
||||
// builder: (controller) {
|
||||
// return Positioned(
|
||||
// top: Get.height * .1,
|
||||
// right: Get.width * .15,
|
||||
// left: Get.width * .15,
|
||||
// bottom: Get.height * .1,
|
||||
// child: controller.isPromoSheetDialogue
|
||||
// ? Container()
|
||||
// : SizedBox
|
||||
// .shrink(), // If condition is false, return an empty widget
|
||||
// );
|
||||
// },
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
void showPaymentBottomSheet(BuildContext context) {
|
||||
final controller = Get.find<PaymentController>();
|
||||
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
isScrollControlled: true,
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.vertical(top: Radius.circular(15.0)),
|
||||
),
|
||||
builder: (BuildContext context) {
|
||||
return WillPopScope(
|
||||
onWillPop: () async {
|
||||
Get.back();
|
||||
return false;
|
||||
},
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Text(
|
||||
'Select Payment Amount'.tr,
|
||||
style: AppStyle.headTitle2,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const SizedBox(height: 16.0),
|
||||
|
||||
// Payment Options List
|
||||
_buildPaymentOption(
|
||||
context: context,
|
||||
controller: controller,
|
||||
amount: box.read(BoxName.countryCode) == 'Egypt' ? 100 : 10,
|
||||
bonusAmount: 0,
|
||||
currency: box.read(BoxName.countryCode) == 'Egypt'
|
||||
? 'LE'.tr
|
||||
: 'JOD'.tr,
|
||||
),
|
||||
|
||||
const SizedBox(height: 8.0),
|
||||
_buildPaymentOption(
|
||||
context: context,
|
||||
controller: controller,
|
||||
amount: box.read(BoxName.countryCode) == 'Egypt' ? 200 : 20,
|
||||
bonusAmount: box.read(BoxName.countryCode) == 'Egypt' ? 5 : 1,
|
||||
currency: box.read(BoxName.countryCode) == 'Egypt'
|
||||
? 'LE'.tr
|
||||
: 'JOD'.tr,
|
||||
),
|
||||
|
||||
const SizedBox(height: 8.0),
|
||||
_buildPaymentOption(
|
||||
context: context,
|
||||
controller: controller,
|
||||
amount: box.read(BoxName.countryCode) == 'Egypt' ? 400 : 40,
|
||||
bonusAmount:
|
||||
box.read(BoxName.countryCode) == 'Egypt' ? 15 : 2.5,
|
||||
currency: box.read(BoxName.countryCode) == 'Egypt'
|
||||
? 'LE'.tr
|
||||
: 'JOD'.tr,
|
||||
),
|
||||
|
||||
const SizedBox(height: 8.0),
|
||||
_buildPaymentOption(
|
||||
context: context,
|
||||
controller: controller,
|
||||
amount: box.read(BoxName.countryCode) == 'Egypt' ? 1000 : 50,
|
||||
bonusAmount: box.read(BoxName.countryCode) == 'Egypt' ? 100 : 6,
|
||||
currency: box.read(BoxName.countryCode) == 'Egypt'
|
||||
? 'LE'.tr
|
||||
: 'JOD'.tr,
|
||||
),
|
||||
|
||||
const SizedBox(height: 16.0),
|
||||
TextButton(
|
||||
onPressed: () => Get.back(),
|
||||
child: Text('Cancel'.tr),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildPaymentOption({
|
||||
required BuildContext context,
|
||||
required PaymentController controller,
|
||||
required int amount,
|
||||
required double bonusAmount,
|
||||
required String currency,
|
||||
}) {
|
||||
return Material(
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
controller.updateSelectedAmount(amount);
|
||||
Get.back();
|
||||
showPaymentOptions(context, controller);
|
||||
},
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(vertical: 12.0, horizontal: 16.0),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: Colors.grey[300]!),
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
child: Text(
|
||||
bonusAmount > 0
|
||||
? '${'Pay'.tr} $amount $currency, ${'Get'.tr} ${amount + bonusAmount} $currency'
|
||||
: '$amount $currency',
|
||||
style: AppStyle.title,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void showPaymentOptions(BuildContext context, PaymentController controller) {
|
||||
showCupertinoModalPopup(
|
||||
@@ -209,7 +352,8 @@ void showPaymentOptions(BuildContext context, PaymentController controller) {
|
||||
cancelButton: CupertinoActionSheetAction(
|
||||
child: Text('Cancel'.tr),
|
||||
onPressed: () {
|
||||
controller.changePromoSheetDialogue();
|
||||
// controller.changePromoSheetDialogue();
|
||||
Get.back();
|
||||
},
|
||||
),
|
||||
),
|
||||
|
||||
@@ -20,211 +20,211 @@ class PromosPassengerPage extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(PromosController());
|
||||
return MyScafolld(
|
||||
title: 'Promos For today'.tr,
|
||||
title: "Promos For Today".tr,
|
||||
isleading: true,
|
||||
body: [
|
||||
GetBuilder<PromosController>(
|
||||
builder: (orderHistoryController) => orderHistoryController.isLoading
|
||||
? const MyCircularProgressIndicator()
|
||||
: ListView.builder(
|
||||
itemCount: orderHistoryController.promoList.length +
|
||||
1, // Adding 1 for the ad
|
||||
itemCount: orderHistoryController
|
||||
.promoList.length, // Adding 1 for the ad
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
if (index == 0) {
|
||||
// Ad at the beginning
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Container(
|
||||
height: 120, // Adjust the height of the ad container
|
||||
decoration: BoxDecoration(
|
||||
color:
|
||||
Colors.grey[200], // Background color for the ad
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: Center(
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
height: Get.height * .19,
|
||||
child: ListView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
children: [
|
||||
PointsCaptain(
|
||||
kolor: AppColor.greyColor,
|
||||
pricePoint:
|
||||
box.read(BoxName.countryCode) ==
|
||||
'Jordan'
|
||||
? 5
|
||||
: 100,
|
||||
countPoint:
|
||||
box.read(BoxName.countryCode) ==
|
||||
'Jordan'
|
||||
? '300'
|
||||
: '100',
|
||||
),
|
||||
PointsCaptain(
|
||||
kolor: AppColor.bronze,
|
||||
pricePoint:
|
||||
box.read(BoxName.countryCode) ==
|
||||
'Jordan'
|
||||
? 10
|
||||
: 200,
|
||||
countPoint:
|
||||
box.read(BoxName.countryCode) ==
|
||||
'Jordan'
|
||||
? '1040'
|
||||
: '210',
|
||||
),
|
||||
PointsCaptain(
|
||||
kolor: AppColor.goldenBronze,
|
||||
pricePoint:
|
||||
box.read(BoxName.countryCode) ==
|
||||
'Jordan'
|
||||
? 22
|
||||
: 400,
|
||||
countPoint:
|
||||
box.read(BoxName.countryCode) ==
|
||||
'Jordan'
|
||||
? '2300'
|
||||
: '450',
|
||||
),
|
||||
PointsCaptain(
|
||||
kolor: AppColor.gold,
|
||||
pricePoint:
|
||||
box.read(BoxName.countryCode) ==
|
||||
'Jordan'
|
||||
? 50
|
||||
: 1000,
|
||||
countPoint:
|
||||
box.read(BoxName.countryCode) ==
|
||||
'Jordan'
|
||||
? '55000'
|
||||
: '1200',
|
||||
),
|
||||
],
|
||||
)),
|
||||
),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
// Promo items
|
||||
final rides = orderHistoryController.promoList[index - 1];
|
||||
// if (index == 0) {
|
||||
// // Ad at the beginning
|
||||
// return Padding(
|
||||
// padding: const EdgeInsets.all(8.0),
|
||||
// child: Container(
|
||||
// height: 120, // Adjust the height of the ad container
|
||||
// decoration: BoxDecoration(
|
||||
// color:
|
||||
// Colors.grey[200], // Background color for the ad
|
||||
// borderRadius: BorderRadius.circular(10),
|
||||
// ),
|
||||
// child: Center(
|
||||
// child: Container(
|
||||
// decoration: AppStyle.boxDecoration,
|
||||
// height: Get.height * .19,
|
||||
// child: ListView(
|
||||
// scrollDirection: Axis.horizontal,
|
||||
// children: [
|
||||
// PointsCaptain(
|
||||
// kolor: AppColor.greyColor,
|
||||
// pricePoint:
|
||||
// box.read(BoxName.countryCode) ==
|
||||
// 'Jordan'
|
||||
// ? 5
|
||||
// : 100,
|
||||
// countPoint:
|
||||
// box.read(BoxName.countryCode) ==
|
||||
// 'Jordan'
|
||||
// ? '300'
|
||||
// : '100',
|
||||
// ),
|
||||
// PointsCaptain(
|
||||
// kolor: AppColor.bronze,
|
||||
// pricePoint:
|
||||
// box.read(BoxName.countryCode) ==
|
||||
// 'Jordan'
|
||||
// ? 10
|
||||
// : 200,
|
||||
// countPoint:
|
||||
// box.read(BoxName.countryCode) ==
|
||||
// 'Jordan'
|
||||
// ? '1040'
|
||||
// : '210',
|
||||
// ),
|
||||
// PointsCaptain(
|
||||
// kolor: AppColor.goldenBronze,
|
||||
// pricePoint:
|
||||
// box.read(BoxName.countryCode) ==
|
||||
// 'Jordan'
|
||||
// ? 22
|
||||
// : 400,
|
||||
// countPoint:
|
||||
// box.read(BoxName.countryCode) ==
|
||||
// 'Jordan'
|
||||
// ? '2300'
|
||||
// : '450',
|
||||
// ),
|
||||
// PointsCaptain(
|
||||
// kolor: AppColor.gold,
|
||||
// pricePoint:
|
||||
// box.read(BoxName.countryCode) ==
|
||||
// 'Jordan'
|
||||
// ? 50
|
||||
// : 1000,
|
||||
// countPoint:
|
||||
// box.read(BoxName.countryCode) ==
|
||||
// 'Jordan'
|
||||
// ? '55000'
|
||||
// : '1200',
|
||||
// ),
|
||||
// ],
|
||||
// )),
|
||||
// ),
|
||||
// ),
|
||||
// );
|
||||
// } else {
|
||||
// Promo items
|
||||
final rides = orderHistoryController.promoList[index];
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: CupertinoColors.systemGrey6,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color:
|
||||
CupertinoColors.systemGrey.withOpacity(0.5),
|
||||
blurRadius: 8,
|
||||
offset: Offset(0, 4),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {},
|
||||
child: AnimatedTextKit(
|
||||
animatedTexts: [
|
||||
ScaleAnimatedText(
|
||||
rides['promo_code'],
|
||||
textStyle:
|
||||
AppStyle.title.copyWith(
|
||||
fontSize:
|
||||
32, // Increased font size for emphasis
|
||||
color: CupertinoColors
|
||||
.activeBlue,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: CupertinoColors.systemGrey6,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color:
|
||||
CupertinoColors.systemGrey.withOpacity(0.5),
|
||||
blurRadius: 8,
|
||||
offset: Offset(0, 4),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {},
|
||||
child: AnimatedTextKit(
|
||||
animatedTexts: [
|
||||
ScaleAnimatedText(
|
||||
rides['promo_code'],
|
||||
textStyle:
|
||||
AppStyle.title.copyWith(
|
||||
fontSize:
|
||||
32, // Increased font size for emphasis
|
||||
color:
|
||||
CupertinoColors.activeBlue,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
WavyAnimatedText(
|
||||
rides['promo_code'],
|
||||
textStyle:
|
||||
AppStyle.title.copyWith(
|
||||
fontSize:
|
||||
32, // Increased font size for emphasis
|
||||
color: CupertinoColors
|
||||
.activeBlue,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
WavyAnimatedText(
|
||||
rides['promo_code'],
|
||||
textStyle:
|
||||
AppStyle.title.copyWith(
|
||||
fontSize:
|
||||
32, // Increased font size for emphasis
|
||||
color:
|
||||
CupertinoColors.activeBlue,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
],
|
||||
isRepeatingAnimation: true,
|
||||
),
|
||||
),
|
||||
],
|
||||
isRepeatingAnimation: true,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
// Description Text
|
||||
Text(
|
||||
rides['description'],
|
||||
style: AppStyle.title.copyWith(
|
||||
fontSize: 22,
|
||||
color: CupertinoColors.systemGrey,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
// Only displaying end date
|
||||
Text(
|
||||
'${'Valid Until:'.tr} ${rides['validity_end_date']}',
|
||||
style: AppStyle.subtitle.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 20,
|
||||
color: CupertinoColors.systemGrey,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
// const SizedBox(height: 16),
|
||||
// Copy Promo Text
|
||||
Center(
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
Clipboard.setData(ClipboardData(
|
||||
text: rides['promo_code']));
|
||||
Get.snackbar(
|
||||
'Promo Copied!'.tr,
|
||||
'You have copied the promo code.'.tr,
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
backgroundColor:
|
||||
CupertinoColors.systemGrey,
|
||||
colorText: CupertinoColors.white,
|
||||
);
|
||||
},
|
||||
child: Text(
|
||||
'Copy Code'.tr,
|
||||
textAlign: TextAlign.center,
|
||||
style: AppStyle.headTitle2.copyWith(
|
||||
color: CupertinoColors.systemBlue,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
// Description Text
|
||||
Text(
|
||||
rides['description'],
|
||||
style: AppStyle.title.copyWith(
|
||||
fontSize: 22,
|
||||
color: CupertinoColors.systemGrey,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
// Only displaying end date
|
||||
Text(
|
||||
'${'Valid Until:'.tr} ${rides['validity_end_date']}',
|
||||
style: AppStyle.subtitle.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 20,
|
||||
color: CupertinoColors.systemGrey,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
// const SizedBox(height: 16),
|
||||
// Copy Promo Text
|
||||
Center(
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
Clipboard.setData(ClipboardData(
|
||||
text: rides['promo_code']));
|
||||
Get.snackbar(
|
||||
'Promo Copied!'.tr,
|
||||
'You have copied the promo code.'.tr,
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
backgroundColor:
|
||||
CupertinoColors.systemGrey,
|
||||
colorText: CupertinoColors.white,
|
||||
);
|
||||
},
|
||||
child: Text(
|
||||
'Copy Code'.tr,
|
||||
textAlign: TextAlign.center,
|
||||
style: AppStyle.headTitle2.copyWith(
|
||||
color: CupertinoColors.systemBlue,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
),
|
||||
);
|
||||
// }
|
||||
},
|
||||
),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user