8-15/1
This commit is contained in:
@@ -17,6 +17,9 @@
|
|||||||
</activity>
|
</activity>
|
||||||
<meta-data android:name="com.google.android.geo.API_KEY" android:value="AIzaSyCyfwRXTwSTLOFQSQgN5p7QZgGJVZnEKq0" />
|
<meta-data android:name="com.google.android.geo.API_KEY" android:value="AIzaSyCyfwRXTwSTLOFQSQgN5p7QZgGJVZnEKq0" />
|
||||||
|
|
||||||
|
<meta-data android:name="com.google.firebase.messaging.default_notification_channel_id" android:value="@string/default_notification_channel_id" />
|
||||||
|
<meta-data android:name="com.android.application.versionCode" android:value="1" />
|
||||||
|
|
||||||
<!-- Don't delete the meta-data below.
|
<!-- Don't delete the meta-data below.
|
||||||
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
||||||
<meta-data android:name="flutterEmbedding" android:value="2" />
|
<meta-data android:name="flutterEmbedding" android:value="2" />
|
||||||
|
|||||||
4
android/app/src/main/res/values/strings.xml
Normal file
4
android/app/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<resources>
|
||||||
|
<string name="app_name">My App</string>
|
||||||
|
<string name="default_notification_channel_id">ride_channel</string>
|
||||||
|
</resources>
|
||||||
BIN
assets/images/education.png
Normal file
BIN
assets/images/education.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
BIN
assets/images/employmentType.png
Normal file
BIN
assets/images/employmentType.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
BIN
assets/images/gender.png
Normal file
BIN
assets/images/gender.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
BIN
assets/images/maritalStatus.png
Normal file
BIN
assets/images/maritalStatus.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.6 KiB |
@@ -5,6 +5,7 @@ class BoxName {
|
|||||||
static const String agreeTerms = "agreeTerms";
|
static const String agreeTerms = "agreeTerms";
|
||||||
static const String pasengerID = "pasengerID";
|
static const String pasengerID = "pasengerID";
|
||||||
static const String phone = "phone";
|
static const String phone = "phone";
|
||||||
|
static const String name = "name";
|
||||||
static const String email = "email";
|
static const String email = "email";
|
||||||
static const String tokens = "tokens";
|
static const String tokens = "tokens";
|
||||||
static const String tokenFCM = "tokenFCM";
|
static const String tokenFCM = "tokenFCM";
|
||||||
|
|||||||
@@ -19,12 +19,11 @@ class AppLink {
|
|||||||
static const String updateCarsLocationByPassenger = "$location/update.php";
|
static const String updateCarsLocationByPassenger = "$location/update.php";
|
||||||
|
|
||||||
//==================Blog=============
|
//==================Blog=============
|
||||||
static const String blog =
|
static const String profile = 'https://ride.mobile-app.store/ride/profile';
|
||||||
'https://portfolio.mobile-app.store/hamzaayed/blogs';
|
static const String getprofile = "$profile/get.php";
|
||||||
static const String getBlog = "$blog/get.php";
|
static const String addprofile = "$profile/add.php";
|
||||||
static const String addBlog = "$blog/add.php";
|
static const String deleteprofile = "$profile/delete.php";
|
||||||
static const String deleteBlog = "$blog/delete.php";
|
static const String updateprofile = "$profile/update.php";
|
||||||
static const String updateBlog = "$blog/update.php";
|
|
||||||
|
|
||||||
//===================Auth============
|
//===================Auth============
|
||||||
static const String auth = 'https://ride.mobile-app.store/auth';
|
static const String auth = 'https://ride.mobile-app.store/auth';
|
||||||
|
|||||||
@@ -51,18 +51,22 @@ class LoginController extends GetxController {
|
|||||||
// print(jsonDecoeded);
|
// print(jsonDecoeded);
|
||||||
if (jsonDecoeded.isNotEmpty) {
|
if (jsonDecoeded.isNotEmpty) {
|
||||||
if (jsonDecoeded['status'] == 'success') {
|
if (jsonDecoeded['status'] == 'success') {
|
||||||
box.write(BoxName.pasengerID, jsonDecoeded['data'][0]['id']);
|
if (jsonDecoeded['data'][0]['verified'] == '1') {
|
||||||
box.write(BoxName.email, jsonDecoeded['data'][0]['email']);
|
box.write(BoxName.pasengerID, jsonDecoeded['data'][0]['id']);
|
||||||
box.write(BoxName.phone, jsonDecoeded['data'][0]['phone']);
|
box.write(BoxName.email, jsonDecoeded['data'][0]['email']);
|
||||||
Get.offAll(() => MapPage());
|
box.write(BoxName.phone, jsonDecoeded['data'][0]['phone']);
|
||||||
|
Get.offAll(() => MapPage());
|
||||||
isloading = false;
|
isloading = false;
|
||||||
update();
|
update();
|
||||||
print(box.read(BoxName.pasengerID).toString());
|
print(box.read(BoxName.pasengerID).toString());
|
||||||
await CRUD().post(link: AppLink.addTokens, payload: {
|
await CRUD().post(link: AppLink.addTokens, payload: {
|
||||||
'token': box.read(BoxName.tokenFCM.toString()),
|
'token': box.read(BoxName.tokenFCM.toString()),
|
||||||
'passengerID': box.read(BoxName.pasengerID).toString()
|
'passengerID': box.read(BoxName.pasengerID).toString()
|
||||||
}).then((value) => print('cccc'));
|
}).then((value) => print('cccc'));
|
||||||
|
} else {
|
||||||
|
Get.snackbar('You must Verify email !.'.tr, '',
|
||||||
|
backgroundColor: Colors.yellow[300]);
|
||||||
|
}
|
||||||
} else if (jsonDecoeded['status'] == 'Failure') {
|
} else if (jsonDecoeded['status'] == 'Failure') {
|
||||||
Get.snackbar(jsonDecoeded['status'], jsonDecoeded['data'],
|
Get.snackbar(jsonDecoeded['status'], jsonDecoeded['data'],
|
||||||
backgroundColor: Colors.redAccent);
|
backgroundColor: Colors.redAccent);
|
||||||
|
|||||||
@@ -21,14 +21,14 @@ class CRUD {
|
|||||||
'Basic ${base64Encode(utf8.encode(AppCredintials.basicAuthCredentials))}',
|
'Basic ${base64Encode(utf8.encode(AppCredintials.basicAuthCredentials))}',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
// print("--------------" + response.body.toString());
|
// print("--------------" + response.request.toString());
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
var jsonData = jsonDecode(response.body);
|
var jsonData = jsonDecode(response.body);
|
||||||
if (jsonData['status'] == 'success') {
|
if (jsonData['status'] == 'success') {
|
||||||
print(jsonData['data']);
|
print(jsonData);
|
||||||
return response.body;
|
return response.body;
|
||||||
}
|
}
|
||||||
return response.body;
|
return jsonData['status'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
import 'dart:math' show sqrt, pi, cos, sin;
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||||
@@ -10,6 +10,8 @@ import 'package:ride/constant/links.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';
|
||||||
|
|
||||||
|
import '../../models/model/locations.dart';
|
||||||
|
|
||||||
class MapController extends GetxController {
|
class MapController extends GetxController {
|
||||||
bool isloading = true;
|
bool isloading = true;
|
||||||
TextEditingController placeController = TextEditingController();
|
TextEditingController placeController = TextEditingController();
|
||||||
@@ -35,6 +37,9 @@ class MapController extends GetxController {
|
|||||||
bool isPickerShown = false;
|
bool isPickerShown = false;
|
||||||
bool isButtomSheetShown = false;
|
bool isButtomSheetShown = false;
|
||||||
double heightButtomSheetShown = 240;
|
double heightButtomSheetShown = 240;
|
||||||
|
late final LatLng southwest;
|
||||||
|
late final LatLng northeast;
|
||||||
|
List<CarLocationModel> carLocations = <CarLocationModel>[];
|
||||||
|
|
||||||
void changeButtomSheetShown() {
|
void changeButtomSheetShown() {
|
||||||
isButtomSheetShown = !isButtomSheetShown;
|
isButtomSheetShown = !isButtomSheetShown;
|
||||||
@@ -169,10 +174,22 @@ class MapController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future getCarsLocationByPassenger() async {
|
Future getCarsLocationByPassenger() async {
|
||||||
|
LatLngBounds bounds =
|
||||||
|
calculateBounds(mylocation.latitude, mylocation.longitude, 10);
|
||||||
|
print(
|
||||||
|
'Southwest: ${bounds.southwest.latitude}, ${bounds.southwest.longitude}');
|
||||||
|
print(
|
||||||
|
'Northeast: ${bounds.northeast.latitude}, ${bounds.northeast.longitude}');
|
||||||
|
|
||||||
var res =
|
var res =
|
||||||
await CRUD().get(link: AppLink.getCarsLocationByPassenger, payload: {});
|
await CRUD().get(link: AppLink.getCarsLocationByPassenger, payload: {
|
||||||
|
'southwestLat': southwest.latitude.toString(),
|
||||||
|
'southwestLon': southwest.longitude.toString(),
|
||||||
|
'northeastLat': northeast.latitude.toString(),
|
||||||
|
'northeastLon': northeast.longitude.toString(),
|
||||||
|
});
|
||||||
var data = jsonDecode(res);
|
var data = jsonDecode(res);
|
||||||
print(data);
|
// print(data);
|
||||||
for (var i = 0; i < data.length; i++) {
|
for (var i = 0; i < data.length; i++) {
|
||||||
carsLocationByPassenger.add(LatLng(
|
carsLocationByPassenger.add(LatLng(
|
||||||
double.parse(data['message'][i]['latitude']),
|
double.parse(data['message'][i]['latitude']),
|
||||||
@@ -182,6 +199,23 @@ class MapController extends GetxController {
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LatLngBounds calculateBounds(
|
||||||
|
double centerLat, double centerLng, double radius) {
|
||||||
|
double radius = 2000; // 10 km in meters
|
||||||
|
|
||||||
|
southwest = LatLng(
|
||||||
|
centerLat - (radius / 111000),
|
||||||
|
centerLng - (radius / (111000 * cos(centerLat))),
|
||||||
|
);
|
||||||
|
|
||||||
|
northeast = LatLng(
|
||||||
|
centerLat + (radius / 111000),
|
||||||
|
centerLng + (radius / (111000 * cos(centerLat))),
|
||||||
|
);
|
||||||
|
|
||||||
|
return LatLngBounds(southwest: southwest, northeast: northeast);
|
||||||
|
}
|
||||||
|
|
||||||
GoogleMapController? mapController;
|
GoogleMapController? mapController;
|
||||||
void onMapCreated(GoogleMapController controller) {
|
void onMapCreated(GoogleMapController controller) {
|
||||||
mapController = controller;
|
mapController = controller;
|
||||||
@@ -395,7 +429,7 @@ class MapController extends GetxController {
|
|||||||
void onInit() async {
|
void onInit() async {
|
||||||
// getPolyLine();
|
// getPolyLine();
|
||||||
// getMap();
|
// getMap();
|
||||||
getLocation();
|
await getLocation();
|
||||||
await getCarsLocationByPassenger();
|
await getCarsLocationByPassenger();
|
||||||
addCustomPicker();
|
addCustomPicker();
|
||||||
addCustomCarIcon();
|
addCustomCarIcon();
|
||||||
|
|||||||
93
lib/controller/profile/profile_controller.dart
Normal file
93
lib/controller/profile/profile_controller.dart
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
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';
|
||||||
|
|
||||||
|
import '../../views/widgets/elevated_btn.dart';
|
||||||
|
|
||||||
|
class ProfileController extends GetxController {
|
||||||
|
bool isloading = false;
|
||||||
|
Map prfoileData = {};
|
||||||
|
TextEditingController txtController = TextEditingController();
|
||||||
|
List genders = ['Male', 'Female', 'Non-binary'];
|
||||||
|
|
||||||
|
String gender = '';
|
||||||
|
|
||||||
|
void setGender(String value) {
|
||||||
|
gender = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
String? selectedDegree;
|
||||||
|
|
||||||
|
void setDegree(String? degree) {
|
||||||
|
selectedDegree = degree;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
updateColumn(Map<String, dynamic> payload) async {
|
||||||
|
isloading = true;
|
||||||
|
update();
|
||||||
|
await CRUD().post(link: AppLink.updateprofile, payload: payload);
|
||||||
|
await getProfile();
|
||||||
|
isloading = false;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
updatField(String columnName) async {
|
||||||
|
Get.defaultDialog(
|
||||||
|
title: '${'Update'.tr} $columnName',
|
||||||
|
content: Column(
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
width: Get.width * .7,
|
||||||
|
child: TextField(
|
||||||
|
controller: txtController,
|
||||||
|
decoration: const InputDecoration(
|
||||||
|
border: OutlineInputBorder(), hintText: 'type here'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
MyElevatedButton(
|
||||||
|
title: 'Update'.tr,
|
||||||
|
onPressed: () {
|
||||||
|
updateColumn({
|
||||||
|
'id': prfoileData['id'].toString(),
|
||||||
|
columnName: txtController.text,
|
||||||
|
});
|
||||||
|
Get.back();
|
||||||
|
txtController.clear();
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
getProfile() async {
|
||||||
|
isloading = true;
|
||||||
|
update();
|
||||||
|
var res = await CRUD().get(link: AppLink.getprofile, payload: {
|
||||||
|
'id': box.read(BoxName.pasengerID).toString(),
|
||||||
|
});
|
||||||
|
|
||||||
|
if (res.toString() == 'failure') {
|
||||||
|
Get.snackbar('failure', 'message');
|
||||||
|
isloading = false;
|
||||||
|
update();
|
||||||
|
} else {
|
||||||
|
var jsonDecoded = jsonDecode(res);
|
||||||
|
prfoileData = jsonDecoded['data'];
|
||||||
|
isloading = false;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onInit() {
|
||||||
|
getProfile();
|
||||||
|
super.onInit();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -39,7 +39,8 @@ void main() async {
|
|||||||
FirebasMessagesController().getToken();
|
FirebasMessagesController().getToken();
|
||||||
await FirebasMessagesController().getTokens();
|
await FirebasMessagesController().getTokens();
|
||||||
FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler);
|
FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler);
|
||||||
|
FirebasMessagesController().getNotificationSettings();
|
||||||
|
FirebasMessagesController().requestPermission();
|
||||||
runApp(const MyApp());
|
runApp(const MyApp());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,8 +64,8 @@ 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()
|
||||||
: box.read(BoxName.email).toString() != null
|
: box.read(BoxName.email) == null
|
||||||
? const MapPage()
|
? LoginPage()
|
||||||
: LoginPage());
|
: const MapPage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
57
lib/models/db_sql.dart
Normal file
57
lib/models/db_sql.dart
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
import 'package:sqflite/sqflite.dart';
|
||||||
|
import 'package:path/path.dart';
|
||||||
|
|
||||||
|
class DbSql {
|
||||||
|
static final DbSql instance = DbSql._();
|
||||||
|
|
||||||
|
static Database? _database;
|
||||||
|
|
||||||
|
DbSql._();
|
||||||
|
|
||||||
|
Future<Database> get database async {
|
||||||
|
if (_database != null) return _database!;
|
||||||
|
_database = await _initDatabase();
|
||||||
|
return _database!;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<Database> _initDatabase() async {
|
||||||
|
String path = join(await getDatabasesPath(), 'my_database.db');
|
||||||
|
return await openDatabase(
|
||||||
|
path,
|
||||||
|
version: 1,
|
||||||
|
onCreate: (db, version) async {
|
||||||
|
await db.execute('''
|
||||||
|
CREATE TABLE IF NOT EXISTS car_locations(
|
||||||
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
|
driver_id INTEGER,
|
||||||
|
latitude REAL,
|
||||||
|
longitude REAL,
|
||||||
|
created_at TEXT,
|
||||||
|
updated_at TEXT
|
||||||
|
)
|
||||||
|
''');
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<List<Map<String, dynamic>>> getAllData(String table) async {
|
||||||
|
Database db = await instance.database;
|
||||||
|
return await db.query(table);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<int> insertData(Map<String, dynamic> map, String table) async {
|
||||||
|
Database db = await instance.database;
|
||||||
|
return await db.insert(table, map);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<int> updateData(Map<String, dynamic> map, String table, int id) async {
|
||||||
|
Database db = await instance.database;
|
||||||
|
|
||||||
|
return await db.update(table, map, where: 'id = ?', whereArgs: [id]);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<int> deleteData(String table, int id) async {
|
||||||
|
Database db = await instance.database;
|
||||||
|
return await db.delete(table, where: 'id = ?', whereArgs: [id]);
|
||||||
|
}
|
||||||
|
}
|
||||||
28
lib/models/model/locations.dart
Normal file
28
lib/models/model/locations.dart
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
class CarLocationModel {
|
||||||
|
int id;
|
||||||
|
int driverId;
|
||||||
|
double latitude;
|
||||||
|
double longitude;
|
||||||
|
DateTime createdAt;
|
||||||
|
DateTime updatedAt;
|
||||||
|
|
||||||
|
CarLocationModel({
|
||||||
|
required this.id,
|
||||||
|
required this.driverId,
|
||||||
|
required this.latitude,
|
||||||
|
required this.longitude,
|
||||||
|
required this.createdAt,
|
||||||
|
required this.updatedAt,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory CarLocationModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
return CarLocationModel(
|
||||||
|
id: json['id'],
|
||||||
|
driverId: json['driver_id'],
|
||||||
|
latitude: json['latitude'],
|
||||||
|
longitude: json['longitude'],
|
||||||
|
createdAt: DateTime.parse(json['created_at']),
|
||||||
|
updatedAt: DateTime.parse(json['updated_at']),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -20,142 +20,156 @@ class LoginPage extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
Get.put(LoginController());
|
Get.put(LoginController());
|
||||||
return MyScafolld(title: 'Login', isleading: false, body: [
|
return GetBuilder<LoginController>(
|
||||||
if (box.read(BoxName.agreeTerms) != 'agreed')
|
builder: (controller) =>
|
||||||
agreedpage()
|
MyScafolld(title: 'Login', isleading: false, body: [
|
||||||
else
|
if (box.read(BoxName.agreeTerms) != 'agreed')
|
||||||
SingleChildScrollView(
|
agreedpage()
|
||||||
child: Column(
|
else
|
||||||
children: [
|
SingleChildScrollView(
|
||||||
Padding(
|
child: Column(
|
||||||
padding: const EdgeInsets.all(25),
|
children: [
|
||||||
child: Container(
|
Padding(
|
||||||
decoration: const BoxDecoration(
|
padding: const EdgeInsets.all(25),
|
||||||
boxShadow: [
|
child: Container(
|
||||||
BoxShadow(
|
decoration: const BoxDecoration(
|
||||||
offset: Offset(3, 3),
|
boxShadow: [
|
||||||
color: AppColor.accentColor,
|
BoxShadow(
|
||||||
blurRadius: 3)
|
offset: Offset(3, 3),
|
||||||
],
|
color: AppColor.accentColor,
|
||||||
color: AppColor.secondaryColor,
|
blurRadius: 3)
|
||||||
),
|
],
|
||||||
child: Form(
|
color: AppColor.secondaryColor,
|
||||||
key: controller.formKey,
|
),
|
||||||
child: Padding(
|
child: Form(
|
||||||
padding: const EdgeInsets.all(16.0),
|
key: controller.formKey,
|
||||||
child: SingleChildScrollView(
|
child: Padding(
|
||||||
child: Column(
|
padding: const EdgeInsets.all(16.0),
|
||||||
children: [
|
child: SingleChildScrollView(
|
||||||
TextFormField(
|
child: Column(
|
||||||
keyboardType: TextInputType.emailAddress,
|
children: [
|
||||||
controller: controller.emailController,
|
TextFormField(
|
||||||
decoration: InputDecoration(
|
keyboardType:
|
||||||
fillColor: AppColor.accentColor,
|
TextInputType.emailAddress,
|
||||||
hoverColor: AppColor.accentColor,
|
controller: controller.emailController,
|
||||||
focusColor: AppColor.accentColor,
|
decoration: InputDecoration(
|
||||||
border: const OutlineInputBorder(
|
fillColor: AppColor.accentColor,
|
||||||
borderRadius: BorderRadius.all(
|
hoverColor: AppColor.accentColor,
|
||||||
Radius.circular(12))),
|
focusColor: AppColor.accentColor,
|
||||||
labelText: 'Email'.tr,
|
border: const OutlineInputBorder(
|
||||||
hintText: 'Enter your email address'.tr,
|
borderRadius: BorderRadius.all(
|
||||||
),
|
Radius.circular(12))),
|
||||||
validator: (value) {
|
labelText: 'Email'.tr,
|
||||||
if (value!.isEmpty ||
|
hintText:
|
||||||
(!value.contains('@') ||
|
'Enter your email address'.tr,
|
||||||
!value.contains('.'))) {
|
),
|
||||||
return 'Please enter Your Email.'.tr;
|
validator: (value) {
|
||||||
}
|
if (value!.isEmpty ||
|
||||||
return null;
|
(!value.contains('@') ||
|
||||||
},
|
!value.contains('.'))) {
|
||||||
),
|
return 'Please enter Your Email.'
|
||||||
const SizedBox(
|
.tr;
|
||||||
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;
|
|
||||||
},
|
|
||||||
),
|
|
||||||
GetBuilder<LoginController>(
|
|
||||||
builder: (controller) => controller.isloading
|
|
||||||
? const MyCircularProgressIndicator()
|
|
||||||
: MyElevatedButton(
|
|
||||||
onPressed: () {
|
|
||||||
if (controller.formKey.currentState!
|
|
||||||
.validate()) {
|
|
||||||
controller.login();
|
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
},
|
},
|
||||||
title: 'Submit',
|
|
||||||
),
|
),
|
||||||
)
|
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;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
GetBuilder<LoginController>(
|
||||||
|
builder: (controller) => controller
|
||||||
|
.isloading
|
||||||
|
? const MyCircularProgressIndicator()
|
||||||
|
: MyElevatedButton(
|
||||||
|
onPressed: () {
|
||||||
|
if (controller
|
||||||
|
.formKey.currentState!
|
||||||
|
.validate()) {
|
||||||
|
controller.login();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
title: 'Submit',
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
Text(
|
||||||
|
'if you dont have account'.tr,
|
||||||
|
style: AppStyle.subtitle,
|
||||||
),
|
),
|
||||||
),
|
AnimatedTextKit(
|
||||||
)),
|
onTap: () => Get.to(() => const RegisterPage()),
|
||||||
Text(
|
animatedTexts: [
|
||||||
'if you dont have account'.tr,
|
TypewriterAnimatedText(
|
||||||
style: AppStyle.subtitle,
|
'Register',
|
||||||
),
|
textStyle: AppStyle.headtitle2,
|
||||||
AnimatedTextKit(
|
speed: const Duration(milliseconds: 200),
|
||||||
onTap: () => Get.to(() => const RegisterPage()),
|
),
|
||||||
animatedTexts: [
|
],
|
||||||
TypewriterAnimatedText(
|
totalRepeatCount: 4,
|
||||||
'Register',
|
pause: const Duration(milliseconds: 200),
|
||||||
textStyle: AppStyle.headtitle2,
|
displayFullTextOnTap: true,
|
||||||
speed: const Duration(milliseconds: 200),
|
stopPauseOnTap: true,
|
||||||
|
)
|
||||||
|
],
|
||||||
),
|
),
|
||||||
],
|
)
|
||||||
totalRepeatCount: 4,
|
]));
|
||||||
pause: const Duration(milliseconds: 200),
|
|
||||||
displayFullTextOnTap: true,
|
|
||||||
stopPauseOnTap: true,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Padding agreedpage() {
|
Padding agreedpage() {
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ class MapPage extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
onTap: (argument) {
|
onTap: (argument) {
|
||||||
controller.hidePlaces();
|
controller.hidePlaces();
|
||||||
|
|
||||||
@@ -99,11 +100,34 @@ class MapPage extends StatelessWidget {
|
|||||||
color: AppColor.primaryColor,
|
color: AppColor.primaryColor,
|
||||||
width: 5,
|
width: 5,
|
||||||
),
|
),
|
||||||
|
// Polyline(
|
||||||
|
// zIndex: 2,
|
||||||
|
// consumeTapEvents: true,
|
||||||
|
// geodesic: true,
|
||||||
|
// endCap: Cap.buttCap,
|
||||||
|
// startCap: Cap.buttCap,
|
||||||
|
// visible: true,
|
||||||
|
// polylineId: PolylineId('g'),
|
||||||
|
// points: [
|
||||||
|
// LatLng(controller.southwest.latitude,
|
||||||
|
// controller.southwest.longitude),
|
||||||
|
// LatLng(controller.northeast.latitude,
|
||||||
|
// controller.northeast.longitude)
|
||||||
|
// ],
|
||||||
|
// color: AppColor.primaryColor,
|
||||||
|
// width: 5,
|
||||||
|
// ),
|
||||||
},
|
},
|
||||||
|
// circles: {
|
||||||
|
// Circle(
|
||||||
|
// circleId: const CircleId('kk'),
|
||||||
|
// center: controller.mylocation,
|
||||||
|
// radius: 2000)
|
||||||
|
// },
|
||||||
mapType: MapType.normal,
|
mapType: MapType.normal,
|
||||||
myLocationButtonEnabled: true,
|
myLocationButtonEnabled: true,
|
||||||
indoorViewEnabled: true,
|
indoorViewEnabled: true,
|
||||||
trafficEnabled: true,
|
trafficEnabled: false,
|
||||||
buildingsEnabled: true,
|
buildingsEnabled: true,
|
||||||
mapToolbarEnabled: true,
|
mapToolbarEnabled: true,
|
||||||
onCameraMove: (position) {
|
onCameraMove: (position) {
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import '../../../constant/colors.dart';
|
|||||||
import '../../../constant/style.dart';
|
import '../../../constant/style.dart';
|
||||||
import '../../../controller/home/map_page_controller.dart';
|
import '../../../controller/home/map_page_controller.dart';
|
||||||
import '../../widgets/elevated_btn.dart';
|
import '../../widgets/elevated_btn.dart';
|
||||||
import 'buttom_sheet_map_show.dart';
|
|
||||||
import 'form_search_places.dart';
|
import 'form_search_places.dart';
|
||||||
|
|
||||||
class PickerAnimtionContainer extends StatelessWidget {
|
class PickerAnimtionContainer extends StatelessWidget {
|
||||||
|
|||||||
@@ -1,19 +1,211 @@
|
|||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
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/style.dart';
|
||||||
|
import 'package:ride/controller/profile/profile_controller.dart';
|
||||||
|
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||||
import 'package:ride/views/widgets/my_scafold.dart';
|
import 'package:ride/views/widgets/my_scafold.dart';
|
||||||
|
import 'package:ride/views/widgets/mycircular.dart';
|
||||||
|
|
||||||
class PassengerProfilePage extends StatelessWidget {
|
class PassengerProfilePage extends StatelessWidget {
|
||||||
const PassengerProfilePage({super.key});
|
const PassengerProfilePage({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return const MyScafolld(
|
Get.put(ProfileController());
|
||||||
|
return MyScafolld(
|
||||||
isleading: true,
|
isleading: true,
|
||||||
title: 'My Profile',
|
title: 'My Profile',
|
||||||
body: [
|
body: [
|
||||||
Center(
|
GetBuilder<ProfileController>(
|
||||||
child: Text('ddd'),
|
builder: (controller) => controller.isloading
|
||||||
),
|
? const MyCircularProgressIndicator()
|
||||||
|
: Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 15),
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'Edit Profile'.tr,
|
||||||
|
style: AppStyle.headtitle2,
|
||||||
|
),
|
||||||
|
ListTile(
|
||||||
|
title: Text(
|
||||||
|
'Name'.tr,
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
leading: const Icon(
|
||||||
|
Icons.person_pin_rounded,
|
||||||
|
size: 35,
|
||||||
|
),
|
||||||
|
trailing: const Icon(Icons.arrow_forward_ios),
|
||||||
|
subtitle: Text(
|
||||||
|
'${controller.prfoileData['first_name']} ${controller.prfoileData['last_name']}'),
|
||||||
|
onTap: () {
|
||||||
|
controller.updatField('first_name');
|
||||||
|
},
|
||||||
|
),
|
||||||
|
ListTile(
|
||||||
|
title: Text(
|
||||||
|
'Gender'.tr,
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
leading: Image.asset(
|
||||||
|
'assets/images/gender.png',
|
||||||
|
width: 35,
|
||||||
|
),
|
||||||
|
trailing: const Icon(Icons.arrow_forward_ios),
|
||||||
|
subtitle: Text(
|
||||||
|
controller.prfoileData['gender'].toString()),
|
||||||
|
onTap: () {
|
||||||
|
Get.defaultDialog(
|
||||||
|
title: 'Update Gender'.tr,
|
||||||
|
content: Column(
|
||||||
|
children: [
|
||||||
|
GenderPicker(),
|
||||||
|
MyElevatedButton(
|
||||||
|
title: 'Update'.tr,
|
||||||
|
onPressed: () {
|
||||||
|
controller.updateColumn({
|
||||||
|
'id': controller.prfoileData['id']
|
||||||
|
.toString(),
|
||||||
|
'gender': controller.gender,
|
||||||
|
});
|
||||||
|
Get.back();
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
));
|
||||||
|
// controller.updatField('gender');
|
||||||
|
},
|
||||||
|
),
|
||||||
|
ListTile(
|
||||||
|
title: Text(
|
||||||
|
'Education'.tr,
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
leading: Image.asset(
|
||||||
|
'assets/images/education.png',
|
||||||
|
width: 35,
|
||||||
|
),
|
||||||
|
trailing: const Icon(Icons.arrow_forward_ios),
|
||||||
|
subtitle: Text(
|
||||||
|
controller.prfoileData['education'].toString()),
|
||||||
|
onTap: () {
|
||||||
|
Get.defaultDialog(
|
||||||
|
title: 'Update Education'.tr,
|
||||||
|
content: Column(
|
||||||
|
children: [
|
||||||
|
EducationDegreePicker(),
|
||||||
|
MyElevatedButton(
|
||||||
|
title: 'Update Education'.tr,
|
||||||
|
onPressed: () {
|
||||||
|
controller.updateColumn({
|
||||||
|
'id': controller.prfoileData['id']
|
||||||
|
.toString(),
|
||||||
|
'education':
|
||||||
|
controller.selectedDegree,
|
||||||
|
});
|
||||||
|
Get.back();
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
));
|
||||||
|
},
|
||||||
|
),
|
||||||
|
ListTile(
|
||||||
|
title: Text(
|
||||||
|
'Employment Type'.tr,
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
leading: Image.asset(
|
||||||
|
'assets/images/employmentType.png',
|
||||||
|
width: 35,
|
||||||
|
),
|
||||||
|
trailing: const Icon(Icons.arrow_forward_ios),
|
||||||
|
subtitle: Text(controller
|
||||||
|
.prfoileData['employmentType']
|
||||||
|
.toString()),
|
||||||
|
onTap: () {
|
||||||
|
controller.updatField('employmentType');
|
||||||
|
},
|
||||||
|
),
|
||||||
|
ListTile(
|
||||||
|
title: Text(
|
||||||
|
'Marital Status'.tr,
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
leading: Image.asset(
|
||||||
|
'assets/images/maritalStatus.png',
|
||||||
|
width: 35,
|
||||||
|
),
|
||||||
|
trailing: const Icon(Icons.arrow_forward_ios),
|
||||||
|
subtitle: Text(controller
|
||||||
|
.prfoileData['maritalStatus']
|
||||||
|
.toString()),
|
||||||
|
onTap: () {
|
||||||
|
controller.updatField('maritalStatus');
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
))
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class GenderPicker extends StatelessWidget {
|
||||||
|
final ProfileController controller = Get.put(ProfileController());
|
||||||
|
|
||||||
|
final List<String> genderOptions = ['Male', 'Female', 'Other'];
|
||||||
|
|
||||||
|
GenderPicker({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return CupertinoPicker(
|
||||||
|
itemExtent: 32.0,
|
||||||
|
onSelectedItemChanged: (int index) {
|
||||||
|
controller.setGender(genderOptions[index]);
|
||||||
|
},
|
||||||
|
children: genderOptions.map((String value) {
|
||||||
|
return Text(value);
|
||||||
|
}).toList(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class EducationDegreePicker extends StatelessWidget {
|
||||||
|
final ProfileController controller = Get.put(ProfileController());
|
||||||
|
|
||||||
|
final List<String> degreeOptions = [
|
||||||
|
'High School Diploma',
|
||||||
|
'Associate Degree',
|
||||||
|
'Bachelor\'s Degree',
|
||||||
|
'Master\'s Degree',
|
||||||
|
'Doctoral Degree',
|
||||||
|
];
|
||||||
|
|
||||||
|
EducationDegreePicker({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return CupertinoPicker(
|
||||||
|
// backgroundColor: AppColor.accentColor,
|
||||||
|
looping: true,
|
||||||
|
squeeze: 2, diameterRatio: 2,
|
||||||
|
itemExtent: 32.0,
|
||||||
|
onSelectedItemChanged: (int index) {
|
||||||
|
controller.setDegree(degreeOptions[index]);
|
||||||
|
},
|
||||||
|
children: degreeOptions.map((String value) {
|
||||||
|
return Text(value);
|
||||||
|
}).toList(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user