8-12/
This commit is contained in:
@@ -1,7 +1,15 @@
|
||||
import 'package:animated_text_kit/animated_text_kit.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/constant/box_name.dart';
|
||||
import 'package:ride/constant/colors.dart';
|
||||
import 'package:ride/constant/style.dart';
|
||||
import 'package:ride/main.dart';
|
||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||
import 'package:ride/views/widgets/my_scafold.dart';
|
||||
|
||||
import '../../controller/auth/login_controller.dart';
|
||||
import 'register_page.dart';
|
||||
|
||||
class LoginPage extends StatelessWidget {
|
||||
final controller = Get.put(LoginController());
|
||||
@@ -10,49 +18,202 @@ class LoginPage extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text('Login'),
|
||||
),
|
||||
body: Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(22),
|
||||
Get.put(LoginController());
|
||||
return MyScafolld(title: 'Login', isleading: false, body: [
|
||||
if (box.read(BoxName.agreeTerms) != 'agreed')
|
||||
agreedpage()
|
||||
else
|
||||
SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
TextFormField(
|
||||
controller: controller.emailController,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Email',
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(25),
|
||||
child: Container(
|
||||
decoration: const BoxDecoration(
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
offset: Offset(3, 3),
|
||||
color: AppColor.accentColor,
|
||||
blurRadius: 3)
|
||||
],
|
||||
color: AppColor.secondaryColor,
|
||||
),
|
||||
child: Form(
|
||||
key: controller.formKey,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
TextFormField(
|
||||
keyboardType: TextInputType.emailAddress,
|
||||
controller: controller.emailController,
|
||||
decoration: InputDecoration(
|
||||
fillColor: AppColor.accentColor,
|
||||
hoverColor: AppColor.accentColor,
|
||||
focusColor: AppColor.accentColor,
|
||||
border: const OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(12))),
|
||||
labelText: 'Email'.tr,
|
||||
hintText: 'Enter your email address'.tr,
|
||||
),
|
||||
validator: (value) {
|
||||
if (value!.isEmpty ||
|
||||
(!value.contains('@') ||
|
||||
!value.contains('.'))) {
|
||||
return 'Please enter Your Email.'.tr;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
const SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
TextFormField(
|
||||
keyboardType: TextInputType.phone,
|
||||
cursorColor: AppColor.accentColor,
|
||||
controller: controller.phoneController,
|
||||
decoration: InputDecoration(
|
||||
focusColor: AppColor.accentColor,
|
||||
fillColor: AppColor.accentColor,
|
||||
border: const OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(12))),
|
||||
labelText: 'Phone'.tr,
|
||||
hintText: 'Enter your phone number'.tr,
|
||||
),
|
||||
validator: (value) {
|
||||
if (value!.isEmpty || value.length != 10) {
|
||||
return 'Please enter your phone number.'.tr;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
const SizedBox(
|
||||
height: 15,
|
||||
),
|
||||
TextFormField(
|
||||
obscureText: true,
|
||||
keyboardType: TextInputType.emailAddress,
|
||||
controller: controller.passwordController,
|
||||
decoration: InputDecoration(
|
||||
fillColor: AppColor.accentColor,
|
||||
hoverColor: AppColor.accentColor,
|
||||
focusColor: AppColor.accentColor,
|
||||
border: const OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(12))),
|
||||
labelText: 'Password'.tr,
|
||||
hintText: 'Enter your Password'.tr,
|
||||
),
|
||||
validator: (value) {
|
||||
if (value!.isEmpty || (value.length > 6)) {
|
||||
return 'Please enter Your Password.'.tr;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
MyElevatedButton(
|
||||
onPressed: () {
|
||||
if (controller.formKey.currentState!
|
||||
.validate()) {
|
||||
controller.login();
|
||||
}
|
||||
},
|
||||
title: 'Submit',
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)),
|
||||
Text(
|
||||
'if you dont have account'.tr,
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
TextFormField(
|
||||
controller: controller.phoneController,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Phone',
|
||||
),
|
||||
AnimatedTextKit(
|
||||
onTap: () => Get.to(() => RegisterPage()),
|
||||
animatedTexts: [
|
||||
TypewriterAnimatedText(
|
||||
'Register',
|
||||
textStyle: AppStyle.headtitle2,
|
||||
speed: const Duration(milliseconds: 200),
|
||||
),
|
||||
],
|
||||
totalRepeatCount: 4,
|
||||
pause: const Duration(milliseconds: 200),
|
||||
displayFullTextOnTap: true,
|
||||
stopPauseOnTap: true,
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
]);
|
||||
}
|
||||
|
||||
Padding agreedpage() {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Image.asset(
|
||||
'assets/images/notepad.png',
|
||||
width: Get.width * .2,
|
||||
),
|
||||
TextFormField(
|
||||
controller: controller.firstNameController,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'First Name',
|
||||
SizedBox(
|
||||
width: Get.width * .7,
|
||||
child: Text(
|
||||
'Accept Ride\'s Terms & Review Privacy Notice'.tr,
|
||||
style: AppStyle.headtitle2,
|
||||
),
|
||||
),
|
||||
TextFormField(
|
||||
controller: controller.lastNameController,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Last Name',
|
||||
),
|
||||
),
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
controller.login();
|
||||
},
|
||||
child: Text('Login'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
Text(
|
||||
'By selecting "I Agree" below, I have reviewed and agree to the Terms of Use and acknowledge the Privacy Notice. I am at least 18 years of age.'
|
||||
.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
const SizedBox(
|
||||
height: 100,
|
||||
),
|
||||
GetBuilder<LoginController>(
|
||||
builder: (controller) => Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Checkbox.adaptive(
|
||||
autofocus: true,
|
||||
tristate: true,
|
||||
splashRadius: 25,
|
||||
activeColor: AppColor.primaryColor,
|
||||
value: controller.isAgreeTerms,
|
||||
onChanged: (value) => controller.changeAgreeTerm(),
|
||||
),
|
||||
Text(
|
||||
'I Agree'.tr,
|
||||
style: controller.isAgreeTerms
|
||||
? AppStyle.title
|
||||
: AppStyle.title
|
||||
.copyWith(color: AppColor.accentColor),
|
||||
),
|
||||
],
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: 'Submit',
|
||||
onPressed: () => controller.saveAgreementTerms())
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
194
lib/views/auth/register_page.dart
Normal file
194
lib/views/auth/register_page.dart
Normal file
@@ -0,0 +1,194 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/constant/style.dart';
|
||||
import 'package:ride/controller/auth/register_controller.dart';
|
||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||
import 'package:ride/views/widgets/my_scafold.dart';
|
||||
|
||||
import '../../constant/colors.dart';
|
||||
|
||||
class RegisterPage extends StatelessWidget {
|
||||
const RegisterPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(RegisterController());
|
||||
return MyScafolld(
|
||||
title: 'Register',
|
||||
body: [
|
||||
GetBuilder<RegisterController>(
|
||||
builder: (controller) => Form(
|
||||
key: controller.formKey,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: SingleChildScrollView(
|
||||
child: Container(
|
||||
decoration: const BoxDecoration(
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
offset: Offset(3, 3),
|
||||
color: AppColor.accentColor,
|
||||
blurRadius: 3)
|
||||
],
|
||||
color: AppColor.secondaryColor,
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: Get.width * .4,
|
||||
child: TextFormField(
|
||||
keyboardType: TextInputType.text,
|
||||
controller: controller.firstNameController,
|
||||
decoration: InputDecoration(
|
||||
fillColor: AppColor.accentColor,
|
||||
hoverColor: AppColor.accentColor,
|
||||
focusColor: AppColor.accentColor,
|
||||
border: const OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(12))),
|
||||
labelText: 'First name'.tr,
|
||||
hintText: 'Enter your first name'.tr,
|
||||
),
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Please enter your first name.'.tr;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .4,
|
||||
child: TextFormField(
|
||||
keyboardType: TextInputType.text,
|
||||
controller: controller.lastNameController,
|
||||
decoration: InputDecoration(
|
||||
focusColor: AppColor.accentColor,
|
||||
fillColor: AppColor.accentColor,
|
||||
border: const OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(12))),
|
||||
labelText: 'Last name'.tr,
|
||||
hintText: 'Enter your last name'.tr,
|
||||
),
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Please enter your last name.'.tr;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 15,
|
||||
),
|
||||
TextFormField(
|
||||
keyboardType: TextInputType.emailAddress,
|
||||
controller: controller.emailController,
|
||||
decoration: InputDecoration(
|
||||
fillColor: AppColor.accentColor,
|
||||
hoverColor: AppColor.accentColor,
|
||||
focusColor: AppColor.accentColor,
|
||||
border: const OutlineInputBorder(
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(12))),
|
||||
labelText: 'Email'.tr,
|
||||
hintText: 'Enter your email address'.tr,
|
||||
),
|
||||
validator: (value) {
|
||||
if (value!.isEmpty ||
|
||||
(!value.contains('@') ||
|
||||
!value.contains('.'))) {
|
||||
return 'Please enter Your Email.'.tr;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
const SizedBox(
|
||||
height: 15,
|
||||
),
|
||||
TextFormField(
|
||||
obscureText: true,
|
||||
keyboardType: TextInputType.emailAddress,
|
||||
controller: controller.passwordController,
|
||||
decoration: InputDecoration(
|
||||
fillColor: AppColor.accentColor,
|
||||
hoverColor: AppColor.accentColor,
|
||||
focusColor: AppColor.accentColor,
|
||||
border: const OutlineInputBorder(
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(12))),
|
||||
labelText: 'Password'.tr,
|
||||
hintText: 'Enter your Password'.tr,
|
||||
),
|
||||
validator: (value) {
|
||||
if (value!.isEmpty || (value.length > 6)) {
|
||||
return 'Please enter Your Password.'.tr;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
const SizedBox(
|
||||
height: 15,
|
||||
),
|
||||
TextFormField(
|
||||
keyboardType: TextInputType.phone,
|
||||
cursorColor: AppColor.accentColor,
|
||||
controller: controller.phoneController,
|
||||
decoration: InputDecoration(
|
||||
focusColor: AppColor.accentColor,
|
||||
fillColor: AppColor.accentColor,
|
||||
border: const OutlineInputBorder(
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(12))),
|
||||
labelText: 'Phone'.tr,
|
||||
hintText: 'Enter your phone number'.tr,
|
||||
),
|
||||
validator: (value) {
|
||||
if (value!.isEmpty || value.length != 10) {
|
||||
return 'Please enter your phone number.'.tr;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
const SizedBox(
|
||||
height: 15,
|
||||
),
|
||||
InkWell(
|
||||
onTap: () => controller.getBirthDate(),
|
||||
child: Container(
|
||||
height: 50,
|
||||
width: Get.width,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(),
|
||||
borderRadius: BorderRadius.circular(13)),
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 20),
|
||||
child: Text(
|
||||
controller.birthDate,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: 'Register'.tr,
|
||||
onPressed: () => controller.register())
|
||||
]),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
isleading: true);
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,15 @@ class HomePage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MyScafolld(
|
||||
title: 'Home Page',
|
||||
body: Center(child: CircleContainer(child: const Icon(Icons.clear))));
|
||||
isleading: true,
|
||||
title: 'Home Page',
|
||||
body: [
|
||||
Center(
|
||||
child: CircleContainer(
|
||||
child: const Icon(Icons.clear),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
import 'package:ride/constant/colors.dart';
|
||||
import 'package:ride/controller/home/map_page_controller.dart';
|
||||
|
||||
import '../../constant/style.dart';
|
||||
import '../../controller/home/menu_controller.dart';
|
||||
import 'map_widget.dart/buttom_sheet_map_show.dart';
|
||||
import 'map_widget.dart/map_menu_widget.dart';
|
||||
@@ -22,88 +21,99 @@ class MapPage extends StatelessWidget {
|
||||
body: Stack(
|
||||
children: [
|
||||
GetBuilder<MapController>(
|
||||
builder: (controller) => GoogleMap(
|
||||
onMapCreated: controller.onMapCreated,
|
||||
cameraTargetBounds: CameraTargetBounds(controller.boundsdata),
|
||||
minMaxZoomPreference: const MinMaxZoomPreference(6, 18),
|
||||
onLongPress: (argument) {
|
||||
Get.defaultDialog(
|
||||
title: 'Are you want to go to this site',
|
||||
content: Column(
|
||||
children: [
|
||||
Text('${argument.latitude},${argument.longitude}'),
|
||||
],
|
||||
builder: (controller) => controller.isloading
|
||||
? const Center(
|
||||
child: CircularProgressIndicator.adaptive(),
|
||||
)
|
||||
: GoogleMap(
|
||||
onMapCreated: controller.onMapCreated,
|
||||
cameraTargetBounds:
|
||||
CameraTargetBounds(controller.boundsdata),
|
||||
minMaxZoomPreference: const MinMaxZoomPreference(6, 18),
|
||||
onLongPress: (argument) {
|
||||
Get.defaultDialog(
|
||||
title: 'Are you want to go to this site',
|
||||
content: Column(
|
||||
children: [
|
||||
Text('${argument.latitude},${argument.longitude}'),
|
||||
],
|
||||
),
|
||||
onConfirm: () async {
|
||||
controller.clearpolyline();
|
||||
await controller.getMap(
|
||||
'${controller.mylocation.latitude},${controller.mylocation.longitude}',
|
||||
'${argument.latitude.toString()},${argument.longitude.toString()}');
|
||||
|
||||
Get.back();
|
||||
controller.changeButtomSheetShown();
|
||||
controller.bottomSheet();
|
||||
},
|
||||
);
|
||||
},
|
||||
onTap: (argument) {
|
||||
controller.hidePlaces();
|
||||
|
||||
controller.changeButtomSheetShown();
|
||||
controller.bottomSheet();
|
||||
},
|
||||
initialCameraPosition: CameraPosition(
|
||||
target: controller.mylocation,
|
||||
zoom: 15,
|
||||
),
|
||||
markers: {
|
||||
for (var carLocation
|
||||
in controller.carsLocationByPassenger)
|
||||
Marker(
|
||||
position: carLocation,
|
||||
icon: controller.carIcon,
|
||||
markerId: MarkerId(carLocation.toString())),
|
||||
Marker(
|
||||
markerId: const MarkerId('MyLocation'),
|
||||
position: controller.mylocation,
|
||||
draggable: true,
|
||||
icon: controller.markerIcon,
|
||||
onDragEnd: (value) {
|
||||
print(value);
|
||||
},
|
||||
infoWindow: const InfoWindow(title: 'my location'),
|
||||
),
|
||||
Marker(
|
||||
markerId: const MarkerId('destination'),
|
||||
position: controller.mydestination,
|
||||
draggable: true,
|
||||
onDragEnd: (v) {
|
||||
print(v);
|
||||
},
|
||||
),
|
||||
},
|
||||
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,
|
||||
),
|
||||
},
|
||||
mapType: MapType.normal,
|
||||
myLocationButtonEnabled: true,
|
||||
indoorViewEnabled: true,
|
||||
trafficEnabled: true,
|
||||
buildingsEnabled: true,
|
||||
mapToolbarEnabled: true,
|
||||
onCameraMove: (position) {
|
||||
controller.newMylocation = position.target;
|
||||
// print('my' + controller.mylocation.toString());
|
||||
// print('new' + controller.newMylocation.toString());
|
||||
},
|
||||
myLocationEnabled: true,
|
||||
// liteModeEnabled: true,
|
||||
),
|
||||
onConfirm: () async {
|
||||
controller.clearpolyline();
|
||||
await controller.getMap(
|
||||
'${controller.mylocation.latitude},${controller.mylocation.longitude}',
|
||||
'${argument.latitude.toString()},${argument.longitude.toString()}');
|
||||
|
||||
Get.back();
|
||||
controller.changeButtomSheetShown();
|
||||
controller.bottomSheet();
|
||||
},
|
||||
);
|
||||
},
|
||||
onTap: (argument) {
|
||||
controller.hidePlaces();
|
||||
|
||||
controller.changeButtomSheetShown();
|
||||
controller.bottomSheet();
|
||||
},
|
||||
initialCameraPosition: CameraPosition(
|
||||
target: controller.mylocation,
|
||||
zoom: 15,
|
||||
),
|
||||
markers: {
|
||||
Marker(
|
||||
markerId: const MarkerId('MyLocation'),
|
||||
position: controller.mylocation,
|
||||
draggable: true,
|
||||
icon: controller.markerIcon,
|
||||
onDragEnd: (value) {
|
||||
print(value);
|
||||
},
|
||||
infoWindow: const InfoWindow(title: 'my location'),
|
||||
),
|
||||
Marker(
|
||||
markerId: const MarkerId('destination'),
|
||||
position: controller.mydestination,
|
||||
draggable: true,
|
||||
onDragEnd: (v) {
|
||||
print(v);
|
||||
},
|
||||
),
|
||||
},
|
||||
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,
|
||||
),
|
||||
},
|
||||
mapType: MapType.normal,
|
||||
myLocationButtonEnabled: true,
|
||||
indoorViewEnabled: true,
|
||||
trafficEnabled: true,
|
||||
buildingsEnabled: true,
|
||||
mapToolbarEnabled: true,
|
||||
onCameraMove: (position) {
|
||||
controller.newMylocation = position.target;
|
||||
// print('my' + controller.mylocation.toString());
|
||||
// print('new' + controller.newMylocation.toString());
|
||||
},
|
||||
myLocationEnabled: true,
|
||||
// liteModeEnabled: true,
|
||||
),
|
||||
),
|
||||
const PickerIconOnMap(),
|
||||
PickerAnimtionContainer(),
|
||||
|
||||
@@ -26,7 +26,8 @@ GetBuilder<MapController> buttomSheetMapPage() {
|
||||
controller.data.isEmpty
|
||||
? const SizedBox()
|
||||
: Container(
|
||||
// height: 100,
|
||||
// width: Get.width * .9,
|
||||
height: 100,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.secondaryColor,
|
||||
boxShadow: [
|
||||
@@ -47,7 +48,7 @@ GetBuilder<MapController> buttomSheetMapPage() {
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Image.asset(
|
||||
'assets/images/jeep.png',
|
||||
width: 88,
|
||||
width: 50,
|
||||
fit: BoxFit.fill,
|
||||
repeat: ImageRepeat.repeatX,
|
||||
),
|
||||
@@ -58,7 +59,9 @@ 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 ${DateFormat('h:mm a').format(controller.newTime)}'),
|
||||
Text(
|
||||
'You trip distance is ${controller.distance} KM')
|
||||
],
|
||||
),
|
||||
Text(
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:sqflite/sqflite.dart';
|
||||
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../controller/home/map_page_controller.dart';
|
||||
|
||||
@@ -7,6 +7,13 @@ class PassengerProfilePage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const MyScafolld(
|
||||
title: 'My Profile', body: Center(child: Text('ddd')));
|
||||
isleading: true,
|
||||
title: 'My Profile',
|
||||
body: [
|
||||
Center(
|
||||
child: Text('ddd'),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/main.dart';
|
||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||
|
||||
import '../../controller/local/local_controller.dart';
|
||||
@@ -24,14 +25,16 @@ class Language extends GetView<LocaleController> {
|
||||
title: 'Ar',
|
||||
onPressed: () {
|
||||
controller.changeLang("ar");
|
||||
Get.offAll(() => HomePage());
|
||||
main();
|
||||
// Get.offAll(() => HomePage());
|
||||
},
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: "En",
|
||||
onPressed: () {
|
||||
controller.changeLang("en");
|
||||
Get.offAll(() => HomePage());
|
||||
main();
|
||||
// Get.offAll(() => HomePage());
|
||||
},
|
||||
),
|
||||
],
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/constant/colors.dart';
|
||||
|
||||
import '../widgets/my_scafold.dart';
|
||||
@@ -9,6 +10,7 @@ class NotificationPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MyScafolld(
|
||||
isleading: true,
|
||||
title: 'Notifications',
|
||||
action: IconButton(
|
||||
onPressed: () {},
|
||||
@@ -17,14 +19,21 @@ class NotificationPage extends StatelessWidget {
|
||||
color: AppColor.primaryColor,
|
||||
),
|
||||
),
|
||||
body: Center(
|
||||
child: TextButton(
|
||||
onPressed: () {},
|
||||
child: Text(
|
||||
"Text Button",
|
||||
),
|
||||
body: [
|
||||
Container(
|
||||
color: AppColor.accentColor.withOpacity(.7),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 100,
|
||||
bottom: 100,
|
||||
left: 50,
|
||||
right: 50,
|
||||
child: Container(
|
||||
height: Get.height * .6,
|
||||
color: AppColor.secondaryColor,
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:ride/constant/style.dart';
|
||||
|
||||
import '../../constant/colors.dart';
|
||||
|
||||
@@ -21,7 +22,7 @@ class MyElevatedButton extends StatelessWidget {
|
||||
onPressed: onPressed,
|
||||
child: Text(
|
||||
title,
|
||||
style: const TextStyle(color: AppColor.accentColor),
|
||||
style: AppStyle.title.copyWith(color: AppColor.secondaryColor),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -10,11 +10,13 @@ class MyScafolld extends StatelessWidget {
|
||||
required this.title,
|
||||
required this.body,
|
||||
this.action = const Icon(Icons.clear),
|
||||
required this.isleading,
|
||||
});
|
||||
|
||||
final String title;
|
||||
final Widget body;
|
||||
final List<Widget> body;
|
||||
final Widget action;
|
||||
final bool isleading;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -23,21 +25,23 @@ class MyScafolld extends StatelessWidget {
|
||||
appBar: AppBar(
|
||||
backgroundColor: AppColor.secondaryColor,
|
||||
elevation: 0,
|
||||
leading: IconButton(
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.arrow_back_ios_new,
|
||||
color: AppColor.primaryColor,
|
||||
),
|
||||
),
|
||||
leading: isleading
|
||||
? IconButton(
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.arrow_back_ios_new,
|
||||
color: AppColor.primaryColor,
|
||||
),
|
||||
)
|
||||
: const SizedBox(),
|
||||
actions: [action],
|
||||
title: Text(
|
||||
title,
|
||||
style: AppStyle.title.copyWith(fontSize: 30),
|
||||
),
|
||||
),
|
||||
body: SafeArea(child: Stack(children: [body])));
|
||||
body: SafeArea(child: Stack(children: body)));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user