This commit is contained in:
Hamza-Ayed
2024-12-24 17:35:15 +03:00
parent 1e0e4a5b48
commit 1cbf0183d1
56 changed files with 3081 additions and 2560 deletions

View File

@@ -1,7 +1,6 @@
import 'package:SEFER/constant/style.dart';
import 'package:SEFER/controller/auth/register_controller.dart';
import 'package:SEFER/views/widgets/elevated_btn.dart';
import 'package:SEFER/views/widgets/my_dialog.dart';
import 'package:SEFER/views/widgets/my_scafold.dart';
import 'package:SEFER/views/widgets/my_textField.dart';
import 'package:flutter/material.dart';

View File

@@ -1,8 +1,7 @@
import 'package:SEFER/constant/box_name.dart';
import 'package:SEFER/main.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';
class AboutPage extends StatelessWidget {
const AboutPage({super.key});
@@ -15,136 +14,219 @@ class AboutPage extends StatelessWidget {
),
child: SafeArea(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
// Company Logo
Center(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Padding(
padding: const EdgeInsets.all(20.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
// Company Logo
Center(
child: Image.asset(
'assets/images/logo.png', // Replace with your logo image asset path
height: 100.0,
width: 100.0,
'assets/images/logo.gif', // Replace with your logo image asset path
height: 80.0,
),
),
),
const SizedBox(height: 20),
// Company Name and Location
Padding(
padding: const EdgeInsets.all(16.0),
child: Text(
'SEFER LLC\n${box.read(BoxName.countryCode).toString().tr}',
style:
CupertinoTheme.of(context).textTheme.textStyle.copyWith(
fontSize: 22.0,
fontWeight: FontWeight.bold,
),
// Company Name and Introduction
Text(
'SEFER LLC',
style: CupertinoTheme.of(context).textTheme.navTitleTextStyle,
textAlign: TextAlign.center,
),
),
// About Us Description
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: Text(
'SEFER is a ride-sharing app designed with your safety and affordability in mind. We connect you with reliable drivers in your area, ensuring a convenient and stress-free travel experience.\n\nHere are some of the key features that set us apart:'
const SizedBox(height: 8),
Text(
'Egypt\'s pioneering ride-sharing service, proudly developed by Arabian and local owners. We prioritize being near you both our valued passengers and our dedicated captains.'
.tr,
style:
CupertinoTheme.of(context).textTheme.textStyle.copyWith(
fontSize: 16.0,
),
style: CupertinoTheme.of(context).textTheme.textStyle,
textAlign: TextAlign.center,
),
),
const SizedBox(height: 30),
const SizedBox(height: 20),
// Key Features Section
Text(
'Why Choose SEFER?'.tr,
style: CupertinoTheme.of(context).textTheme.navTitleTextStyle,
textAlign: TextAlign.center,
),
const SizedBox(height: 15),
// Security Features
Padding(
padding: const EdgeInsets.symmetric(horizontal: 24.0),
child: Column(
// Nearest Availability
Row(
children: [
const Icon(CupertinoIcons.location_solid,
color: CupertinoColors.activeBlue),
const SizedBox(width: 10),
Expanded(
child: Text(
'Closest to You'.tr,
style: CupertinoTheme.of(context).textTheme.textStyle,
),
),
],
),
const SizedBox(height: 10),
Text(
'We connect you with the nearest drivers for faster pickups and quicker journeys.'
.tr,
style: CupertinoTheme.of(context)
.textTheme
.textStyle
.copyWith(color: CupertinoColors.secondaryLabel),
),
const SizedBox(height: 20),
// High-Level Security
Row(
children: [
const Icon(CupertinoIcons.shield_fill,
color: CupertinoColors.activeGreen),
const SizedBox(width: 10),
Expanded(
child: Text(
'Uncompromising Security'.tr,
style: CupertinoTheme.of(context).textTheme.textStyle,
),
),
],
),
const SizedBox(height: 10),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
const Icon(CupertinoIcons.lock_fill,
color: CupertinoColors.activeBlue),
const SizedBox(width: 8.0),
Expanded(
child: Text(
'Most Secure Methods'.tr,
style: CupertinoTheme.of(context)
.textTheme
.textStyle
.copyWith(
fontSize: 16.0,
fontWeight: FontWeight.w500,
),
),
const Icon(CupertinoIcons.person_2_fill,
size: 18, color: CupertinoColors.activeGreen),
const SizedBox(width: 5),
Text(
'Lady Captains Available'.tr,
style: CupertinoTheme.of(context)
.textTheme
.textStyle
.copyWith(fontSize: 15),
),
],
),
const SizedBox(height: 8.0),
const SizedBox(height: 5),
Row(
children: [
const Icon(CupertinoIcons.phone_fill,
color: CupertinoColors.activeBlue),
const SizedBox(width: 8.0),
Expanded(
child: Text(
'In-App VOIP Calls'.tr,
style: CupertinoTheme.of(context)
.textTheme
.textStyle
.copyWith(
fontSize: 16.0,
fontWeight: FontWeight.w500,
),
),
),
],
),
const SizedBox(height: 8.0),
Row(
children: [
const Icon(CupertinoIcons.videocam_fill,
color: CupertinoColors.activeBlue),
const SizedBox(width: 8.0),
Expanded(
child: Text(
'Recorded Trips for Safety'.tr,
style: CupertinoTheme.of(context)
.textTheme
.textStyle
.copyWith(
fontSize: 16.0,
fontWeight: FontWeight.w500,
),
),
const Icon(CupertinoIcons.recordingtape,
size: 18, color: CupertinoColors.activeGreen),
const SizedBox(width: 5),
Text(
'Recorded Trips (Voice & AI Analysis)'.tr,
style: CupertinoTheme.of(context)
.textTheme
.textStyle
.copyWith(fontSize: 15),
),
],
),
],
),
),
const SizedBox(height: 20),
// Affordability Highlight
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: Text(
'\nWe also prioritize affordability, offering competitive pricing to make your rides accessible.'
.tr,
style:
CupertinoTheme.of(context).textTheme.textStyle.copyWith(
fontSize: 16.0,
fontWeight: FontWeight.w500,
),
textAlign: TextAlign.center,
// Fast Support
Row(
children: [
const Icon(CupertinoIcons.bolt_horizontal_fill,
color: CupertinoColors.systemOrange),
const SizedBox(width: 10),
Expanded(
child: Text(
'Fastest Complaint Response'.tr,
style: CupertinoTheme.of(context).textTheme.textStyle,
),
),
],
),
),
const SizedBox(height: 10),
Text(
'Our dedicated customer service team ensures swift resolution of any issues.'
.tr,
style: CupertinoTheme.of(context)
.textTheme
.textStyle
.copyWith(color: CupertinoColors.secondaryLabel),
),
const SizedBox(height: 20),
const SizedBox(height: 20),
],
// Affordable Pricing
Row(
children: [
const Icon(CupertinoIcons.money_dollar_circle_fill,
color: CupertinoColors.activeBlue),
const SizedBox(width: 10),
Expanded(
child: Text(
'Affordable for Everyone'.tr,
style: CupertinoTheme.of(context).textTheme.textStyle,
),
),
],
),
const SizedBox(height: 10),
Text(
'Enjoy competitive prices across all trip options, making travel accessible.'
.tr,
style: CupertinoTheme.of(context)
.textTheme
.textStyle
.copyWith(color: CupertinoColors.secondaryLabel),
),
const SizedBox(height: 20),
// Trip Options
Row(
children: [
const Icon(CupertinoIcons.car_detailed,
color: CupertinoColors.systemPurple),
const SizedBox(width: 10),
Expanded(
child: Text(
'Variety of Trip Choices'.tr,
style: CupertinoTheme.of(context).textTheme.textStyle,
),
),
],
),
const SizedBox(height: 10),
Text(
'Choose the trip option that perfectly suits your needs and preferences.'
.tr,
style: CupertinoTheme.of(context)
.textTheme
.textStyle
.copyWith(color: CupertinoColors.secondaryLabel),
),
const SizedBox(height: 20),
// Passenger Choice
Row(
children: [
Icon(CupertinoIcons.hand_draw_fill,
color: CupertinoColors.systemGreen),
const SizedBox(width: 10),
Expanded(
child: Text(
'Your Choice, Our Priority'.tr,
style: CupertinoTheme.of(context).textTheme.textStyle,
),
),
],
),
const SizedBox(height: 10),
Text(
'Because we are near, you have the flexibility to choose the ride that works best for you.'
.tr,
style: CupertinoTheme.of(context)
.textTheme
.textStyle
.copyWith(color: CupertinoColors.secondaryLabel),
),
],
),
),
),
),

View File

