8-12/
This commit is contained in:
BIN
assets/images/car.png
Normal file
BIN
assets/images/car.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.5 KiB |
BIN
assets/images/notepad.png
Normal file
BIN
assets/images/notepad.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
@@ -2,4 +2,5 @@ class BoxName {
|
|||||||
static const String driverID = "driverID";
|
static const String driverID = "driverID";
|
||||||
|
|
||||||
static const String lang = "lang";
|
static const String lang = "lang";
|
||||||
|
static const String agreeTerms = "agreeTerms";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class AppLink {
|
class AppLink {
|
||||||
static const String server = 'https://ride.mobile-app.store/';
|
static const String server = 'https://ride.mobile-app.store';
|
||||||
static const String googleMapsLink = 'https://maps.googleapis.com/maps/api/';
|
static const String googleMapsLink = 'https://maps.googleapis.com/maps/api/';
|
||||||
|
|
||||||
static const String test = "$server/test.php";
|
static const String test = "$server/test.php";
|
||||||
@@ -9,12 +9,11 @@ class AppLink {
|
|||||||
static const String uploadImageType = "$server/uploadImageType.php";
|
static const String uploadImageType = "$server/uploadImageType.php";
|
||||||
|
|
||||||
//==================certifcate==========
|
//==================certifcate==========
|
||||||
static const String certifcate =
|
static const String location = '$server/ride/location';
|
||||||
'https://portfolio.mobile-app.store/hamzaayed/certifications';
|
static const String getCarsLocationByPassenger = "$location/get.php";
|
||||||
static const String getCertificate = "$certifcate/get.php";
|
static const String addCarsLocationByPassenger = "$location/add.php";
|
||||||
static const String addCertificate = "$certifcate/add.php";
|
static const String deleteCarsLocationByPassenger = "$location/delete.php";
|
||||||
static const String deleteCertificate = "$certifcate/delete.php";
|
static const String updateCarsLocationByPassenger = "$location/update.php";
|
||||||
static const String updateCertificate = "$certifcate/update.php";
|
|
||||||
|
|
||||||
//==================Blog=============
|
//==================Blog=============
|
||||||
static const String blog =
|
static const String blog =
|
||||||
@@ -23,4 +22,8 @@ class AppLink {
|
|||||||
static const String addBlog = "$blog/add.php";
|
static const String addBlog = "$blog/add.php";
|
||||||
static const String deleteBlog = "$blog/delete.php";
|
static const String deleteBlog = "$blog/delete.php";
|
||||||
static const String updateBlog = "$blog/update.php";
|
static const String updateBlog = "$blog/update.php";
|
||||||
|
|
||||||
|
//===================Auth============
|
||||||
|
static const String auth = 'https://ride.mobile-app.store/auth/';
|
||||||
|
static const String login = "$auth/login.php";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,25 +7,25 @@ class AppStyle {
|
|||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
fontSize: 40,
|
fontSize: 40,
|
||||||
color: AppColor.accentColor,
|
color: AppColor.accentColor,
|
||||||
fontFamily: GoogleFonts.pacifico().fontFamily);
|
fontFamily: GoogleFonts.josefinSans().fontFamily);
|
||||||
static TextStyle headtitle2 = TextStyle(
|
static TextStyle headtitle2 = TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
fontSize: 26,
|
fontSize: 26,
|
||||||
color: AppColor.primaryColor,
|
color: AppColor.primaryColor,
|
||||||
fontFamily: GoogleFonts.eduSaBeginner().fontFamily);
|
fontFamily: GoogleFonts.josefinSans().fontFamily);
|
||||||
static TextStyle title = TextStyle(
|
static TextStyle title = TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
color: AppColor.primaryColor,
|
color: AppColor.primaryColor,
|
||||||
fontFamily: GoogleFonts.roboto().fontFamily);
|
fontFamily: GoogleFonts.josefinSans().fontFamily);
|
||||||
static TextStyle subtitle = TextStyle(
|
static TextStyle subtitle = TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
color: AppColor.primaryColor,
|
color: AppColor.primaryColor,
|
||||||
fontFamily: GoogleFonts.roboto().fontFamily);
|
fontFamily: GoogleFonts.josefinSans().fontFamily);
|
||||||
static TextStyle number = TextStyle(
|
static TextStyle number = TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
color: AppColor.primaryColor,
|
color: AppColor.primaryColor,
|
||||||
fontFamily: GoogleFonts.roboto().fontFamily);
|
fontFamily: GoogleFonts.josefinSans().fontFamily);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,50 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:ride/constant/box_name.dart';
|
||||||
|
import 'package:ride/constant/links.dart';
|
||||||
|
import 'package:ride/controller/functions/crud.dart';
|
||||||
|
import 'package:ride/main.dart';
|
||||||
|
|
||||||
class LoginController extends GetxController {
|
class LoginController extends GetxController {
|
||||||
|
final formKey = GlobalKey<FormState>();
|
||||||
TextEditingController emailController = TextEditingController();
|
TextEditingController emailController = TextEditingController();
|
||||||
TextEditingController phoneController = TextEditingController();
|
TextEditingController phoneController = TextEditingController();
|
||||||
TextEditingController firstNameController = TextEditingController();
|
TextEditingController passwordController = TextEditingController();
|
||||||
TextEditingController lastNameController = TextEditingController();
|
bool isAgreeTerms = false;
|
||||||
|
|
||||||
void login() {
|
void changeAgreeTerm() {
|
||||||
//TODO: Implement login logic
|
isAgreeTerms = !isAgreeTerms;
|
||||||
|
print(isAgreeTerms);
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
void saveAgreementTerms() {
|
||||||
|
box.write(BoxName.agreeTerms, 'agreed');
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
void login() async {
|
||||||
|
Map<String, dynamic> res = await CRUD().post(link: AppLink.login, payload: {
|
||||||
|
'email': emailController.text,
|
||||||
|
'phone': phoneController.text,
|
||||||
|
'password': passwordController.text
|
||||||
|
});
|
||||||
|
|
||||||
|
if (res.isNotEmpty) {
|
||||||
|
if (res['status'] == 'success1') {
|
||||||
|
print(res);
|
||||||
|
} else {
|
||||||
|
print('noooooooooooooooo');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
print('res is null');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onInit() {
|
||||||
|
super.onInit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
48
lib/controller/auth/register_controller.dart
Normal file
48
lib/controller/auth/register_controller.dart
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
class RegisterController extends GetxController {
|
||||||
|
final formKey = GlobalKey<FormState>();
|
||||||
|
|
||||||
|
TextEditingController firstNameController = TextEditingController();
|
||||||
|
TextEditingController lastNameController = TextEditingController();
|
||||||
|
TextEditingController emailController = TextEditingController();
|
||||||
|
TextEditingController phoneController = TextEditingController();
|
||||||
|
TextEditingController passwordController = TextEditingController();
|
||||||
|
|
||||||
|
String birthDate = 'Birth Date'.tr;
|
||||||
|
@override
|
||||||
|
void onInit() {
|
||||||
|
super.onInit();
|
||||||
|
}
|
||||||
|
|
||||||
|
getBirthDate() {
|
||||||
|
Get.defaultDialog(
|
||||||
|
title: 'Select Date',
|
||||||
|
content: SizedBox(
|
||||||
|
width: 300,
|
||||||
|
child: CalendarDatePicker(
|
||||||
|
initialDate: DateTime.now().subtract(const Duration(days: 14 * 365)),
|
||||||
|
firstDate: DateTime.parse('1940-06-01'),
|
||||||
|
lastDate: DateTime.now().subtract(const Duration(days: 14 * 365)),
|
||||||
|
onDateChanged: (date) {
|
||||||
|
// Get the selected date and convert it to a DateTime object
|
||||||
|
DateTime dateTime = date;
|
||||||
|
// Call the getOrders() function from the controller
|
||||||
|
birthDate = dateTime.toString().split(' ')[0];
|
||||||
|
update();
|
||||||
|
Get.back();
|
||||||
|
},
|
||||||
|
|
||||||
|
// onDateChanged: (DateTime value) {},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void register() {
|
||||||
|
if (formKey.currentState!.validate()) {
|
||||||
|
// Do something with the data
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,17 +9,26 @@ class CRUD {
|
|||||||
required String link,
|
required String link,
|
||||||
Map<String, dynamic>? payload,
|
Map<String, dynamic>? payload,
|
||||||
}) async {
|
}) async {
|
||||||
var url = Uri.parse(link);
|
var url = Uri.parse(
|
||||||
var response = await http.get(
|
link,
|
||||||
|
);
|
||||||
|
var response = await http.post(
|
||||||
url,
|
url,
|
||||||
|
body: payload,
|
||||||
headers: {
|
headers: {
|
||||||
|
"Content-Type": "application/x-www-form-urlencoded",
|
||||||
'Authorization':
|
'Authorization':
|
||||||
'Basic ${base64Encode(utf8.encode(AppCredintials.basicAuthCredentials))}',
|
'Basic ${base64Encode(utf8.encode(AppCredintials.basicAuthCredentials))}',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
List data = jsonDecode(response.body)['data'];
|
// print("--------------" + response.body.toString());
|
||||||
print(data);
|
if (response.statusCode == 200) {
|
||||||
return data;
|
var jsonData = jsonDecode(response.body);
|
||||||
|
if (jsonData['status'] == 'success') {
|
||||||
|
print(jsonData['message']);
|
||||||
|
return jsonData['message'];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<dynamic> post({
|
Future<dynamic> post({
|
||||||
@@ -50,7 +59,7 @@ class CRUD {
|
|||||||
return response.body;
|
return response.body;
|
||||||
} else if (jsonData['status'] == 'success1') {
|
} else if (jsonData['status'] == 'success1') {
|
||||||
print(jsonData['data']);
|
print(jsonData['data']);
|
||||||
return jsonData['data'];
|
return jsonData;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return (response.body);
|
return (response.body);
|
||||||
|
|||||||
@@ -1,13 +1,10 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'dart:math' as math;
|
|
||||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||||
import 'package:google_polyline_algorithm/google_polyline_algorithm.dart';
|
import 'package:google_polyline_algorithm/google_polyline_algorithm.dart';
|
||||||
import 'package:location/location.dart';
|
import 'package:location/location.dart';
|
||||||
import 'package:ride/constant/colors.dart';
|
|
||||||
import 'package:ride/constant/credential.dart';
|
import 'package:ride/constant/credential.dart';
|
||||||
import 'package:ride/constant/links.dart';
|
import 'package:ride/constant/links.dart';
|
||||||
import 'package:ride/constant/style.dart';
|
|
||||||
import 'package:ride/controller/functions/crud.dart';
|
import 'package:ride/controller/functions/crud.dart';
|
||||||
import 'package:ride/views/home/map_widget.dart/buttom_sheet_map_show.dart';
|
import 'package:ride/views/home/map_widget.dart/buttom_sheet_map_show.dart';
|
||||||
|
|
||||||
@@ -24,7 +21,9 @@ class MapController extends GetxController {
|
|||||||
late LatLng newMylocation = const LatLng(32.115295, 36.064773);
|
late LatLng newMylocation = const LatLng(32.115295, 36.064773);
|
||||||
LatLng mydestination = const LatLng(32.115295, 36.064773);
|
LatLng mydestination = const LatLng(32.115295, 36.064773);
|
||||||
final List<LatLng> polylineCoordinates = [];
|
final List<LatLng> polylineCoordinates = [];
|
||||||
|
final List<LatLng> carsLocationByPassenger = [];
|
||||||
BitmapDescriptor markerIcon = BitmapDescriptor.defaultMarker;
|
BitmapDescriptor markerIcon = BitmapDescriptor.defaultMarker;
|
||||||
|
BitmapDescriptor carIcon = BitmapDescriptor.defaultMarker;
|
||||||
double height = 200;
|
double height = 200;
|
||||||
final location = Location();
|
final location = Location();
|
||||||
late LocationData currentLocation;
|
late LocationData currentLocation;
|
||||||
@@ -110,7 +109,21 @@ class MapController extends GetxController {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void addCustomCarIcon() {
|
||||||
|
ImageConfiguration config = const ImageConfiguration(
|
||||||
|
size: Size(50, 50),
|
||||||
|
// scale: 1.0,
|
||||||
|
);
|
||||||
|
BitmapDescriptor.fromAssetImage(config, 'assets/images/car.png')
|
||||||
|
.then((value) {
|
||||||
|
carIcon = value;
|
||||||
|
update();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> getLocation() async {
|
Future<void> getLocation() async {
|
||||||
|
isloading = true;
|
||||||
|
update();
|
||||||
bool serviceEnabled;
|
bool serviceEnabled;
|
||||||
PermissionStatus permissionGranted;
|
PermissionStatus permissionGranted;
|
||||||
|
|
||||||
@@ -134,16 +147,33 @@ class MapController extends GetxController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Configure location accuracy
|
||||||
|
LocationAccuracy desiredAccuracy = LocationAccuracy.high;
|
||||||
|
|
||||||
// Get the current location
|
// Get the current location
|
||||||
LocationData _locationData = await location.getLocation();
|
LocationData _locationData = await location.getLocation();
|
||||||
mylocation =
|
mylocation =
|
||||||
(_locationData.latitude != null && _locationData.longitude != null
|
(_locationData.latitude != null && _locationData.longitude != null
|
||||||
? LatLng(_locationData.latitude!, _locationData.longitude!)
|
? LatLng(_locationData.latitude!, _locationData.longitude!)
|
||||||
: null)!;
|
: null)!;
|
||||||
// print('accuracy' + _locationData.accuracy.toString());
|
|
||||||
// print(_locationData.latitude);
|
// Print location details
|
||||||
// print(_locationData.time);
|
print('Accuracy: ${_locationData.accuracy}');
|
||||||
// print('//////////////////////////////////////');
|
print('Latitude: ${_locationData.latitude}');
|
||||||
|
print('Longitude: ${_locationData.longitude}');
|
||||||
|
print('Time: ${_locationData.time}');
|
||||||
|
isloading = false;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future getCarsLocationByPassenger() async {
|
||||||
|
List data =
|
||||||
|
await CRUD().get(link: AppLink.getCarsLocationByPassenger, payload: {});
|
||||||
|
for (var i = 0; i < data.length; i++) {
|
||||||
|
carsLocationByPassenger.add(LatLng(double.parse(data[i]['latitude']),
|
||||||
|
double.parse(data[i]['longitude'])));
|
||||||
|
}
|
||||||
|
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -357,11 +387,13 @@ class MapController extends GetxController {
|
|||||||
List<LatLng> polylineCoordinate = [];
|
List<LatLng> polylineCoordinate = [];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() async {
|
||||||
// getPolyLine();
|
// getPolyLine();
|
||||||
// getMap();
|
// getMap();
|
||||||
getLocation();
|
getLocation();
|
||||||
|
await getCarsLocationByPassenger();
|
||||||
addCustomPicker();
|
addCustomPicker();
|
||||||
|
addCustomCarIcon();
|
||||||
|
|
||||||
super.onInit();
|
super.onInit();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import 'package:firebase_core/firebase_core.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:get_storage/get_storage.dart';
|
import 'package:get_storage/get_storage.dart';
|
||||||
|
import 'package:ride/views/auth/login_page.dart';
|
||||||
import 'package:ride/views/lang/languages.dart';
|
import 'package:ride/views/lang/languages.dart';
|
||||||
|
|
||||||
import 'constant/box_name.dart';
|
import 'constant/box_name.dart';
|
||||||
@@ -45,6 +46,6 @@ class MyApp extends StatelessWidget {
|
|||||||
home: box.read(BoxName.lang).toString() != 'ar' &&
|
home: box.read(BoxName.lang).toString() != 'ar' &&
|
||||||
box.read(BoxName.lang).toString() != 'en'
|
box.read(BoxName.lang).toString() != 'en'
|
||||||
? const Language()
|
? const Language()
|
||||||
: const MapPage());
|
: LoginPage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,15 @@
|
|||||||
|
import 'package:animated_text_kit/animated_text_kit.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.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 '../../controller/auth/login_controller.dart';
|
||||||
|
import 'register_page.dart';
|
||||||
|
|
||||||
class LoginPage extends StatelessWidget {
|
class LoginPage extends StatelessWidget {
|
||||||
final controller = Get.put(LoginController());
|
final controller = Get.put(LoginController());
|
||||||
@@ -10,49 +18,202 @@ class LoginPage extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
Get.put(LoginController());
|
||||||
appBar: AppBar(
|
return MyScafolld(title: 'Login', isleading: false, body: [
|
||||||
title: Text('Login'),
|
if (box.read(BoxName.agreeTerms) != 'agreed')
|
||||||
),
|
agreedpage()
|
||||||
body: Center(
|
else
|
||||||
child: Padding(
|
SingleChildScrollView(
|
||||||
padding: const EdgeInsets.all(22),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
children: [
|
||||||
TextFormField(
|
Padding(
|
||||||
controller: controller.emailController,
|
padding: const EdgeInsets.all(25),
|
||||||
decoration: InputDecoration(
|
child: Container(
|
||||||
labelText: 'Email',
|
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(
|
AnimatedTextKit(
|
||||||
controller: controller.phoneController,
|
onTap: () => Get.to(() => RegisterPage()),
|
||||||
decoration: InputDecoration(
|
animatedTexts: [
|
||||||
labelText: 'Phone',
|
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(
|
SizedBox(
|
||||||
controller: controller.firstNameController,
|
width: Get.width * .7,
|
||||||
decoration: InputDecoration(
|
child: Text(
|
||||||
labelText: 'First Name',
|
'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
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MyScafolld(
|
return MyScafolld(
|
||||||
title: 'Home Page',
|
isleading: true,
|
||||||
body: Center(child: CircleContainer(child: const Icon(Icons.clear))));
|
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/constant/colors.dart';
|
||||||
import 'package:ride/controller/home/map_page_controller.dart';
|
import 'package:ride/controller/home/map_page_controller.dart';
|
||||||
|
|
||||||
import '../../constant/style.dart';
|
|
||||||
import '../../controller/home/menu_controller.dart';
|
import '../../controller/home/menu_controller.dart';
|
||||||
import 'map_widget.dart/buttom_sheet_map_show.dart';
|
import 'map_widget.dart/buttom_sheet_map_show.dart';
|
||||||
import 'map_widget.dart/map_menu_widget.dart';
|
import 'map_widget.dart/map_menu_widget.dart';
|
||||||
@@ -22,88 +21,99 @@ class MapPage extends StatelessWidget {
|
|||||||
body: Stack(
|
body: Stack(
|
||||||
children: [
|
children: [
|
||||||
GetBuilder<MapController>(
|
GetBuilder<MapController>(
|
||||||
builder: (controller) => GoogleMap(
|
builder: (controller) => controller.isloading
|
||||||
onMapCreated: controller.onMapCreated,
|
? const Center(
|
||||||
cameraTargetBounds: CameraTargetBounds(controller.boundsdata),
|
child: CircularProgressIndicator.adaptive(),
|
||||||
minMaxZoomPreference: const MinMaxZoomPreference(6, 18),
|
)
|
||||||
onLongPress: (argument) {
|
: GoogleMap(
|
||||||
Get.defaultDialog(
|
onMapCreated: controller.onMapCreated,
|
||||||
title: 'Are you want to go to this site',
|
cameraTargetBounds:
|
||||||
content: Column(
|
CameraTargetBounds(controller.boundsdata),
|
||||||
children: [
|
minMaxZoomPreference: const MinMaxZoomPreference(6, 18),
|
||||||
Text('${argument.latitude},${argument.longitude}'),
|
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(),
|
const PickerIconOnMap(),
|
||||||
PickerAnimtionContainer(),
|
PickerAnimtionContainer(),
|
||||||
|
|||||||
@@ -26,7 +26,8 @@ GetBuilder<MapController> buttomSheetMapPage() {
|
|||||||
controller.data.isEmpty
|
controller.data.isEmpty
|
||||||
? const SizedBox()
|
? const SizedBox()
|
||||||
: Container(
|
: Container(
|
||||||
// height: 100,
|
// width: Get.width * .9,
|
||||||
|
height: 100,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: AppColor.secondaryColor,
|
color: AppColor.secondaryColor,
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
@@ -47,7 +48,7 @@ GetBuilder<MapController> buttomSheetMapPage() {
|
|||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
'assets/images/jeep.png',
|
'assets/images/jeep.png',
|
||||||
width: 88,
|
width: 50,
|
||||||
fit: BoxFit.fill,
|
fit: BoxFit.fill,
|
||||||
repeat: ImageRepeat.repeatX,
|
repeat: ImageRepeat.repeatX,
|
||||||
),
|
),
|
||||||
@@ -58,7 +59,9 @@ GetBuilder<MapController> buttomSheetMapPage() {
|
|||||||
Text(
|
Text(
|
||||||
'${'Your Ride Duration is '.tr}${controller.duration} minutes'),
|
'${'Your Ride Duration is '.tr}${controller.duration} minutes'),
|
||||||
Text(
|
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(
|
Text(
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:sqflite/sqflite.dart';
|
|
||||||
|
|
||||||
import '../../../constant/colors.dart';
|
import '../../../constant/colors.dart';
|
||||||
import '../../../controller/home/map_page_controller.dart';
|
import '../../../controller/home/map_page_controller.dart';
|
||||||
|
|||||||
@@ -7,6 +7,13 @@ class PassengerProfilePage extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return const MyScafolld(
|
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:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:ride/main.dart';
|
||||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||||
|
|
||||||
import '../../controller/local/local_controller.dart';
|
import '../../controller/local/local_controller.dart';
|
||||||
@@ -24,14 +25,16 @@ class Language extends GetView<LocaleController> {
|
|||||||
title: 'Ar',
|
title: 'Ar',
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
controller.changeLang("ar");
|
controller.changeLang("ar");
|
||||||
Get.offAll(() => HomePage());
|
main();
|
||||||
|
// Get.offAll(() => HomePage());
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
MyElevatedButton(
|
MyElevatedButton(
|
||||||
title: "En",
|
title: "En",
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
controller.changeLang("en");
|
controller.changeLang("en");
|
||||||
Get.offAll(() => HomePage());
|
main();
|
||||||
|
// Get.offAll(() => HomePage());
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
import 'package:ride/constant/colors.dart';
|
import 'package:ride/constant/colors.dart';
|
||||||
|
|
||||||
import '../widgets/my_scafold.dart';
|
import '../widgets/my_scafold.dart';
|
||||||
@@ -9,6 +10,7 @@ class NotificationPage extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MyScafolld(
|
return MyScafolld(
|
||||||
|
isleading: true,
|
||||||
title: 'Notifications',
|
title: 'Notifications',
|
||||||
action: IconButton(
|
action: IconButton(
|
||||||
onPressed: () {},
|
onPressed: () {},
|
||||||
@@ -17,14 +19,21 @@ class NotificationPage extends StatelessWidget {
|
|||||||
color: AppColor.primaryColor,
|
color: AppColor.primaryColor,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
body: Center(
|
body: [
|
||||||
child: TextButton(
|
Container(
|
||||||
onPressed: () {},
|
color: AppColor.accentColor.withOpacity(.7),
|
||||||
child: Text(
|
|
||||||
"Text Button",
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
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:flutter/material.dart';
|
||||||
|
import 'package:ride/constant/style.dart';
|
||||||
|
|
||||||
import '../../constant/colors.dart';
|
import '../../constant/colors.dart';
|
||||||
|
|
||||||
@@ -21,7 +22,7 @@ class MyElevatedButton extends StatelessWidget {
|
|||||||
onPressed: onPressed,
|
onPressed: onPressed,
|
||||||
child: Text(
|
child: Text(
|
||||||
title,
|
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.title,
|
||||||
required this.body,
|
required this.body,
|
||||||
this.action = const Icon(Icons.clear),
|
this.action = const Icon(Icons.clear),
|
||||||
|
required this.isleading,
|
||||||
});
|
});
|
||||||
|
|
||||||
final String title;
|
final String title;
|
||||||
final Widget body;
|
final List<Widget> body;
|
||||||
final Widget action;
|
final Widget action;
|
||||||
|
final bool isleading;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -23,21 +25,23 @@ class MyScafolld extends StatelessWidget {
|
|||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
backgroundColor: AppColor.secondaryColor,
|
backgroundColor: AppColor.secondaryColor,
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
leading: IconButton(
|
leading: isleading
|
||||||
onPressed: () {
|
? IconButton(
|
||||||
Get.back();
|
onPressed: () {
|
||||||
},
|
Get.back();
|
||||||
icon: const Icon(
|
},
|
||||||
Icons.arrow_back_ios_new,
|
icon: const Icon(
|
||||||
color: AppColor.primaryColor,
|
Icons.arrow_back_ios_new,
|
||||||
),
|
color: AppColor.primaryColor,
|
||||||
),
|
),
|
||||||
|
)
|
||||||
|
: const SizedBox(),
|
||||||
actions: [action],
|
actions: [action],
|
||||||
title: Text(
|
title: Text(
|
||||||
title,
|
title,
|
||||||
style: AppStyle.title.copyWith(fontSize: 30),
|
style: AppStyle.title.copyWith(fontSize: 30),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
body: SafeArea(child: Stack(children: [body])));
|
body: SafeArea(child: Stack(children: body)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.4"
|
version: "1.3.4"
|
||||||
|
animated_text_kit:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: animated_text_kit
|
||||||
|
sha256: "37392a5376c9a1a503b02463c38bc0342ef814ddbb8f9977bc90f2a84b22fa92"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "4.2.2"
|
||||||
archive:
|
archive:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ dependencies:
|
|||||||
location: ^5.0.2+1
|
location: ^5.0.2+1
|
||||||
google_polyline_algorithm: ^3.1.0
|
google_polyline_algorithm: ^3.1.0
|
||||||
custom_searchable_dropdown: ^2.1.1
|
custom_searchable_dropdown: ^2.1.1
|
||||||
|
animated_text_kit: ^4.2.2
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
|||||||
Reference in New Issue
Block a user