This commit is contained in:
Hamza-Ayed
2023-08-21 23:34:15 +03:00
parent b340316e11
commit c1869d2725
18 changed files with 418 additions and 116 deletions

View File

@@ -22,7 +22,7 @@ class LoginPage extends StatelessWidget {
Get.put(LoginController());
return GetBuilder<LoginController>(
builder: (controller) =>
MyScafolld(title: 'Login', isleading: false, body: [
MyScafolld(title: 'Login'.tr, isleading: false, body: [
if (box.read(BoxName.agreeTerms) != 'agreed')
agreedpage()
else
@@ -116,7 +116,9 @@ class LoginPage extends StatelessWidget {
borderRadius: BorderRadius.all(
Radius.circular(12))),
labelText: 'Password'.tr,
hintText: 'Enter your Password'.tr,
hintText:
'Please enter your phone number.'
.tr,
),
validator: (value) {
if (value!.isEmpty ||
@@ -139,7 +141,7 @@ class LoginPage extends StatelessWidget {
controller.login();
}
},
title: 'Submit',
title: 'Submit'.tr,
),
)
],
@@ -156,7 +158,7 @@ class LoginPage extends StatelessWidget {
onTap: () => Get.to(() => const RegisterPage()),
animatedTexts: [
TypewriterAnimatedText(
'Register',
'Register'.tr,
textStyle: AppStyle.headtitle2,
speed: const Duration(milliseconds: 200),
),
@@ -227,7 +229,7 @@ class LoginPage extends StatelessWidget {
],
),
MyElevatedButton(
title: 'Submit',
title: 'Submit'.tr,
onPressed: () => controller.saveAgreementTerms())
],
),

View File

@@ -14,7 +14,7 @@ class RegisterPage extends StatelessWidget {
Widget build(BuildContext context) {
Get.put(RegisterController());
return MyScafolld(
title: 'Register',
title: 'Register'.tr,
body: [
GetBuilder<RegisterController>(
builder: (controller) => Form(

View File

@@ -1,4 +1,8 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:ride/constant/colors.dart';
import 'package:ride/constant/style.dart';
import 'package:ride/views/lang/languages.dart';
import 'package:ride/views/widgets/circle_container.dart';
import 'package:ride/views/widgets/my_scafold.dart';
@@ -9,12 +13,52 @@ class HomePage extends StatelessWidget {
Widget build(BuildContext context) {
return MyScafolld(
isleading: true,
title: 'Home Page',
title: 'Home Page'.tr,
body: [
Center(
child: MyCircleContainer(
child: const Icon(Icons.clear),
),
Column(
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
child: ListTile(
title: Text(
'Settings'.tr,
style: AppStyle.title,
),
subtitle: Text('To change some Settings'.tr),
trailing: const Icon(
Icons.arrow_forward_ios,
size: 30,
color: AppColor.primaryColor,
),
leading: const Icon(
Icons.settings,
color: AppColor.primaryColor,
),
),
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
child: ListTile(
onTap: () {
Get.to(() => Language());
},
title: Text(
'Language'.tr,
style: AppStyle.title,
),
subtitle: Text('To change Languge the App'.tr),
trailing: const Icon(
Icons.arrow_forward_ios,
size: 30,
color: AppColor.primaryColor,
),
leading: const Icon(
Icons.language_sharp,
color: AppColor.primaryColor,
),
),
)
],
),
],
);

View File

@@ -36,7 +36,7 @@ class MapPage extends StatelessWidget {
minMaxZoomPreference: const MinMaxZoomPreference(6, 18),
onLongPress: (argument) {
Get.defaultDialog(
title: 'Are you want to go to this site',
title: 'Are you want to go to this site'.tr,
content: Column(
children: [
Text('${argument.latitude},${argument.longitude}'),
@@ -59,7 +59,7 @@ class MapPage extends StatelessWidget {
controller.hidePlaces();
controller.changeButtomSheetShown();
controller.bottomSheet();
// controller.bottomSheet();
},
initialCameraPosition: CameraPosition(
target: controller.mylocation,
@@ -73,17 +73,17 @@ class MapPage extends StatelessWidget {
icon: controller.carIcon,
markerId: MarkerId(carLocation.toString())),
Marker(
markerId: const MarkerId('MyLocation'),
markerId: MarkerId('MyLocation'.tr),
position: controller.mylocation,
draggable: true,
icon: controller.markerIcon,
onDragEnd: (value) {
print(value);
},
infoWindow: const InfoWindow(title: 'my location'),
infoWindow: InfoWindow(title: 'my location'.tr),
),
Marker(
markerId: const MarkerId('destination'),
markerId: MarkerId('Target'.tr),
position: controller.mydestination,
draggable: true,
onDragEnd: (v) {

View File

@@ -60,13 +60,13 @@ GetBuilder<MapController> buttomSheetMapPage() {
Text(
'${'Your Ride Duration is '.tr}${controller.duration} minutes'),
Text(
'You will be thier in ${DateFormat('h:mm a').format(controller.newTime)}'),
'${'You will be thier in'.tr} ${DateFormat('h:mm a').format(controller.newTime)}'),
Text(
'You trip distance is ${controller.distance} KM')
'${'You trip distance is'.tr} ${controller.distance} KM')
],
),
Text(
'Fee is \n${controller.totalPassenger.toStringAsFixed(2)}',
'${'Fee is'.tr} \n${controller.totalPassenger.toStringAsFixed(2)}',
style: AppStyle.subtitle,
),
],
@@ -196,8 +196,9 @@ GetBuilder<MapController> buttomSheetMapPage() {
),
),
MyElevatedButton(
title: 'Confirm Selection',
onPressed: () {},
title: 'Confirm Selection'.tr,
onPressed: () =>
controller.changeConfirmRide(),
)
],
),
@@ -225,11 +226,11 @@ class Details extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Text(
'distance is ${controller.data[0]['distance']['text']}',
'${'distance is'.tr} ${controller.data[0]['distance']['text']}',
style: AppStyle.title,
),
Text(
'duration is ${controller.data[0]['duration']['text']}',
'${'duration is'.tr} ${controller.data[0]['duration']['text']}',
style: AppStyle.title,
),
],

View File

@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:get/get.dart';
import 'package:ride/constant/colors.dart';
import 'package:ride/constant/style.dart';
@@ -65,7 +64,11 @@ GetBuilder<MapController> cancelRidePage() {
groupValue: controller.selectedReason,
onChanged: (int? value) {
print(value);
controller.selectReason(value!);
print(reasons[index]);
controller.selectReason(
value!,
reasons[index].toString(),
);
},
),
);
@@ -74,7 +77,7 @@ GetBuilder<MapController> cancelRidePage() {
),
MyElevatedButton(
title: 'Cancel Ride'.tr,
onPressed: () async {
onPressed: () {
controller.cancelRide();
},
),

View File

@@ -113,7 +113,7 @@ class CashConfirmPageShown extends StatelessWidget {
indent: 1,
),
MyElevatedButton(
title: 'Add Payment Method',
title: 'Add Payment Method'.tr,
onPressed: () {
controller.changePaymentMethodPageShown();
CreditCardController().openPayment();

View File

@@ -21,7 +21,7 @@ GetBuilder<MapController> formSearchPlaces() {
child: TextField(
decoration: InputDecoration(
suffixIcon: const Icon(Icons.search),
hintText: 'Type here Place',
hintText: 'Type here Place'.tr,
hintMaxLines: 1,
prefixIcon: IconButton(
onPressed: () {
@@ -56,7 +56,8 @@ GetBuilder<MapController> formSearchPlaces() {
onTap: () {
controller.changeHeight();
Get.defaultDialog(
title: 'Are You sure to ride to ${res['name']}',
title:
'${'Are You sure to ride to'.tr} ${res['name']}',
middleText: '',
confirm: MyElevatedButton(
title: 'Confirm'.tr,

View File

@@ -67,13 +67,13 @@ class MainBottomMenuMap extends StatelessWidget {
child: AnimatedTextKit(
animatedTexts: [
ScaleAnimatedText(
'Where to ${box.read(BoxName.name)}'),
'${'Where to'.tr} ${box.read(BoxName.name)}'),
WavyAnimatedText(
'Where to ${box.read(BoxName.name)}'),
'${'Where to'.tr} ${box.read(BoxName.name)}'),
FlickerAnimatedText(
'Where to ${box.read(BoxName.name)}'),
'${'Where to'.tr} ${box.read(BoxName.name)}'),
WavyAnimatedText(
'Where to ${box.read(BoxName.name)}'),
'${'Where to'.tr} ${box.read(BoxName.name)}'),
],
isRepeatingAnimation: true,
onTap: () {
@@ -90,7 +90,7 @@ class MainBottomMenuMap extends StatelessWidget {
controller.isMainBottomMenuMap
? const SizedBox()
: Text(
'From : Current Location',
'From : Current Location'.tr,
style: AppStyle.subtitle,
),
controller.isMainBottomMenuMap
@@ -181,8 +181,8 @@ class FavioratePlacesDialogu extends StatelessWidget {
TableName.placesFavorite,
favoritePlaces[index]['id']);
Get.back();
Get.snackbar('Deleted ',
'You are Delete ${favoritePlaces[index]['name']} from your list',
Get.snackbar('Deleted'.tr,
'${'You are Delete'.tr} ${favoritePlaces[index]['name']} from your list',
backgroundColor:
AppColor.accentColor);
},

View File

@@ -83,7 +83,7 @@ class PaymentMethodPage extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
MyElevatedButton(
title: 'Add Credit Card',
title: 'Add Credit Card'.tr,
onPressed: () async {
SecureStorage().saveData(
BoxName.cardNumber,
@@ -196,7 +196,8 @@ class CreditCardWidget extends StatelessWidget {
labelText: 'Cardholder Name'),
validator: (value) {
if (value!.isEmpty) {
return 'Please enter the cardholder name';
return 'Please enter the cardholder name'
.tr;
}
return null;
},
@@ -228,7 +229,8 @@ class CreditCardWidget extends StatelessWidget {
labelText: 'Expiry Date'),
validator: (value) {
if (value!.isEmpty) {
return 'Please enter the expiry date';
return 'Please enter the expiry date'
.tr;
}
return null;
},
@@ -262,7 +264,7 @@ class CreditCardWidget extends StatelessWidget {
validator: (value) {
if (value!.isEmpty &&
value.length != 3) {
return 'Please enter the CVV code';
return 'Please enter the CVV code'.tr;
}
return null;
},

View File

@@ -75,7 +75,7 @@ class PickerAnimtionContainerFormPlaces extends StatelessWidget {
? InkWell(
onTap: () {},
child: formSearchPlaces(),
)
)
: Row(
mainAxisAlignment:
MainAxisAlignment.spaceEvenly,
@@ -165,7 +165,7 @@ class PickerAnimtionContainerFormPlaces extends StatelessWidget {
Get.back();
Get.snackbar(
'Deleted ',
'You are Delete ${favoritePlaces[index]['name']} from your list',
'${'You are Delete'.tr} ${favoritePlaces[index]['name']} from your list',
backgroundColor:
AppColor
.accentColor);
@@ -191,7 +191,7 @@ class PickerAnimtionContainerFormPlaces extends StatelessWidget {
if (controller.isPickerShown &&
controller.places.isEmpty)
MyElevatedButton(
title: 'Go to this Target',
title: 'Go to this Target'.tr,
onPressed: () async {
await controller.getMap(
'${controller.mylocation.latitude},${controller.mylocation.longitude}',

View File

@@ -18,7 +18,7 @@ class PassengerProfilePage extends StatelessWidget {
Get.put(ProfileController());
return MyScafolld(
isleading: true,
title: 'My Profile',
title: 'My Profile'.tr,
body: [
GetBuilder<ProfileController>(
builder: (controller) => controller.isloading
@@ -177,7 +177,7 @@ class PassengerProfilePage extends StatelessWidget {
class GenderPicker extends StatelessWidget {
final ProfileController controller = Get.put(ProfileController());
final List<String> genderOptions = ['Male', 'Female', 'Other'];
final List<String> genderOptions = ['Male'.tr, 'Female'.tr, 'Other'.tr];
GenderPicker({super.key});

View File

@@ -6,46 +6,57 @@ import 'package:ride/views/widgets/elevated_btn.dart';
import '../../constant/box_name.dart';
import '../../controller/local/local_controller.dart';
import '../auth/login_page.dart';
import '../home/home_page.dart';
import '../home/map_page.dart';
class Language extends GetView<LocaleController> {
class Language extends StatelessWidget {
const Language({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
body: GetBuilder<LocaleController>(
builder: (controller) => Center(
child: Container(
padding: const EdgeInsets.all(15),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Text("Choose Language".tr,
style: Theme.of(context).textTheme.headlineLarge),
const SizedBox(height: 20),
MyElevatedButton(
title: 'Ar',
onPressed: () {
controller.changeLang("ar");
// main();
box.read(BoxName.email) != null
? Get.offAll(() => const MapPage())
: Get.offAll(() => LoginPage());
},
),
MyElevatedButton(
title: "En",
onPressed: () {
controller.changeLang("en");
box.read(BoxName.email) != null
? Get.offAll(() => const MapPage())
: Get.offAll(() => LoginPage());
},
),
],
)),
padding: const EdgeInsets.all(15),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Text(
"Choose Language".tr,
style: Theme.of(context).textTheme.headlineLarge,
),
const SizedBox(height: 20),
MyElevatedButton(
title: 'Ar',
onPressed: () {
controller.changeLang("ar");
box.read(BoxName.email) != null
? Get.offAll(() => const MapPage())
: Get.offAll(() => LoginPage());
},
),
MyElevatedButton(
title: "En",
onPressed: () {
controller.changeLang("en");
box.read(BoxName.email) != null
? Get.offAll(() => const MapPage())
: Get.offAll(() => LoginPage());
},
),
MyElevatedButton(
title: "Tr",
onPressed: () {
controller.changeLang("tr");
box.read(BoxName.email) != null
? Get.offAll(() => const MapPage())
: Get.offAll(() => LoginPage());
},
),
],
),
),
),
);
));
}
}