@@ -1,146 +1,228 @@
import 'package:SEFER/controller/home/map_passenger_controller.dart';
import 'package:SEFER/views/widgets/my_scafold.dart';
import 'package:SEFER/views/home/HomePage/contact_us.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../constant/style.dart';
class FrequentlyQuestionsPage extends StatelessWidget {
const FrequentlyQuestionsPage({super.key});
void _showAnswerDialog(BuildContext context, String question, String answer) {
showCupertinoDialog(
context: context,
builder: (BuildContext context) => CupertinoAlertDialog(
title: Text(question,
style: const TextStyle(
fontWeight: FontWeight.bold, color: Colors.indigo)),
content: Text(answer),
actions: <CupertinoDialogAction>[
CupertinoDialogAction(
isDefaultAction: true,
onPressed: () {
Navigator.of(context).pop();
},
child: const Text('Close'),
),
],
),
);
}
@override
Widget build(BuildContext context) {
String selectedPayment = 'cash'; // Replace with your initial selection
bool canCancelRide = false;
return MyScafolld(
title: 'Frequently Questions'.tr,
body: [
Padding(
padding: const EdgeInsets.all(8.0),
child: ListView(
children: [
// Question 1: How do I request a ride?
ExpansionTile(
title: Text(
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
backgroundColor: Colors.indigo,
middle: Text(
'Frequently Asked Questions'.tr,
style: const TextStyle(color: Colors.white),
),
),
child: SafeArea(
child: ListView(
children: <Widget>[
CupertinoListSection.insetGrouped(
header: Text(
'Getting Started'.tr,
style: const TextStyle(fontWeight: FontWeight.bold),
),
children: <CupertinoListTile>[
CupertinoListTile(
leading: const Icon(
CupertinoIcons.car_detailed,
color: Colors.indigo,
),
title: Text('How do I request a ride?'.tr),
trailing: const CupertinoListTileChevron(),
onTap: () => _showAnswerDialog(
context,
'How do I request a ride?'.tr,
style: AppStyle.title,
),
children: [
Text(
'Step-by-step instructions on how to request a ride through the Sefer app.'
.tr,
style: AppStyle.title,
),
],
),
// Question 2: What types of vehicles are available?
ExpansionTile(
title: Text(
'What types of vehicles are available?'.tr,
style: AppStyle.title,
),
children: [
Text(
'Sefer offers a variety of vehicle options to suit your needs, including economy, comfort, and luxury. Choose the option that best fits your budget and passenger count.'
.tr,
style: AppStyle.title,
),
],
),
// Question 3: How can I pay for my ride?
ExpansionTile(
title: Text(
'How can I pay for my ride?'.tr,
style: AppStyle.title,
),
children: [
Text(
'Sefer offers multiple payment methods for your convenience. Choose between cash payment or credit/debit card payment during ride confirmation.'
.tr,
style: AppStyle.title,
),
],
),
// Question 4: Can I cancel my ride? (if applicable)
ExpansionTile(
title: Text(
'Can I cancel my ride?'.tr,
style: AppStyle.title,
),
children: [
Text(
'Yes, you can cancel your ride under certain conditions (e.g., before driver is assigned). See the Sefer cancellation policy for details.'
.tr,
style: AppStyle.title,
),
],
),
// Question 5 & 6: Driver-specific questions
ExpansionTile(
title: Text(
'Driver Registration & Requirements'.tr,
style: AppStyle.title,
),
children: [
Text(
'${'How can I register as a driver?'.tr}\n${'What are the requirements to become a driver?'.tr}',
style: AppStyle.title,
),
InkWell(
onTap: () {
Get.find<MapPassengerController>()
.getDialog('title', 'midTitle', () {
; //todo add in this dialog papers for driver
});
},
child: Text(
'Visit our website or contact Sefer support for information on driver registration and requirements.'
.tr,
style: AppStyle.title,
),
),
],
),
// Question 7: How do I communicate with the other party?
ExpansionTile(
title: Text(
'How do I communicate with the other party (passenger/driver)?'
'Simply open the Sefer app, enter your destination, and tap "Request Ride". The app will connect you with a nearby driver.'
.tr,
style: AppStyle.title,
),
children: [
Text(
'Sefer provides in-app chat functionality to allow you to communicate with your driver or passenger during your ride.'
.tr,
style: AppStyle.title,
),
],
),
// Question 8: What safety measures does Sefer offer?
ExpansionTile(
title: Text(
'What safety measures does Sefer offer?'.tr,
style: AppStyle.title,
),
children: [
Text(
'Sefer prioritizes your safety. We offer features like driver verification, in-app trip tracking, and emergency contact options.'
.tr,
style: AppStyle.title,
),
],
),
],
),
)
],
isleading: true);
CupertinoListSection.insetGrouped(
header: Text(
'Vehicle Options'.tr,
style: const TextStyle(fontWeight: FontWeight.bold),
),
children: <CupertinoListTile>[
CupertinoListTile(
leading: const Icon(
CupertinoIcons.car_fill,
color: Colors.blue,
),
title: Text('What types of vehicles are available?'.tr),
trailing: const CupertinoListTileChevron(),
onTap: () => _showAnswerDialog(
context,
'What types of vehicles are available?'.tr,
'Sefer offers a variety of options including Economy, Comfort, and Luxury to suit your needs and budget.'
.tr,
),
),
],
),
CupertinoListSection.insetGrouped(
header: Text(
'Payments'.tr,
style: const TextStyle(fontWeight: FontWeight.bold),
),
children: <CupertinoListTile>[
CupertinoListTile(
leading: const Icon(
CupertinoIcons.creditcard,
color: Colors.green,
),
title: Text('How can I pay for my ride?'.tr),
trailing: const CupertinoListTileChevron(),
onTap: () => _showAnswerDialog(
context,
'How can I pay for my ride?'.tr,
'You can pay for your ride using cash or credit/debit card. You can select your preferred payment method before confirming your ride.'
.tr,
),
),
],
),
CupertinoListSection.insetGrouped(
header: Text(
'Ride Management'.tr,
style: const TextStyle(fontWeight: FontWeight.bold),
),
children: <CupertinoListTile>[
CupertinoListTile(
leading: const Icon(
CupertinoIcons.xmark_circle_fill,
color: Colors.red,
),
title: Text('Can I cancel my ride?'.tr),
trailing: const CupertinoListTileChevron(),
onTap: () => _showAnswerDialog(
context,
'Can I cancel my ride?'.tr,
'Yes, you can cancel your ride, but please note that cancellation fees may apply depending on how far in advance you cancel.'
.tr,
),
),
],
),
CupertinoListSection.insetGrouped(
header: Text(
'For Drivers'.tr,
style: const TextStyle(fontWeight: FontWeight.bold),
),
children: <CupertinoListTile>[
CupertinoListTile(
leading: const Icon(
CupertinoIcons.person_crop_circle_fill,
color: Colors.orange,
),
title: Text('Driver Registration & Requirements'.tr),
trailing: const CupertinoListTileChevron(),
onTap: () => showCupertinoDialog(
context: context,
builder: (BuildContext context) => CupertinoAlertDialog(
title: Text('Driver Registration'.tr,
style: const TextStyle(
fontWeight: FontWeight.bold,
color: Colors.indigo)),
content: Text(
'To register as a driver or learn about the requirements, please visit our website or contact Sefer support directly.'
.tr),
actions: <CupertinoDialogAction>[
CupertinoDialogAction(
isDefaultAction: true,
onPressed: () {
Get.to(() => ContactUsPage());
// Optionally, you can open a URL here
},
child: Text('Visit Website/Contact Support'.tr),
),
CupertinoDialogAction(
onPressed: () {
Navigator.of(context).pop();
},
child: Text('Close'.tr),
),
],
),
),
),
],
),
CupertinoListSection.insetGrouped(
header: Text(
'Communication'.tr,
style: const TextStyle(fontWeight: FontWeight.bold),
),
children: <CupertinoListTile>[
CupertinoListTile(
leading: const Icon(
CupertinoIcons.chat_bubble_2_fill,
color: Colors.purple,
),
title: Text(
'How do I communicate with the other party (passenger/driver)?'
.tr),
trailing: const CupertinoListTileChevron(),
onTap: () => _showAnswerDialog(
context,
'How do I communicate with the other party (passenger/driver)?'
.tr,
'You can communicate with your driver or passenger through the in-app chat feature once a ride is confirmed.'
.tr,
),
),
],
),
CupertinoListSection.insetGrouped(
header: Text(
'Safety & Security'.tr,
style: const TextStyle(fontWeight: FontWeight.bold),
),
children: <CupertinoListTile>[
CupertinoListTile(
leading: const Icon(
CupertinoIcons.shield_fill,
color: Colors.teal,
),
title: Text('What safety measures does Sefer offer?'.tr),
trailing: const CupertinoListTileChevron(),
onTap: () => _showAnswerDialog(
context,
'What safety measures does Sefer offer?'.tr,
'Sefer offers various safety features including driver verification, in-app trip tracking, emergency contact options, and the ability to share your trip status with trusted contacts.'
.tr,
),
),
],
),
const SizedBox(height: 20), // Add some bottom padding
],
),
),
);
}
}

View File

@@ -50,7 +50,7 @@ class MapPagePassenger extends StatelessWidget {
buttomSheetMapPage(),
CarDetailsTypeToChoose(),
const HeaderDestination(),
// const HeaderDestination(),
const BurcMoney(),
const PromoCode(),
const ApplyOrderWidget(), const MapMenuWidget(),
@@ -67,7 +67,7 @@ class MapPagePassenger extends StatelessWidget {
const VipRideBeginPassenger(),
const RideFromStartApp(),
cancelRidePage(),
// cancelRidePage(),
const MenuIconMapPageWidget(),
PointsPageForRider()
],

View File

@@ -5,6 +5,14 @@ import 'package:SEFER/constant/style.dart';
import 'package:SEFER/controller/home/map_passenger_controller.dart';
import '../../widgets/elevated_btn.dart';
void showCancelRideBottomSheet() {
Get.bottomSheet(
cancelRidePage(),
backgroundColor: Colors.transparent,
isScrollControlled: true,
);
}
GetBuilder<MapPassengerController> cancelRidePage() {
Get.put(MapPassengerController());
@@ -19,78 +27,73 @@ GetBuilder<MapPassengerController> cancelRidePage() {
return GetBuilder<MapPassengerController>(
builder: (controller) => controller.isCancelRidePageShown
? Positioned(
left: 20,
top: Get.height * 0.15,
right: 20,
bottom: Get.height * 0.15,
child: Container(
padding: const EdgeInsets.all(20),
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.2),
offset: const Offset(0, 8),
blurRadius: 16,
),
],
borderRadius: BorderRadius.circular(20),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'Can we know why you want to cancel Ride ?'.tr,
style: AppStyle.title
.copyWith(fontSize: 18, fontWeight: FontWeight.bold),
textAlign: TextAlign.center,
),
const SizedBox(height: 20),
Expanded(
child: ListView.separated(
itemCount: reasons.length,
separatorBuilder: (context, index) => const Divider(),
itemBuilder: (context, index) {
return ListTile(
title: Text(
reasons[index],
style: AppStyle.title.copyWith(fontSize: 16),
),
leading: Radio(
value: index,
groupValue: controller.selectedReason,
onChanged: (int? value) {
controller.selectReason(value!, reasons[index]);
},
activeColor: AppColor.primaryColor,
),
onTap: () {
controller.selectReason(index, reasons[index]);
? Container(
height: Get.height * 0.6,
padding: const EdgeInsets.all(20),
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.2),
offset: const Offset(0, 8),
blurRadius: 16,
),
],
borderRadius: BorderRadius.circular(20),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'Can we know why you want to cancel Ride ?'.tr,
style: AppStyle.title
.copyWith(fontSize: 18, fontWeight: FontWeight.bold),
textAlign: TextAlign.center,
),
const SizedBox(height: 20),
Expanded(
child: ListView.separated(
itemCount: reasons.length,
separatorBuilder: (context, index) => const Divider(),
itemBuilder: (context, index) {
return ListTile(
title: Text(
reasons[index],
style: AppStyle.title.copyWith(fontSize: 16),
),
leading: Radio(
value: index,
groupValue: controller.selectedReason,
onChanged: (int? value) {
controller.selectReason(value!, reasons[index]);
},
);
},
),
),
const SizedBox(height: 20),
MyElevatedButton(
title: 'Cancel Ride'.tr,
onPressed: () {
if (controller.selectedReason == -1) {
Get.snackbar(
'You Should be select reason.'.tr,
'',
snackPosition: SnackPosition.BOTTOM,
backgroundColor: AppColor.redColor,
colorText: Colors.white,
);
} else {
controller.cancelRide();
}
activeColor: AppColor.primaryColor,
),
onTap: () {
controller.selectReason(index, reasons[index]);
},
);
},
),
],
),
),
const SizedBox(height: 20),
MyElevatedButton(
title: 'Cancel Ride'.tr,
onPressed: () {
if (controller.selectedReason == -1) {
Get.snackbar(
'You Should be select reason.'.tr,
'',
snackPosition: SnackPosition.BOTTOM,
backgroundColor: AppColor.redColor,
colorText: Colors.white,
);
} else {
controller.cancelRide();
}
},
),
],
),
)
: const SizedBox(),

