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 lang = "lang";
|
||||
static const String agreeTerms = "agreeTerms";
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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 test = "$server/test.php";
|
||||
@@ -9,12 +9,11 @@ class AppLink {
|
||||
static const String uploadImageType = "$server/uploadImageType.php";
|
||||
|
||||
//==================certifcate==========
|
||||
static const String certifcate =
|
||||
'https://portfolio.mobile-app.store/hamzaayed/certifications';
|
||||
static const String getCertificate = "$certifcate/get.php";
|
||||
static const String addCertificate = "$certifcate/add.php";
|
||||
static const String deleteCertificate = "$certifcate/delete.php";
|
||||
static const String updateCertificate = "$certifcate/update.php";
|
||||
static const String location = '$server/ride/location';
|
||||
static const String getCarsLocationByPassenger = "$location/get.php";
|
||||
static const String addCarsLocationByPassenger = "$location/add.php";
|
||||
static const String deleteCarsLocationByPassenger = "$location/delete.php";
|
||||
static const String updateCarsLocationByPassenger = "$location/update.php";
|
||||
|
||||
//==================Blog=============
|
||||
static const String blog =
|
||||
@@ -23,4 +22,8 @@ class AppLink {
|
||||
static const String addBlog = "$blog/add.php";
|
||||
static const String deleteBlog = "$blog/delete.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,
|
||||
fontSize: 40,
|
||||
color: AppColor.accentColor,
|
||||
fontFamily: GoogleFonts.pacifico().fontFamily);
|
||||
fontFamily: GoogleFonts.josefinSans().fontFamily);
|
||||
static TextStyle headtitle2 = TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 26,
|
||||
color: AppColor.primaryColor,
|
||||
fontFamily: GoogleFonts.eduSaBeginner().fontFamily);
|
||||
fontFamily: GoogleFonts.josefinSans().fontFamily);
|
||||
static TextStyle title = TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
color: AppColor.primaryColor,
|
||||
fontFamily: GoogleFonts.roboto().fontFamily);
|
||||
fontFamily: GoogleFonts.josefinSans().fontFamily);
|
||||
static TextStyle subtitle = TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 13,
|
||||
color: AppColor.primaryColor,
|
||||
fontFamily: GoogleFonts.roboto().fontFamily);
|
||||
fontFamily: GoogleFonts.josefinSans().fontFamily);
|
||||
static TextStyle number = TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 20,
|
||||
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: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 {
|
||||
final formKey = GlobalKey<FormState>();
|
||||
TextEditingController emailController = TextEditingController();
|
||||
TextEditingController phoneController = TextEditingController();
|
||||
TextEditingController firstNameController = TextEditingController();
|
||||
TextEditingController lastNameController = TextEditingController();
|
||||
TextEditingController passwordController = TextEditingController();
|
||||
bool isAgreeTerms = false;
|
||||
|
||||
void login() {
|
||||
//TODO: Implement login logic
|
||||
void changeAgreeTerm() {
|
||||
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,
|
||||
Map<String, dynamic>? payload,
|
||||
}) async {
|
||||
var url = Uri.parse(link);
|
||||
var response = await http.get(
|
||||
var url = Uri.parse(
|
||||
link,
|
||||
);
|
||||
var response = await http.post(
|
||||
url,
|
||||
body: payload,
|
||||
headers: {
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
'Authorization':
|
||||
'Basic ${base64Encode(utf8.encode(AppCredintials.basicAuthCredentials))}',
|
||||
},
|
||||
);
|
||||
List data = jsonDecode(response.body)['data'];
|
||||
print(data);
|
||||
return data;
|
||||
// print("--------------" + response.body.toString());
|
||||
if (response.statusCode == 200) {
|
||||
var jsonData = jsonDecode(response.body);
|
||||
if (jsonData['status'] == 'success') {
|
||||
print(jsonData['message']);
|
||||
return jsonData['message'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Future<dynamic> post({
|
||||
@@ -50,7 +59,7 @@ class CRUD {
|
||||
return response.body;
|
||||
} else if (jsonData['status'] == 'success1') {
|
||||
print(jsonData['data']);
|
||||
return jsonData['data'];
|
||||
return jsonData;
|
||||
}
|
||||
}
|
||||
return (response.body);
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'dart:math' as math;
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
import 'package:google_polyline_algorithm/google_polyline_algorithm.dart';
|
||||
import 'package:location/location.dart';
|
||||
import 'package:ride/constant/colors.dart';
|
||||
import 'package:ride/constant/credential.dart';
|
||||
import 'package:ride/constant/links.dart';
|
||||
import 'package:ride/constant/style.dart';
|
||||
import 'package:ride/controller/functions/crud.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);
|
||||
LatLng mydestination = const LatLng(32.115295, 36.064773);
|
||||
final List<LatLng> polylineCoordinates = [];
|
||||
final List<LatLng> carsLocationByPassenger = [];
|
||||
BitmapDescriptor markerIcon = BitmapDescriptor.defaultMarker;
|
||||
BitmapDescriptor carIcon = BitmapDescriptor.defaultMarker;
|
||||
double height = 200;
|
||||
final location = Location();
|
||||
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 {
|
||||
isloading = true;
|
||||
update();
|
||||
bool serviceEnabled;
|
||||
PermissionStatus permissionGranted;
|
||||
|
||||
@@ -134,16 +147,33 @@ class MapController extends GetxController {
|
||||
}
|
||||
}
|
||||
|
||||
// Configure location accuracy
|
||||
LocationAccuracy desiredAccuracy = LocationAccuracy.high;
|
||||
|
||||
// Get the current location
|
||||
LocationData _locationData = await location.getLocation();
|
||||
mylocation =
|
||||
(_locationData.latitude != null && _locationData.longitude != null
|
||||
? LatLng(_locationData.latitude!, _locationData.longitude!)
|
||||
: null)!;
|
||||
// print('accuracy' + _locationData.accuracy.toString());
|
||||
// print(_locationData.latitude);
|
||||
// print(_locationData.time);
|
||||
// print('//////////////////////////////////////');
|
||||
|
||||
// Print location details
|
||||
print('Accuracy: ${_locationData.accuracy}');
|
||||
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();
|
||||
}
|
||||
|
||||
@@ -357,11 +387,13 @@ class MapController extends GetxController {
|
||||
List<LatLng> polylineCoordinate = [];
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
void onInit() async {
|
||||
// getPolyLine();
|
||||
// getMap();
|
||||
getLocation();
|
||||
await getCarsLocationByPassenger();
|
||||
addCustomPicker();
|
||||
addCustomCarIcon();
|
||||
|
||||
super.onInit();
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:firebase_core/firebase_core.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get_storage/get_storage.dart';
|
||||
import 'package:ride/views/auth/login_page.dart';
|
||||
import 'package:ride/views/lang/languages.dart';
|
||||
|
||||
import 'constant/box_name.dart';
|
||||
@@ -45,6 +46,6 @@ class MyApp extends StatelessWidget {
|
||||
home: box.read(BoxName.lang).toString() != 'ar' &&
|
||||
box.read(BoxName.lang).toString() != 'en'
|
||||
? 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: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)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
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:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
@@ -52,6 +52,7 @@ dependencies:
|
||||
location: ^5.0.2+1
|
||||
google_polyline_algorithm: ^3.1.0
|
||||
custom_searchable_dropdown: ^2.1.1
|
||||
animated_text_kit: ^4.2.2
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
||||
Reference in New Issue
Block a user