File diff suppressed because it is too large Load Diff

View File

@@ -116,7 +116,7 @@ GetBuilder<MapPassengerController> formSearchPlacesDestenation() {
controller.newStartPointLocation;
controller.changeMainBottomMenuMap();
await controller.getMap(
await controller.getDirectionMap(
'${controller.passengerLocation.latitude},${controller.passengerLocation.longitude}',
'${latLng.latitude},${latLng.longitude}',
);
@@ -191,7 +191,7 @@ GetBuilder<MapPassengerController> formSearchPlacesDestenation() {
controller.changeMainBottomMenuMap();
// controller.newMyLocation = latLng;
await controller.getMap(
await controller.getDirectionMap(
'${controller.passengerLocation.latitude},${controller.passengerLocation.longitude}',
'${latLng.latitude},${latLng.longitude}',
);

View File

@@ -108,6 +108,7 @@ GetBuilder<MapPassengerController> formSearchPlacesStart() {
'longitude': res['geometry']['location']['lng'],
'name': res['name'].toString(),
'rate': res['rating'].toString(),
'createdAt': DateTime.now().toIso8601String(),
}, TableName.recentLocations);
controller.convertHintTextStartNewPlaces(index);

View File

@@ -1,4 +1,3 @@
import 'package:SEFER/views/widgets/my_dialog.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
@@ -7,8 +6,8 @@ import 'package:SEFER/controller/home/points_for_rider_controller.dart';
import '../../../constant/colors.dart';
import '../../../constant/style.dart';
import '../../../controller/home/map_passenger_controller.dart';
import '../../widgets/elevated_btn.dart';
import '../../widgets/mycircular.dart';
import '../../widgets/mydialoug.dart';
class GoogleMapPassengerWidget extends StatelessWidget {
GoogleMapPassengerWidget({
@@ -34,7 +33,7 @@ class GoogleMapPassengerWidget extends StatelessWidget {
() async {
controller.clearPolyline();
if (controller.dataCarsLocationByPassenger != null) {
await controller.getMap(
await controller.getDirectionMap(
'${controller.passengerLocation.latitude},${controller.passengerLocation.longitude}',
'${argument.latitude.toString()},${argument.longitude.toString()}');
@@ -230,6 +229,7 @@ class GoogleMapPassengerWidget extends StatelessWidget {
target: controller.passengerLocation,
zoom: 15,
),
markers: controller.markers.toSet(),
// {
// if (controller.statusRide != 'Apply' ||
@@ -319,86 +319,88 @@ class GoogleMapPassengerWidget extends StatelessWidget {
// ),
// },
polygons: controller.polygons,
polylines: {
Polyline(
zIndex: 2,
consumeTapEvents: true,
geodesic: true,
endCap: Cap.buttCap,
startCap: Cap.buttCap,
visible: true,
polylineId: const PolylineId('route'),
points: controller.polylineCoordinates,
color: AppColor.primaryColor,
width: 5,
),
polylines: controller.polyLines.toSet(),
// {
// Polyline(
// polylineId: const PolylineId('route'),
// points: controller.polylineCoordinates,
// color: AppColor.primaryColor,
// width: 4,
// // patterns: [
// // PatternItem.dot,
// // PatternItem.gap(10),
// // ],
// endCap: Cap.roundCap,
// startCap: Cap.roundCap,
// geodesic: true,
// ),
Polyline(
zIndex: 1,
consumeTapEvents: true,
geodesic: true,
endCap: Cap.buttCap,
startCap: Cap.buttCap,
visible: true,
polylineId: const PolylineId('route0'),
points: controller.polylineCoordinatesPointsAll[0],
color: AppColor.blueColor,
width: 5,
),
Polyline(
zIndex: 2,
consumeTapEvents: true,
geodesic: true,
endCap: Cap.buttCap,
startCap: Cap.buttCap,
visible: true,
polylineId: const PolylineId('route1'),
points: controller.polylineCoordinatesPointsAll[1],
color: AppColor.yellowColor,
width: 5,
),
Polyline(
zIndex: 2,
consumeTapEvents: true,
geodesic: true,
endCap: Cap.buttCap,
startCap: Cap.buttCap,
visible: true,
polylineId: const PolylineId('route2'),
points: controller.polylineCoordinatesPointsAll[2],
color: AppColor.greenColor,
width: 5,
),
Polyline(
zIndex: 2,
consumeTapEvents: true,
geodesic: true,
endCap: Cap.buttCap,
startCap: Cap.buttCap,
visible: true,
polylineId: const PolylineId('route3'),
points: controller.polylineCoordinatesPointsAll[2],
color: AppColor.deepPurpleAccent,
width: 5,
),
// Polyline(
// zIndex: 2,
// consumeTapEvents: true,
// geodesic: true,
// endCap: Cap.buttCap,
// startCap: Cap.buttCap,
// visible: true,
// polylineId: PolylineId('g'),
// points: [
// LatLng(controller.southwest.latitude,
// controller.southwest.longitude),
// LatLng(controller.northeast.latitude,
// controller.northeast.longitude)
// ],
// color: AppColor.primaryColor,
// width: 5,
// ),
},
// Polyline(
// zIndex: 1,
// consumeTapEvents: true,
// geodesic: true,
// endCap: Cap.buttCap,
// startCap: Cap.buttCap,
// visible: true,
// polylineId: const PolylineId('route0'),
// points: controller.polylineCoordinatesPointsAll[0],
// color: AppColor.blueColor,
// width: 5,
// ),
// Polyline(
// zIndex: 2,
// consumeTapEvents: true,
// geodesic: true,
// endCap: Cap.buttCap,
// startCap: Cap.buttCap,
// visible: true,
// polylineId: const PolylineId('route1'),
// points: controller.polylineCoordinatesPointsAll[1],
// color: AppColor.yellowColor,
// width: 5,
// ),
// Polyline(
// zIndex: 2,
// consumeTapEvents: true,
// geodesic: true,
// endCap: Cap.buttCap,
// startCap: Cap.buttCap,
// visible: true,
// polylineId: const PolylineId('route2'),
// points: controller.polylineCoordinatesPointsAll[2],
// color: AppColor.greenColor,
// width: 5,
// ),
// Polyline(
// zIndex: 2,
// consumeTapEvents: true,
// geodesic: true,
// endCap: Cap.buttCap,
// startCap: Cap.buttCap,
// visible: true,
// polylineId: const PolylineId('route3'),
// points: controller.polylineCoordinatesPointsAll[2],
// color: AppColor.deepPurpleAccent,
// width: 5,
// ),
// // Polyline(
// // zIndex: 2,
// // consumeTapEvents: true,
// // geodesic: true,
// // endCap: Cap.buttCap,
// // startCap: Cap.buttCap,
// // visible: true,
// // polylineId: PolylineId('g'),
// // points: [
// // LatLng(controller.southwest.latitude,
// // controller.southwest.longitude),
// // LatLng(controller.northeast.latitude,
// // controller.northeast.longitude)
// // ],
// // color: AppColor.primaryColor,
// // width: 5,
// // ),
// },
// circles: {
// Circle(
// circleId: const CircleId('kk'),

View File

@@ -1,8 +1,10 @@
import 'package:SEFER/main.dart';
import 'package:flutter/material.dart';
import 'package:flutter_font_icons/flutter_font_icons.dart';
import 'package:get/get.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import '../../../constant/colors.dart';
import '../../../constant/table_names.dart';
import '../../../controller/functions/tts.dart';
import '../../../controller/home/map_passenger_controller.dart';
import '../../../controller/home/vip_waitting_page.dart';
@@ -99,26 +101,26 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
),
),
),
// AnimatedContainer(
// duration: const Duration(microseconds: 200),
// width: controller.widthMapTypeAndTraffic,
// decoration: BoxDecoration(
// color: AppColor.secondaryColor,
// border: Border.all(),
// borderRadius: BorderRadius.circular(15)),
// child: IconButton(
// onPressed: () async {
// controller.statusRide == 'Apply' &&
// controller.isSearchingWindow == false;
// controller.update();
// },
// icon: const Icon(
// Octicons
// .telescope, // Replace this with your desired VIP icon
// size: 29,
// ),
// ),
// ),
// AnimatedContainer(
// duration: const Duration(microseconds: 200),
// width: controller.widthMapTypeAndTraffic,
// decoration: BoxDecoration(
// color: AppColor.secondaryColor,
// border: Border.all(),
// borderRadius: BorderRadius.circular(15)),
// child: IconButton(
// onPressed: () async {
// final result = await sql.getCustomQuery('''
// SELECT * FROM ${TableName.recentLocations} ORDER BY createdAt DESC
// ''');
// },
// icon: const Icon(
// Octicons
// .telescope, // Replace this with your desired VIP icon
// size: 29,
// ),
// ),
// ),
],
);
})),

View File

@@ -1,6 +1,4 @@
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';
@@ -16,7 +14,8 @@ import '../../../constant/colors.dart';
import '../../../constant/table_names.dart';
import '../../../controller/functions/toast.dart';
import '../../../controller/functions/tts.dart';
import '../../../print.dart';
import '../../widgets/error_snakbar.dart';
import '../../widgets/mydialoug.dart';
import 'form_search_start.dart';
class MainBottomMenuMap extends StatelessWidget {
@@ -352,7 +351,7 @@ class MainBottomMenuMap extends StatelessWidget {
onPressed: () async {
Get.back();
await controller.getLocation();
await controller.getMap(
await controller.getDirectionMap(
'${controller.passengerLocation.latitude},${controller.passengerLocation.longitude}',
'${controller.recentPlaces[index]['latitude']},${controller.recentPlaces[index]['longitude']}',
);
@@ -402,7 +401,7 @@ class MainBottomMenuMap extends StatelessWidget {
controller.newMyLocation = controller.newStartPointLocation;
controller.changeMainBottomMenuMap();
await controller.getMap(
await controller.getDirectionMap(
'${controller.newStartPointLocation.latitude},${controller.newStartPointLocation.longitude}',
'${controller.myDestination.latitude},${controller.myDestination.longitude}',
);
@@ -632,7 +631,7 @@ class FaviouratePlacesDialog extends StatelessWidget {
onPressed: () async {
Get.back();
await controller.getLocation();
await controller.getMap(
await controller.getDirectionMap(
'${controller.passengerLocation.latitude},${controller.passengerLocation.longitude}',
'${favoritePlaces[index]['latitude']},${favoritePlaces[index]['longitude']}',
);

View File

@@ -16,7 +16,7 @@ import '../../../constant/colors.dart';
import '../../../controller/home/map_passenger_controller.dart';
import '../../notification/notification_page.dart';
import '../../widgets/icon_widget_menu.dart';
import '../home_page.dart';
import '../setting_page.dart';
import '../profile/passenger_profile_page.dart';
class MapMenuWidget extends StatelessWidget {
@@ -73,12 +73,12 @@ class MapMenuWidget extends StatelessWidget {
title: 'Home'.tr,
onpressed: () {
Get.to(
() => const HomePage(),
() => const SettingPage(),
transition: Transition.downToUp,
curve: Curves.easeInOutExpo,
);
},
icon: Icons.home),
icon: Icons.settings),
],
)
: const SizedBox(), // Choose the desired overlay color

View File

@@ -133,7 +133,7 @@ class PickerAnimtionContainerFormPlaces extends StatelessWidget {
TextButton(
onPressed: () async {
await controller
.getMap(
.getDirectionMap(
'${controller.passengerLocation.latitude},${controller.passengerLocation.longitude}',
'${favoritePlaces[index]['latitude']},${favoritePlaces[index]['longitude']}',
);
@@ -191,7 +191,7 @@ class PickerAnimtionContainerFormPlaces extends StatelessWidget {
MyElevatedButton(
title: 'Go to this Target'.tr,
onPressed: () async {
await controller.getMap(
await controller.getDirectionMap(
'${controller.passengerLocation.latitude},${controller.passengerLocation.longitude}',
'${controller.newMyLocation.latitude},${controller.newMyLocation.longitude}',
);

View File

@@ -8,121 +8,6 @@ import 'package:SEFER/views/widgets/my_textField.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../constant/links.dart';
// class SearchingCaptainWindow extends StatelessWidget {
// const SearchingCaptainWindow({super.key});
// Widget _buildDriverAvatars(MapPassengerController controller) {
// // If no drivers yet, show loading indicator
// if (controller.isSearchingWindow) {
// // Check if dataCarsLocationByPassenger or its 'data' is null
// if (controller.dataCarsLocationByPassenger == null ||
// controller.dataCarsLocationByPassenger['data'] == null ||
// controller.dataCarsLocationByPassenger['data'].isEmpty) {
// return const SizedBox(
// height: 60,
// child: Center(
// child: CircularProgressIndicator(
// valueColor:
// AlwaysStoppedAnimation<Color>(AppColor.secondaryColor),
// ),
// ),
// );
// }
// }
// return SizedBox(
// height: 60,
// child: ListView.builder(
// scrollDirection: Axis.horizontal,
// itemCount: controller.dataCarsLocationByPassenger['data'].length,
// padding: const EdgeInsets.symmetric(horizontal: 16),
// itemBuilder: (context, index) {
// final driver = controller.dataCarsLocationByPassenger['data'][index];
// return Padding(
// padding: const EdgeInsets.only(right: 8),
// child: Column(
// mainAxisSize: MainAxisSize.min,
// children: [
// CircleAvatar(
// radius: 25,
// backgroundColor: AppColor.secondaryColor,
// child: ClipOval(
// child: Image.network(
// '${AppLink.server}/portrate_captain_image/${driver['driver_id']}.jpg',
// width: 50,
// height: 50,
// fit: BoxFit.cover,
// errorBuilder: (context, error, stackTrace) {
// return const Icon(
// Icons.person,
// color: Colors.white,
// size: 30,
// );
// },
// ),
// ),
// ),
// ],
// ),
// );
// },
// ),
// );
// }
// @override
// Widget build(BuildContext context) {
// return GetBuilder<MapPassengerController>(
// builder: (mapPassengerController) {
// return mapPassengerController.isSearchingWindow
// ? Positioned(
// bottom: 0,
// left: 0,
// right: 0,
// child: Container(
// decoration: AppStyle.boxDecoration1,
// height: Get.height *
// .3, // Increased height to accommodate avatars
// child: Column(
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
// children: [
// SizedBox(
// width: Get.width * .7,
// child: const LinearProgressIndicator(
// minHeight: 6,
// backgroundColor: AppColor.yellowColor,
// color: AppColor.secondaryColor,
// ),
// ),
// mapPassengerController.driverOrderStatus == 'recive'
// ? Text(
// "Drivers received orders".tr,
// style: AppStyle.title,
// )
// : Text(
// "We are searching for the nearest driver to you"
// .tr,
// style: AppStyle.title,
// ),
// Text(
// 'please wait till driver accept your order'.tr,
// style: AppStyle.title,
// ),
// // New: Driver avatars section
// _buildDriverAvatars(mapPassengerController),
// _buildTimer(mapPassengerController),
// ],
// ),
// ),
// )
// : const SizedBox();
// },
// );
// }
// }
class SearchingCaptainWindow extends StatelessWidget {
const SearchingCaptainWindow({super.key});

View File

@@ -6,7 +6,6 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../constant/api_key.dart';
import '../../../constant/links.dart';
import '../../../print.dart';

View File

@@ -4,12 +4,12 @@ import 'package:SEFER/constant/colors.dart';
import 'package:SEFER/constant/style.dart';
import 'package:SEFER/controller/functions/crud.dart';
import 'package:SEFER/controller/home/profile/complaint_controller.dart';
import 'package:SEFER/views/widgets/my_dialog.dart';
import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';
import 'dart:io';
import '../../../controller/functions/audio_record1.dart';
import '../../widgets/mydialoug.dart';
class ComplaintPage extends StatelessWidget {
final ComplaintController complaintController =

View File

@@ -413,68 +413,72 @@ class CountryPickerFromSetting extends StatelessWidget {
@override
Widget build(BuildContext context) {
return GetBuilder<ProfileController>(builder: (controller) {
return Padding(
padding: const EdgeInsets.all(20.0),
child: ListView(
children: [
const SizedBox(
height: 20,
),
Text(
"Select Your Country".tr,
style: AppStyle.headTitle2,
textAlign: TextAlign.center,
),
// const SizedBox(
// height: 20,
// ),
Padding(
padding: const EdgeInsets.all(10),
child: Text(
"To ensure you receive the most accurate information for your location, please select your country below. This will help tailor the app experience and content to your country."
.tr,
style: AppStyle.title,
textAlign: TextAlign.center,
),
),
SizedBox(
height: 200,
child: CupertinoPicker(
itemExtent: 32,
onSelectedItemChanged: (int index) {
controller.setCountry(countryOptions[index]);
box.write(BoxName.countryCode,
countryOptions[index]); // Save in English
},
children: List.generate(
countryOptions.length,
(index) => Center(
child: Text(
countryOptions[index]
.tr, // Display translated if not English
style: AppStyle.title,
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
middle: Text('Select Your Country'.tr),
),
child: Padding(
padding: const EdgeInsets.all(20.0),
child: ListView(
children: [
const SizedBox(
height: 20,
),
// Text(
// "Select Your Country".tr,
// style: AppStyle.headTitle2,
// textAlign: TextAlign.center,
// ),
// const SizedBox(
// height: 20,
// ),
Padding(
padding: const EdgeInsets.all(10),
child: Text(
"To ensure you receive the most accurate information for your location, please select your country below. This will help tailor the app experience and content to your country."
.tr,
style: AppStyle.headTitle2,
textAlign: TextAlign.center,
),
),
SizedBox(
height: 200,
child: CupertinoPicker(
itemExtent: 32,
onSelectedItemChanged: (int index) {
controller.setCountry(countryOptions[index]);
box.write(BoxName.countryCode,
countryOptions[index]); // Save in English
},
children: List.generate(
countryOptions.length,
(index) => Center(
child: Text(
countryOptions[index]
.tr, // Display translated if not English
style: AppStyle.title,
),
),
),
),
),
),
),
MyElevatedButton(
title: 'Select Country'.tr, // Use translated text for button
onPressed: () async {
loginController.saveCountryCode(controller.selectedCountry
.toString()); // No conversion needed
box.write(
BoxName.countryCode, //
controller.selectedCountry); // Already saved in English
Get.snackbar(controller.selectedCountry.toString().tr, '',
backgroundColor: AppColor.greenColor);
// Get.back();//
// Get.back();
},
)
],
),
MyElevatedButton(
title: 'Select Country'.tr, // Use translated text for button
onPressed: () async {
loginController.saveCountryCode(controller.selectedCountry
.toString()); // No conversion needed
box.write(
BoxName.countryCode, //
controller.selectedCountry); // Already saved in English
Get.snackbar(controller.selectedCountry.toString().tr, '',
backgroundColor: AppColor.greenColor);
// Get.back();//
// Get.back();
},
)
],
)),
);
});
}

View File

@@ -10,15 +10,15 @@ import 'HomePage/share_app_page.dart';
import 'HomePage/trip_record_page.dart';
import 'profile/passenger_profile_page.dart';
class HomePage extends StatelessWidget {
const HomePage({super.key});
class SettingPage extends StatelessWidget {
const SettingPage({super.key});
@override
Widget build(BuildContext context) {
Get.put(HomePageController());
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
middle: Text('Home Page'.tr),
middle: Text('Setting'.tr),
leading: CupertinoButton(
padding: EdgeInsets.zero,
child: const Icon(CupertinoIcons.back),
@@ -42,14 +42,7 @@ class HomePage extends StatelessWidget {
),
CupertinoListTile(
onTap: () {
Get.to(CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
middle: Text('Change Country'.tr),
),
child: SafeArea(
child: CountryPickerFromSetting(),
),
));
Get.to(() => CountryPickerFromSetting());
},
leading: const Icon(CupertinoIcons.location,
color: CupertinoColors.activeBlue),

View File

@@ -1,4 +1,5 @@
import 'package:SEFER/constant/style.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:SEFER/views/widgets/elevated_btn.dart';
@@ -14,238 +15,122 @@ class Language extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: GetBuilder<LocaleController>(
builder: (controller) => Center(
child: Container(
padding: const EdgeInsets.all(15),
child: ListView(
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Text(
"Choose Language".tr,
style: Theme.of(context).textTheme.headlineLarge,
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
middle: Text('Choose Language'.tr),
border: null,
),
child: SafeArea(
child: GetBuilder<LocaleController>(
builder: (controller) => Center(
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
children: [
_buildHeader(),
const SizedBox(height: 20),
Expanded(
child: ListView(
physics: const BouncingScrollPhysics(),
children: [
_buildLanguageButton(
'العربية', 'ar', controller, context),
_buildLanguageButton(
'English', 'en', controller, context),
_buildLanguageButton(
'Türkçe', 'tr', controller, context),
_buildLanguageButton(
'Français', 'fr', controller, context),
_buildLanguageButton(
'Italiano', 'it', controller, context),
_buildLanguageButton(
'Deutsch', 'de', controller, context),
_buildLanguageButton(
'Ελληνικά', 'el', controller, context),
_buildLanguageButton(
'Español', 'es', controller, context),
_buildLanguageButton(
'فارسی', 'fa', controller, context),
_buildLanguageButton('中文', 'zh', controller, context),
_buildLanguageButton(
'Русский', 'ru', controller, context),
_buildLanguageButton(
'हिन्दी', 'hi', controller, context),
],
),
),
],
),
const SizedBox(height: 20),
MyElevatedButton(
title: 'العربية',
onPressed: () {
controller.changeLang("ar");
Get.defaultDialog(
title: 'You should restart app to change language'.tr,
titleStyle: AppStyle.title,
middleText: '',
confirm: MyElevatedButton(
title: 'Ok'.tr,
onPressed: () {
box.read(BoxName.email) != null
? Get.offAll(() => const MapPagePassenger())
: Get.offAll(() => LoginPage());
}));
},
),
MyElevatedButton(
title: "English",
onPressed: () {
controller.changeLang("en");
Get.defaultDialog(
title: 'You should restart app to change language'.tr,
titleStyle: AppStyle.title,
middleText: '',
confirm: MyElevatedButton(
title: 'Ok'.tr,
onPressed: () {
box.read(BoxName.email) != null
? Get.offAll(() => const MapPagePassenger())
: Get.offAll(() => LoginPage());
}));
},
),
MyElevatedButton(
title: "Türkçe",
onPressed: () {
controller.changeLang("tr");
Get.defaultDialog(
title: 'You should restart app to change language'.tr,
titleStyle: AppStyle.title,
middleText: '',
confirm: MyElevatedButton(
title: 'Ok'.tr,
onPressed: () {
box.read(BoxName.email) != null
? Get.offAll(() => const MapPagePassenger())
: Get.offAll(() => LoginPage());
}));
},
),
MyElevatedButton(
title: "Français",
onPressed: () {
controller.changeLang("fr");
Get.defaultDialog(
title: 'You should restart app to change language'.tr,
titleStyle: AppStyle.title,
middleText: '',
confirm: MyElevatedButton(
title: 'Ok'.tr,
onPressed: () {
box.read(BoxName.email) != null
? Get.offAll(() => const MapPagePassenger())
: Get.offAll(() => LoginPage());
}));
},
),
MyElevatedButton(
title: "Italiano",
onPressed: () {
controller.changeLang("it");
Get.defaultDialog(
title: 'You should restart app to change language'.tr,
titleStyle: AppStyle.title,
middleText: '',
confirm: MyElevatedButton(
title: 'Ok'.tr,
onPressed: () {
box.read(BoxName.email) != null
? Get.offAll(() => const MapPagePassenger())
: Get.offAll(() => LoginPage());
}));
},
),
MyElevatedButton(
title: "Deutsch",
onPressed: () {
controller.changeLang("de");
Get.defaultDialog(
title: 'You should restart app to change language'.tr,
titleStyle: AppStyle.title,
middleText: '',
confirm: MyElevatedButton(
title: 'Ok'.tr,
onPressed: () {
Get.defaultDialog(
title:
'You should restart app to change language'
.tr,
titleStyle: AppStyle.title,
middleText: '',
confirm: MyElevatedButton(
title: 'Ok'.tr,
onPressed: () {
box.read(BoxName.email) != null
? Get.offAll(
() => const MapPagePassenger())
: Get.offAll(() => LoginPage());
}));
}));
},
),
MyElevatedButton(
title: "Ελληνικά",
onPressed: () {
controller.changeLang("el");
Get.defaultDialog(
title: 'You should restart app to change language'.tr,
titleStyle: AppStyle.title,
middleText: '',
confirm: MyElevatedButton(
title: 'Ok'.tr,
onPressed: () {
box.read(BoxName.email) != null
? Get.offAll(() => const MapPagePassenger())
: Get.offAll(() => LoginPage());
}));
},
),
MyElevatedButton(
title: "Español",
onPressed: () {
controller.changeLang("es");
Get.defaultDialog(
title: 'You should restart app to change language'.tr,
titleStyle: AppStyle.title,
middleText: '',
confirm: MyElevatedButton(
title: 'Ok'.tr,
onPressed: () {
box.read(BoxName.email) != null
? Get.offAll(() => const MapPagePassenger())
: Get.offAll(() => LoginPage());
}));
},
),
MyElevatedButton(
title: "فارسی",
onPressed: () {
controller.changeLang("fa");
Get.defaultDialog(
title: 'You should restart app to change language'.tr,
titleStyle: AppStyle.title,
middleText: '',
confirm: MyElevatedButton(
title: 'Ok'.tr,
onPressed: () {
box.read(BoxName.email) != null
? Get.offAll(() => const MapPagePassenger())
: Get.offAll(() => LoginPage());
}));
},
),
MyElevatedButton(
title: "中文",
onPressed: () {
controller.changeLang("zh");
Get.defaultDialog(
title: 'You should restart app to change language'.tr,
titleStyle: AppStyle.title,
middleText: '',
confirm: MyElevatedButton(
title: 'Ok'.tr,
onPressed: () {
box.read(BoxName.email) != null
? Get.offAll(() => const MapPagePassenger())
: Get.offAll(() => LoginPage());
}));
},
),
MyElevatedButton(
title: "Русский",
onPressed: () {
controller.changeLang("ru");
Get.defaultDialog(
title: 'You should restart app to change language'.tr,
titleStyle: AppStyle.title,
middleText: '',
confirm: MyElevatedButton(
title: 'Ok'.tr,
onPressed: () {
box.read(BoxName.email) != null
? Get.offAll(() => const MapPagePassenger())
: Get.offAll(() => LoginPage());
}));
},
),
MyElevatedButton(
title: "हिन्दी",
onPressed: () {
controller.changeLang("hi");
Get.defaultDialog(
title: 'You should restart app to change language'.tr,
titleStyle: AppStyle.title,
middleText: '',
confirm: MyElevatedButton(
title: 'Ok'.tr,
onPressed: () {
box.read(BoxName.email) != null
? Get.offAll(() => const MapPagePassenger())
: Get.offAll(() => LoginPage());
}));
},
),
],
),
),
),
),
));
);
}
Widget _buildHeader() {
return Container(
padding: const EdgeInsets.all(20),
decoration: BoxDecoration(
gradient: const LinearGradient(
colors: [Color(0xFF2196F3), Color(0xFF1976D2)],
begin: Alignment.topLeft,
end: Alignment.bottomRight,
),
borderRadius: BorderRadius.circular(16),
boxShadow: [
BoxShadow(
color: CupertinoColors.systemBlue.withOpacity(0.2),
blurRadius: 10,
offset: const Offset(0, 4),
),
],
),
child: Column(
children: [
const Icon(
CupertinoIcons.globe,
color: CupertinoColors.white,
size: 48,
),
const SizedBox(height: 16),
Text(
'Choose Language'.tr,
style: const TextStyle(
color: CupertinoColors.white,
fontSize: 22,
fontWeight: FontWeight.bold,
),
textAlign: TextAlign.center,
),
],
),
);
}
Widget _buildLanguageButton(String title, String langCode,
LocaleController controller, BuildContext context) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 8),
child: MyElevatedButton(
title: title,
onPressed: () async {
controller.changeLang(langCode);
showCupertinoDialog(
context: context,
builder: (context) => CupertinoAlertDialog(
title: Text('You should restart app to change language'.tr),
actions: [
CupertinoDialogAction(
child: Text('Ok'.tr),
onPressed: () {
Get.offAll(() => MapPagePassenger());
},
),
],
),
);
},
));
}
}

View File

@@ -1,6 +1,8 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:SEFER/constant/colors.dart';
import '../../constant/colors.dart';
import 'mydialoug.dart';
class MyCircleContainer extends StatelessWidget {
final Widget child;
@@ -22,6 +24,12 @@ class MyCircleContainer extends StatelessWidget {
builder: ((controller) => GestureDetector(
onTap: () {
controller.changeColor();
MyDialog().getDialog(
'Rejected Orders Count'.tr,
'This is the total number of rejected orders per day after accepting the orders'
.tr, () {
Get.back();
});
},
child: AnimatedContainer(
onEnd: () {

View File

@@ -1,18 +1,19 @@
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:vibration/vibration.dart';
import 'package:SEFER/constant/box_name.dart';
import 'package:SEFER/constant/colors.dart';
import 'package:SEFER/constant/style.dart';
import 'package:SEFER/main.dart';
import '../../constant/box_name.dart';
import '../../constant/colors.dart';
import '../../constant/style.dart';
import '../../main.dart';
class MyElevatedButton extends StatelessWidget {
final String title;
final VoidCallback onPressed;
final Color kolor;
final int vibrateDuration;
const MyElevatedButton({
Key? key,
required this.title,
@@ -24,22 +25,27 @@ class MyElevatedButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
bool vibrate = box.read(BoxName.isvibrate) ?? true;
return ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: kolor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12.0),
style: ButtonStyle(
backgroundColor: WidgetStateProperty.all(kolor),
shadowColor: WidgetStateProperty.all(Colors.transparent),
shape: WidgetStateProperty.all(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
),
),
onPressed: () async {
// Handle haptic feedback for both iOS and Android
if (vibrate == true) {
if (Platform.isIOS) {
HapticFeedback.selectionClick();
} else {
} else if (Platform.isAndroid) {
await Vibration.vibrate(duration: vibrateDuration);
}
} else {}
}
// Ensure the onPressed callback is called after haptic feedback
onPressed();
},
child: Text(

View File

@@ -0,0 +1,123 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:get/get.dart';
import '../../constant/colors.dart';
class SnackbarConfig {
static const duration = Duration(seconds: 3);
static const animationDuration = Duration(milliseconds: 300);
static const margin = EdgeInsets.symmetric(horizontal: 16, vertical: 10);
static const borderRadius = 12.0;
static const elevation = 6.0;
static final BoxShadow shadow = BoxShadow(
color: Colors.black.withOpacity(0.1),
blurRadius: 10,
offset: const Offset(0, 2),
);
}
SnackbarController mySnackeBarError(String message) {
// Trigger error haptic feedback
HapticFeedback.mediumImpact();
return Get.snackbar(
'Error'.tr,
message,
backgroundColor: AppColor.redColor.withOpacity(0.95),
colorText: AppColor.secondaryColor,
icon: const Icon(
Icons.error_outline_rounded,
color: AppColor.secondaryColor,
size: 28,
),
shouldIconPulse: true,
snackPosition: SnackPosition.TOP,
margin: SnackbarConfig.margin,
borderRadius: SnackbarConfig.borderRadius,
duration: SnackbarConfig.duration,
animationDuration: SnackbarConfig.animationDuration,
forwardAnimationCurve: Curves.easeOutCirc,
reverseAnimationCurve: Curves.easeInCirc,
boxShadows: [SnackbarConfig.shadow],
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 12),
titleText: Text(
'Error'.tr,
style: const TextStyle(
fontWeight: FontWeight.w700,
color: Colors.white,
fontSize: 16,
letterSpacing: 0.2,
),
),
messageText: Text(
message,
style: TextStyle(
color: Colors.white.withOpacity(0.95),
fontSize: 14,
height: 1.3,
),
),
onTap: (_) {
HapticFeedback.lightImpact();
Get.closeCurrentSnackbar();
},
isDismissible: true,
dismissDirection: DismissDirection.horizontal,
overlayBlur: 0.8,
overlayColor: Colors.black12,
);
}
SnackbarController mySnackbarSuccess(String message) {
// Trigger success haptic feedback
HapticFeedback.lightImpact();
return Get.snackbar(
'Success'.tr,
message,
backgroundColor: AppColor.greenColor.withOpacity(0.95),
colorText: AppColor.secondaryColor,
icon: const Icon(
Icons.check_circle_outline_rounded,
color: AppColor.secondaryColor,
size: 28,
),
shouldIconPulse: true,
snackPosition: SnackPosition.TOP,
margin: SnackbarConfig.margin,
borderRadius: SnackbarConfig.borderRadius,
duration: SnackbarConfig.duration,
animationDuration: SnackbarConfig.animationDuration,
forwardAnimationCurve: Curves.easeOutCirc,
reverseAnimationCurve: Curves.easeInCirc,
boxShadows: [SnackbarConfig.shadow],
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 12),
titleText: Text(
'Success'.tr,
style: const TextStyle(
fontWeight: FontWeight.w700,
color: Colors.white,
fontSize: 16,
letterSpacing: 0.2,
),
),
messageText: Text(
message,
style: TextStyle(
color: Colors.white.withOpacity(0.95),
fontSize: 14,
height: 1.3,
),
),
onTap: (_) {
HapticFeedback.lightImpact();
Get.closeCurrentSnackbar();
},
isDismissible: true,
dismissDirection: DismissDirection.horizontal,
overlayBlur: 0.8,
overlayColor: Colors.black12,
);
}

View File

@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:SEFER/constant/style.dart';
import '../../constant/colors.dart';
import '../../constant/style.dart';
class IconWidgetMenu extends StatelessWidget {
const IconWidgetMenu({
@@ -20,7 +20,7 @@ class IconWidgetMenu extends StatelessWidget {
return InkWell(
onTap: onpressed,
child: Padding(
padding: const EdgeInsets.only(top: 1),
padding: const EdgeInsets.only(top: 25),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
@@ -29,22 +29,22 @@ class IconWidgetMenu extends StatelessWidget {
decoration: const BoxDecoration(
color: AppColor.secondaryColor,
shape: BoxShape.circle,
// boxShadow: [
// BoxShadow(
// color: AppColor.secondaryColor,
// offset: Offset(-2, -2),
// blurRadius: 0,
// spreadRadius: 0,
// blurStyle: BlurStyle.outer,
// ),
// BoxShadow(
// color: AppColor.accentColor,
// offset: Offset(3, 3),
// blurRadius: 0,
// spreadRadius: 0,
// blurStyle: BlurStyle.outer,
// ),
// ],
boxShadow: [
BoxShadow(
color: AppColor.secondaryColor,
offset: Offset(-2, -2),
blurRadius: 0,
spreadRadius: 0,
blurStyle: BlurStyle.outer,
),
BoxShadow(
color: AppColor.accentColor,
offset: Offset(3, 3),
blurRadius: 0,
spreadRadius: 0,
blurStyle: BlurStyle.outer,
),
],
),
child: Center(
child: Icon(
@@ -56,7 +56,7 @@ class IconWidgetMenu extends StatelessWidget {
),
Text(
title,
style: AppStyle.subtitle.copyWith(color: AppColor.secondaryColor),
style: AppStyle.subtitle,
)
],
),

View File

@@ -0,0 +1,74 @@
import 'package:flutter/material.dart';
import 'dart:async';
import '../../constant/style.dart';
class MyCircularProgressIndicatorWithTimer extends StatelessWidget {
final Color backgroundColor;
final bool isLoading;
MyCircularProgressIndicatorWithTimer({
Key? key,
this.backgroundColor = Colors.transparent,
required this.isLoading,
}) : super(key: key);
final StreamController<int> _streamController = StreamController<int>();
void startTimer() {
int _timeLeft = 60;
Timer.periodic(const Duration(seconds: 1), (timer) {
if (_timeLeft > 0 && isLoading) {
_streamController.add(_timeLeft);
_timeLeft--;
} else {
timer.cancel();
_streamController.close();
}
});
}
@override
Widget build(BuildContext context) {
if (isLoading) {
startTimer();
}
return Center(
child: Container(
width: 200,
height: 200,
decoration: BoxDecoration(
color: backgroundColor,
shape: BoxShape.circle,
),
child: Stack(
children: [
const Center(child: CircularProgressIndicator()),
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Align(
alignment: Alignment.center,
child: Image.asset(
'assets/images/logo.gif',
width: 140,
height: 140,
),
),
const SizedBox(height: 10),
StreamBuilder<int>(
stream: _streamController.stream,
initialData: 60,
builder: (context, snapshot) {
return Text('${snapshot.data}', style: AppStyle.title);
},
),
],
),
],
),
),
);
}
}

View File

@@ -1,109 +0,0 @@
import 'dart:ui';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../constant/colors.dart';
import '../../constant/style.dart';
import '../../controller/functions/tts.dart';
import 'elevated_btn.dart';
class MyDialog extends GetxController {
void getDialog(String title, String? midTitle, VoidCallback onPressed) {
final textToSpeechController = Get.put(TextToSpeechController());
Get.dialog(
BackdropFilter(
filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5),
child: CupertinoAlertDialog(
title: Text(
title,
style: AppStyle.title.copyWith(
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
content: Column(
children: [
CupertinoButton(
onPressed: () async {
await textToSpeechController.speakText(title ?? midTitle!);
},
child: const Icon(CupertinoIcons.headphones,
color: AppColor.primaryColor),
),
Text(
midTitle!,
style: AppStyle.title.copyWith(fontSize: 16),
),
],
),
actions: [
CupertinoDialogAction(
child: const Text('Cancel',
style: TextStyle(color: AppColor.redColor)),
onPressed: () {
Get.back();
},
),
CupertinoDialogAction(
onPressed: onPressed,
child: Text('OK'.tr,
style: const TextStyle(color: AppColor.greenColor)),
),
],
),
),
barrierDismissible: false,
);
}
}
class MyDialogContent extends GetxController {
void getDialog(String title, Widget? content, VoidCallback onPressed) {
final textToSpeechController = Get.put(TextToSpeechController());
Get.dialog(
BackdropFilter(
filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5),
child: CupertinoAlertDialog(
title: Text(
title,
style: AppStyle.title.copyWith(
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
content: Column(
children: [
CupertinoButton(
onPressed: () async {
await textToSpeechController.speakText(title);
},
child: const Icon(CupertinoIcons.speaker_2,
color: AppColor.primaryColor),
),
content!
],
),
actions: [
CupertinoDialogAction(
child: const Text('Cancel',
style: TextStyle(color: AppColor.redColor)),
onPressed: () {
Get.back();
},
),
CupertinoDialogAction(
onPressed: onPressed,
child: Text('OK'.tr,
style: const TextStyle(color: AppColor.greenColor)),
),
],
),
),
barrierDismissible: false,
);
}
}

View File

@@ -1,7 +1,8 @@
import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';
import 'package:get_storage/get_storage.dart';
import 'package:SEFER/constant/box_name.dart';
import '../../constant/box_name.dart';
class MyTextForm extends StatelessWidget {
const MyTextForm({
@@ -27,7 +28,7 @@ class MyTextForm extends StatelessWidget {
children: [
Text(
label.tr,
style: const TextStyle(
style: TextStyle(
color: CupertinoColors.label,
fontSize: 16,
fontWeight: FontWeight.w600,

View File

@@ -1,34 +1,131 @@
import 'package:flutter/material.dart';
class MyCircularProgressIndicator extends StatelessWidget {
class MyCircularProgressIndicator extends StatefulWidget {
final Color backgroundColor;
final double size;
final Color progressColor;
final double strokeWidth;
const MyCircularProgressIndicator({
super.key,
this.backgroundColor = Colors.transparent,
this.size = 110,
this.progressColor = Colors.blue,
this.strokeWidth = 3.0,
});
@override
State<MyCircularProgressIndicator> createState() =>
_MyCircularProgressIndicatorState();
}
class _MyCircularProgressIndicatorState
extends State<MyCircularProgressIndicator>
with SingleTickerProviderStateMixin {
late AnimationController _controller;
late Animation<double> _scaleAnimation;
late Animation<double> _rotationAnimation;
@override
void initState() {
super.initState();
_controller = AnimationController(
duration: const Duration(seconds: 2),
vsync: this,
)..repeat(reverse: true);
_scaleAnimation = Tween<double>(
begin: 0.95,
end: 1.05,
).animate(CurvedAnimation(
parent: _controller,
curve: Curves.easeInOut,
));
_rotationAnimation = Tween<double>(
begin: 0,
end: 2,
).animate(CurvedAnimation(
parent: _controller,
curve: Curves.linear,
));
}
@override
void dispose() {
_controller.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Center(
child: Container(
width: 140,
height: 140,
decoration: BoxDecoration(
color: backgroundColor,
shape: BoxShape.circle,
),
child: Stack(
children: [
const Center(child: CircularProgressIndicator()),
Image.asset(
'assets/images/logo.gif',
width: 140,
height: 140,
fit: BoxFit.contain,
child: AnimatedBuilder(
animation: _controller,
builder: (context, child) {
return Transform.scale(
scale: _scaleAnimation.value,
child: Container(
width: widget.size,
height: widget.size,
decoration: BoxDecoration(
color: widget.backgroundColor,
shape: BoxShape.circle,
boxShadow: [
BoxShadow(
color: widget.progressColor.withAlpha(30),
blurRadius: 12,
spreadRadius: 2,
),
],
),
child: Stack(
alignment: Alignment.center,
children: [
// Outer rotating progress indicator
Transform.rotate(
angle: _rotationAnimation.value * 3.14,
child: CircularProgressIndicator(
strokeWidth: widget.strokeWidth,
valueColor: AlwaysStoppedAnimation<Color>(
widget.progressColor,
),
),
),
// Inner static progress indicator
CircularProgressIndicator(
strokeWidth: widget.strokeWidth * 0.7,
valueColor: AlwaysStoppedAnimation<Color>(
widget.progressColor.withAlpha(150),
),
),
// Logo container with scale animation
ScaleTransition(
scale: Tween<double>(
begin: 0.9,
end: 1.0,
).animate(CurvedAnimation(
parent: _controller,
curve: Curves.easeInOut,
)),
child: Container(
width: widget.size * 0.7,
height: widget.size * 0.7,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: widget.backgroundColor,
),
child: Image.asset(
'assets/images/logo.gif',
fit: BoxFit.contain,
),
),
),
],
),
),
],
),
);
},
),
);
}

View File

@@ -0,0 +1,246 @@
import 'dart:ui';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:get/get.dart';
import '../../constant/colors.dart';
import '../../constant/style.dart';
import '../../controller/functions/tts.dart';
class DialogConfig {
static const Duration animationDuration = Duration(milliseconds: 200);
static const double blurStrength = 8.0;
static const double cornerRadius = 14.0;
static final BoxDecoration decoration = BoxDecoration(
borderRadius: BorderRadius.circular(cornerRadius),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(38), // 0.15 opacity
blurRadius: 16,
offset: const Offset(0, 8),
),
],
);
}
class MyDialog extends GetxController {
void getDialog(String title, String? midTitle, VoidCallback onPressed) {
final textToSpeechController = Get.put(TextToSpeechController());
HapticFeedback.mediumImpact();
Get.dialog(
TweenAnimationBuilder<double>(
duration: DialogConfig.animationDuration,
tween: Tween(begin: 0.0, end: 1.0),
builder: (context, value, child) {
return Transform.scale(
scale: 0.95 + (0.05 * value),
child: Opacity(opacity: value, child: child),
);
},
child: BackdropFilter(
filter: ImageFilter.blur(
sigmaX: DialogConfig.blurStrength,
sigmaY: DialogConfig.blurStrength,
),
child: Theme(
data: ThemeData.light().copyWith(
dialogBackgroundColor: CupertinoColors.systemBackground,
),
child: CupertinoAlertDialog(
title: Column(
children: [
Text(
title,
style: AppStyle.title.copyWith(
fontSize: 20,
fontWeight: FontWeight.w700,
letterSpacing: -0.5,
color: AppColor.primaryColor,
),
),
const SizedBox(height: 8),
],
),
content: Column(
children: [
CupertinoButton(
padding: const EdgeInsets.all(8),
onPressed: () async {
HapticFeedback.selectionClick();
await textToSpeechController.speakText(title);
await textToSpeechController.speakText(midTitle!);
},
child: Container(
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(
color:
AppColor.primaryColor.withAlpha(26), // 0.1 opacity
borderRadius: BorderRadius.circular(8),
),
child: Icon(
CupertinoIcons.speaker_2_fill,
color: AppColor.primaryColor,
size: 24,
),
),
),
const SizedBox(height: 8),
Text(
midTitle!,
style: AppStyle.title.copyWith(
fontSize: 16,
height: 1.3,
color: Colors.black87,
),
textAlign: TextAlign.center,
),
],
),
actions: [
CupertinoDialogAction(
onPressed: () {
HapticFeedback.lightImpact();
Get.back();
},
child: Text(
'Cancel',
style: TextStyle(
color: AppColor.redColor,
fontWeight: FontWeight.w600,
fontSize: 17,
),
),
),
CupertinoDialogAction(
onPressed: () {
HapticFeedback.mediumImpact();
onPressed();
},
child: Text(
'OK'.tr,
style: TextStyle(
color: AppColor.greenColor,
fontWeight: FontWeight.w600,
fontSize: 17,
),
),
),
],
),
),
),
),
barrierDismissible: true,
barrierColor: Colors.black.withAlpha(102), // 0.4 opacity
);
}
}
class MyDialogContent extends GetxController {
void getDialog(String title, Widget? content, VoidCallback onPressed) {
final textToSpeechController = Get.put(TextToSpeechController());
HapticFeedback.mediumImpact();
Get.dialog(
TweenAnimationBuilder<double>(
duration: DialogConfig.animationDuration,
tween: Tween(begin: 0.0, end: 1.0),
builder: (context, value, child) {
return Transform.scale(
scale: 0.95 + (0.05 * value),
child: Opacity(opacity: value, child: child),
);
},
child: BackdropFilter(
filter: ImageFilter.blur(
sigmaX: DialogConfig.blurStrength,
sigmaY: DialogConfig.blurStrength,
),
child: Theme(
data: ThemeData.light().copyWith(
dialogBackgroundColor: CupertinoColors.systemBackground,
),
child: CupertinoAlertDialog(
title: Column(
children: [
Text(
title,
style: AppStyle.title.copyWith(
fontSize: 20,
fontWeight: FontWeight.w700,
letterSpacing: -0.5,
color: AppColor.primaryColor,
),
),
const SizedBox(height: 8),
],
),
content: Column(
children: [
CupertinoButton(
padding: const EdgeInsets.all(8),
onPressed: () async {
HapticFeedback.selectionClick();
await textToSpeechController.speakText(title);
},
child: Container(
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(
color:
AppColor.primaryColor.withAlpha(26), // 0.1 opacity
borderRadius: BorderRadius.circular(8),
),
child: Icon(
CupertinoIcons.headphones,
color: AppColor.primaryColor,
size: 24,
),
),
),
const SizedBox(height: 12),
content!,
],
),
actions: [
CupertinoDialogAction(
onPressed: () {
HapticFeedback.lightImpact();
Get.back();
},
child: Text(
'Cancel',
style: TextStyle(
color: AppColor.redColor,
fontWeight: FontWeight.w600,
fontSize: 17,
),
),
),
CupertinoDialogAction(
onPressed: () {
HapticFeedback.mediumImpact();
onPressed();
},
child: Text(
'OK'.tr,
style: TextStyle(
color: AppColor.greenColor,
fontWeight: FontWeight.w600,
fontSize: 17,
),
),
),
],
),
),
),
),
barrierDismissible: true,
barrierColor: Colors.black.withAlpha(102), // 0.4 opacity
);
}
}

View File

@@ -1,69 +0,0 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../constant/colors.dart';
SnackbarController mySnackeBarError(String message) {
return Get.snackbar(
'Error'.tr,
message,
backgroundColor: AppColor.redColor.withOpacity(0.9),
colorText: AppColor.secondaryColor,
icon: const Icon(Icons.error, color: AppColor.secondaryColor),
shouldIconPulse: true,
snackPosition: SnackPosition.TOP,
margin: const EdgeInsets.all(10),
borderRadius: 10,
animationDuration: const Duration(milliseconds: 500),
forwardAnimationCurve: Curves.easeOutBack,
reverseAnimationCurve: Curves.easeInBack,
titleText: Text(
'Error'.tr,
style: const TextStyle(
fontWeight: FontWeight.bold,
color: Colors.white,
fontSize: 16,
),
),
messageText: Text(
message,
style: TextStyle(
color: Colors.white.withOpacity(0.9),
fontSize: 14,
),
),
);
}
SnackbarController mySnackbarSuccess(String message) {
return Get.snackbar(
'Success'.tr,
message,
backgroundColor: AppColor.greenColor
.withOpacity(0.9), // Assuming green color for success
colorText: AppColor.secondaryColor,
icon: const Icon(Icons.check_circle, color: AppColor.secondaryColor),
shouldIconPulse: true,
snackPosition: SnackPosition.TOP,
margin: const EdgeInsets.all(10),
borderRadius: 10,
animationDuration: const Duration(milliseconds: 500),
forwardAnimationCurve: Curves.easeOutBack,
reverseAnimationCurve: Curves.easeInBack,
titleText: Text(
'Success'.tr,
style: const TextStyle(
fontWeight: FontWeight.bold,
color: Colors.white,
fontSize: 16,
),
),
messageText: Text(
message,
style: TextStyle(
color: Colors.white.withOpacity(0.9),
fontSize: 14,
),
),
);
}