diff --git a/android/app/build.gradle b/android/app/build.gradle index 9aa40ce..26481de 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 31 + compileSdkVersion 33 compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 @@ -45,7 +45,7 @@ android { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.ejada.hmg" minSdkVersion 23 - targetSdkVersion 31 + targetSdkVersion 33 versionCode flutterVersionCode.toInteger() versionName flutterVersionName } diff --git a/assets/fonts/Poppins-Medium.ttf b/assets/fonts/Poppins-Medium.ttf new file mode 100644 index 0000000..6bcdcc2 Binary files /dev/null and b/assets/fonts/Poppins-Medium.ttf differ diff --git a/assets/icons/Group 17.png b/assets/icons/Group 17.png new file mode 100644 index 0000000..7bb404a Binary files /dev/null and b/assets/icons/Group 17.png differ diff --git a/assets/icons/ic_face.svg b/assets/icons/ic_face.svg new file mode 100644 index 0000000..5fa9a9c --- /dev/null +++ b/assets/icons/ic_face.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/assets/icons/ic_fingerprint.svg b/assets/icons/ic_fingerprint.svg new file mode 100644 index 0000000..ba45417 --- /dev/null +++ b/assets/icons/ic_fingerprint.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/assets/icons/ic_sms.svg b/assets/icons/ic_sms.svg new file mode 100644 index 0000000..132ab7f --- /dev/null +++ b/assets/icons/ic_sms.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/assets/icons/ic_whatsapp.svg b/assets/icons/ic_whatsapp.svg new file mode 100644 index 0000000..073e581 --- /dev/null +++ b/assets/icons/ic_whatsapp.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/assets/images/bn_logo.svg b/assets/images/bn_logo.svg new file mode 100644 index 0000000..b0c971d --- /dev/null +++ b/assets/images/bn_logo.svg @@ -0,0 +1,560 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/ic_email.svg b/assets/images/ic_email.svg new file mode 100644 index 0000000..81c4573 --- /dev/null +++ b/assets/images/ic_email.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/assets/images/logo.svg b/assets/images/logo.svg new file mode 100644 index 0000000..8552147 --- /dev/null +++ b/assets/images/logo.svg @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/splash_logo.svg b/assets/images/splash_logo.svg new file mode 100644 index 0000000..481226e --- /dev/null +++ b/assets/images/splash_logo.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/lib/api/client/branch_api_client.dart b/lib/api/client/branch_api_client.dart index 6e4629a..f12376b 100644 --- a/lib/api/client/branch_api_client.dart +++ b/lib/api/client/branch_api_client.dart @@ -2,6 +2,7 @@ import 'dart:async'; import 'package:car_provider_app/classes/app_state.dart'; import 'package:car_provider_app/models/m_response.dart'; import 'package:car_provider_app/models/profile/branch.dart'; +import 'package:car_provider_app/models/profile/branch2.dart'; import 'package:car_provider_app/models/profile/categroy.dart'; import 'package:car_provider_app/models/profile/document.dart'; import 'package:car_provider_app/models/profile/services.dart'; @@ -109,4 +110,23 @@ class BranchApiClent { String t = AppState().getUser.data!.accessToken ?? ""; return await ApiClient().postJsonForObject((json) => MResponse.fromJson(json), ApiConsts.ServiceProviderService_Create, map, token: t); } + + Future updateService(List> map) async { + String t = AppState().getUser.data!.accessToken ?? ""; + return await ApiClient().postJsonForObject((json) => MResponse.fromJson(json), ApiConsts.ServiceProviderService_Update, map, token: t); + } + + Future getServiceProviderService() async { + var postParams = {"ProviderBranchID": "9"}; + String t = AppState().getUser.data!.accessToken ?? ""; + print("tokeen " + t); + return await ApiClient().getJsonForObject((json) => MResponse.fromJson(json), ApiConsts.ServiceProviderService_Get, queryParameters: postParams, token: t); + } + + Future getBranchAndServices() async { + var postParams = {"serviceProviderID": AppState().getUser.data?.userInfo?.providerId.toString() ?? ""}; + String t = AppState().getUser.data!.accessToken ?? ""; + print("tokeen " + t); + return await ApiClient().getJsonForObject((json) => Branch2.fromJson(json), ApiConsts.BranchesAndServices, queryParameters: postParams, token: t); + } } diff --git a/lib/classes/app_permissions.dart b/lib/classes/app_permissions.dart new file mode 100644 index 0000000..983b400 --- /dev/null +++ b/lib/classes/app_permissions.dart @@ -0,0 +1,30 @@ +import 'package:permission_handler/permission_handler.dart'; + +class AppPermissions{ + static void location(Function(bool) completion) { + Permission.location.isGranted.then((isGranted){ + if(!isGranted){ + Permission.location.request().then((granted){ + completion(granted == PermissionStatus.granted); + }); + } + completion(isGranted); + }); + + } + + static void checkAll(Function(bool) completion){ + [ + Permission.location + ].request().then((value){ + + bool allGranted = false; + value.values.forEach((element) { + allGranted = allGranted && element == PermissionStatus.granted; + }); + + completion(allGranted); + + }); + } +} \ No newline at end of file diff --git a/lib/classes/app_state.dart b/lib/classes/app_state.dart index a08c753..7c982ca 100644 --- a/lib/classes/app_state.dart +++ b/lib/classes/app_state.dart @@ -1,5 +1,6 @@ import 'package:car_provider_app/models/post_params_model.dart'; import 'package:car_provider_app/models/user/user.dart'; +import 'package:google_maps_flutter/google_maps_flutter.dart'; class AppState { static final AppState _instance = AppState._internal(); @@ -18,14 +19,21 @@ class AppState { set setUser(v) => _user = v; - User get getUser => _user??User(); + User get getUser => _user ?? User(); PostParamsModel? _postParams; PostParamsModel? get postParamsObject => _postParams; Map get postParamsJson => _postParams?.toJson() ?? {}; + void setPostParamsModel(PostParamsModel _postParams) { this._postParams = _postParams; } + + LatLng currentLocation = new LatLng(0, 0); + + set setCurrentLocation(v) => currentLocation = v; + + LatLng get getCurrentLocation => currentLocation; } diff --git a/lib/classes/colors.dart b/lib/classes/colors.dart index 276dc8e..2aaf5d5 100644 --- a/lib/classes/colors.dart +++ b/lib/classes/colors.dart @@ -2,14 +2,17 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class MyColors { - static const Color primaryColor = Colors.white; - static const Color accentColor = Colors.blue; + static const Color darkPrimaryColor = Color(0xffF47F20); + static const Color primaryColor = Color(0xffF69521); + static const Color accentColor = Colors.blue; + static const Color lightTextColor = Color(0xff969696); + static const Color textColor = Color(0xff777777); + static const Color textFieldColor = Color(0xffF3F5F7); static const Color darkIconColor = Color(0xff28323A); static const Color darkTextColor = Color(0xff2B353E); static const Color normalTextColor = Color(0xff5A5A5A); - static const Color lightTextColor = Color(0xffBFBFBF); static const Color gradiantStartColor = Color(0xff33c0a5); - static const Color gradiantEndColor = Color(0xff259db7 ); + static const Color gradiantEndColor = Color(0xff259db7); static const Color textMixColor = Color(0xff2BB8A6); static const Color backgroundColor = Color(0xffF8F8F8); static const Color grey57Color = Color(0xff575757); @@ -28,4 +31,33 @@ class MyColors { static const Color white = Color(0xffffffff); static const Color green = Color(0xffffffff); static const Color borderColor = Color(0xffE8E8E8); + + static Decoration gradient = BoxDecoration( + gradient: new LinearGradient(colors: [ + darkPrimaryColor, + primaryColor, + ]), + boxShadow: [ + new BoxShadow( + color: primaryColor.withOpacity(0.5), + blurRadius: 20.0, + spreadRadius: 1.0, + ) + ], + ); + + static Decoration gradientButton = BoxDecoration( + gradient: new LinearGradient(colors: [ + darkPrimaryColor, + primaryColor, + ]), + borderRadius: BorderRadius.circular(6), + boxShadow: [ + new BoxShadow( + color: primaryColor.withOpacity(0.2), + blurRadius: 4.0, + spreadRadius: 0.5, + ) + ], + ); } diff --git a/lib/classes/consts.dart b/lib/classes/consts.dart index c4c3832..d897763 100644 --- a/lib/classes/consts.dart +++ b/lib/classes/consts.dart @@ -1,7 +1,7 @@ class ApiConsts { - // static String baseUrl = "http://10.200.204.20:2801/"; // Local server - static String baseUrl = "https://mdlaboratories.com"; // production server - static String baseUrlServices = baseUrl + "/mc/"; // production server + static String baseUrl = "https://ms.hmg.com/"; // Local server + // static String baseUrl = "https://mdlaboratories.com"; // production server + static String baseUrlServices = baseUrl + ""; // production server static String BasicOTP = baseUrlServices + "api/Register/BasicOTP"; static String BasicVerify = baseUrlServices + "api/Register/BasicVerify"; static String BasicComplete = baseUrlServices + "api/Register/BasicComplete"; @@ -44,6 +44,11 @@ class ApiConsts { static String ServiceCategory_Get = baseUrlServices + "api/Master/ServiceCategory_Get"; static String Services_Get = baseUrlServices + "api/ServiceProviders/Services_Get"; static String ServiceProviderService_Create = baseUrlServices + "api/ServiceProviders/ServiceProviderService_Create"; + static String ServiceProviderService_Update = baseUrlServices + "api/ServiceProviders/ServiceProviderService_Update"; + + static String ServiceProviderService_Get= baseUrlServices + "api/ServiceProviders/ServiceProviderService_Get"; + static String BranchesAndServices= baseUrlServices + "api/ServiceProviders/ServiceProviderDetail_Get"; + } class GlobalConsts { diff --git a/lib/classes/utils.dart b/lib/classes/utils.dart index 56e5802..1f1156e 100644 --- a/lib/classes/utils.dart +++ b/lib/classes/utils.dart @@ -68,4 +68,8 @@ class Utils { showToast(errorMessage); } } + + static Future delay(int seconds) async { + return await Future.delayed(Duration(seconds: seconds)); + } } diff --git a/lib/config/routes.dart b/lib/config/routes.dart index 296f00c..443e712 100644 --- a/lib/config/routes.dart +++ b/lib/config/routes.dart @@ -1,10 +1,10 @@ import 'package:car_provider_app/models/profile/branch.dart'; import 'package:car_provider_app/models/user/register_user.dart'; import 'package:car_provider_app/pages/dashboard/dashboard_page.dart'; -import 'package:car_provider_app/pages/settings/branch_detail_page.dart'; +import 'package:car_provider_app/pages/settings/branch/branch_detail_page.dart'; +import 'package:car_provider_app/pages/settings/branch/branch_list_page.dart'; import 'package:car_provider_app/pages/settings/create_services_page.dart'; import 'package:car_provider_app/pages/settings/dealership_page.dart'; -import 'package:car_provider_app/pages/settings/define_branch_page.dart'; import 'package:car_provider_app/pages/settings/define_license_page.dart'; import 'package:car_provider_app/pages/user/change_email_page.dart'; import 'package:car_provider_app/pages/user/change_mobile_page.dart'; @@ -23,13 +23,18 @@ import 'package:car_provider_app/pages/user/profile/profile_2_page.dart'; import 'package:car_provider_app/pages/user/profile/profile_3_page.dart'; import 'package:car_provider_app/pages/user/register_page.dart'; import 'package:car_provider_app/pages/user/register_selection_page.dart'; +import 'package:car_provider_app/pages/user/selection_page.dart'; import 'package:car_provider_app/pages/user/splash_page.dart'; import 'package:car_provider_app/pages/user/vertify_password_page.dart'; import 'package:flutter/material.dart'; +import '../models/profile/branch2.dart'; +import '../pages/settings/branch/define_branch_page.dart'; + class AppRoutes { //User static final String splash = "/splash"; + static final String selectionPage = "/selectionPage"; static final String registerSelection = "/registerSelection"; static final String loginVerifyAccount = "/loginVerifyAccount"; static final String register = "/register"; @@ -54,7 +59,8 @@ class AppRoutes { //settings static final String dealershipSetting = "/dealershipSetting"; - static final String branch = "/branch"; + static final String branchList = "/branchList"; + static final String branchDetail = "/branchDetail"; static final String defineBranch = "/defineBranch"; static final String createServices = "/createServices"; @@ -63,6 +69,7 @@ class AppRoutes { static final Map routes = { //User splash: (context) => SplashPage(), + selectionPage: (context) => SelectionPage(), registerSelection: (context) => RegisterSelectionPage(), loginVerifyAccount: (context) => LoginVerifyAccountPage(), register: (context) => RegisterPage(), @@ -87,8 +94,9 @@ class AppRoutes { //setting dealershipSetting: (context) => DealershipPage(), - branch: (context) => BranchDetailPage(), - defineBranch: (context) => DefineBranchPage(ModalRoute.of(context)!.settings.arguments as BranchData), - createServices: (context) => CreateServicesPage(), + branchList: (context) => BranchListPage(), + branchDetail: (context) => BranchDetailPage(ModalRoute.of(context)!.settings.arguments as ServiceProviderBranch), + defineBranch: (context) => DefineBranchPage((ModalRoute.of(context)!.settings.arguments) == null ? null : (ModalRoute.of(context)!.settings.arguments as ServiceProviderBranch)), + createServices: (context) => CreateServicesPage((ModalRoute.of(context)!.settings.arguments) == null ? null : (ModalRoute.of(context)!.settings.arguments as ServiceProviderBranch)), }; } diff --git a/lib/extensions/string_extensions.dart b/lib/extensions/string_extensions.dart index 42a7af4..64e3c73 100644 --- a/lib/extensions/string_extensions.dart +++ b/lib/extensions/string_extensions.dart @@ -5,10 +5,10 @@ import 'package:car_provider_app/classes/colors.dart'; extension EmailValidator on String { Widget get toWidget => Text(this); - Widget toText({Color? color, bool isBold = false,double? fontSize}) => Text( - this, - style: TextStyle(fontSize: fontSize??10, fontWeight: isBold ? FontWeight.bold : FontWeight.w600, color: color ?? MyColors.darkTextColor, letterSpacing: -0.4), - ); + Widget toText({Color? color, bool isBold = false, double? fontSize}) => Text( + this, + style: TextStyle(fontSize: fontSize ?? 10, fontWeight: isBold ? FontWeight.bold : FontWeight.w600, color: color ?? MyColors.darkTextColor, letterSpacing: -0.4), + ); Widget toText10({Color? color, bool isBold = false}) => Text( this, @@ -42,8 +42,9 @@ extension EmailValidator on String { style: TextStyle(fontSize: 13, fontWeight: FontWeight.w600, color: color ?? MyColors.darkTextColor, letterSpacing: -0.52, decoration: isUnderLine ? TextDecoration.underline : null), ); - Widget toText14({Color? color, bool isBold = false}) => Text( + Widget toText14({Color? color, bool isBold = false, TextAlign? textAlign,}) => Text( this, + textAlign: textAlign, style: TextStyle(color: color ?? MyColors.darkTextColor, fontSize: 14, letterSpacing: -0.48, fontWeight: isBold ? FontWeight.bold : FontWeight.w600), ); @@ -57,6 +58,11 @@ extension EmailValidator on String { style: TextStyle(color: color ?? MyColors.darkTextColor, fontSize: 17, letterSpacing: -0.68, fontWeight: isBold ? FontWeight.bold : FontWeight.w600), ); + Widget toText20({Color? color, bool isBold = false}) => Text( + this, + style: TextStyle(height: 23 / 24, color: color ?? MyColors.darkTextColor, fontSize: 20, letterSpacing: -1.44, fontWeight: isBold ? FontWeight.bold : FontWeight.w600), + ); + Widget toText22({Color? color, bool isBold = false}) => Text( this, style: TextStyle(height: 1, color: color ?? MyColors.darkTextColor, fontSize: 22, letterSpacing: -1.44, fontWeight: isBold ? FontWeight.bold : FontWeight.w600), diff --git a/lib/extensions/widget_extensions.dart b/lib/extensions/widget_extensions.dart index 787894d..e9949d2 100644 --- a/lib/extensions/widget_extensions.dart +++ b/lib/extensions/widget_extensions.dart @@ -8,4 +8,19 @@ extension WidgetExtensions on Widget { Widget paddingOnly({double left = 0.0, double right = 0.0, double top = 0.0, double bottom = 0.0}) => Padding(padding: EdgeInsets.only(left: left, right: right, top: top, bottom: bottom), child: this); + + Widget toContainer({double borderRadius = 8,double padding=10}) => Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(borderRadius), + boxShadow: [ + BoxShadow( + color: const Color(0xff000000).withOpacity(.1), + blurRadius: 26, + offset: const Offset(0, -3), + ), + ], + ), + padding: EdgeInsets.all(padding), + child: this); } diff --git a/lib/models/profile/branch2.dart b/lib/models/profile/branch2.dart new file mode 100644 index 0000000..a2af03d --- /dev/null +++ b/lib/models/profile/branch2.dart @@ -0,0 +1,182 @@ +// To parse this JSON data, do +// +// final branch2 = branch2FromJson(jsonString); + +import 'dart:convert'; + +import 'categroy.dart'; + +Branch2 branch2FromJson(String str) => Branch2.fromJson(json.decode(str)); + +String branch2ToJson(Branch2 data) => json.encode(data.toJson()); + +class Branch2 { + Branch2({ + this.messageStatus, + this.totalItemsCount, + this.data, + this.message, + }); + + final int? messageStatus; + final int? totalItemsCount; + final Data? data; + final String? message; + + factory Branch2.fromJson(Map json) => Branch2( + messageStatus: json["messageStatus"] == null ? null : json["messageStatus"], + totalItemsCount: json["totalItemsCount"] == null ? null : json["totalItemsCount"], + data: json["data"] == null ? null : Data.fromJson(json["data"]), + message: json["message"] == null ? null : json["message"], + ); + + Map toJson() => { + "messageStatus": messageStatus == null ? null : messageStatus, + "totalItemsCount": totalItemsCount == null ? null : totalItemsCount, + "data": data == null ? null : data!.toJson(), + "message": message == null ? null : message, + }; +} + +class Data { + Data({ + this.id, + this.companyName, + this.countryName, + this.companyDescription, + this.allDocStatus, + this.isValidSubscription, + this.userId, + this.serviceProviderBranch, + this.countryID, + }); + + final int? id; + final String? companyName; + final String? countryName; + int? countryID; + final String? companyDescription; + final int? allDocStatus; + final bool? isValidSubscription; + final String? userId; + final List? serviceProviderBranch; + + factory Data.fromJson(Map json) => Data( + id: json["id"] == null ? null : json["id"], + companyName: json["companyName"] == null ? null : json["companyName"], + countryName: json["countryName"] == null ? null : json["countryName"], + countryID: json["countryID"] == null ? null : json["countryID"], + companyDescription: json["companyDescription"] == null ? null : json["companyDescription"], + allDocStatus: json["allDocStatus"] == null ? null : json["allDocStatus"], + isValidSubscription: json["isValidSubscription"] == null ? null : json["isValidSubscription"], + userId: json["userID"] == null ? null : json["userID"], + serviceProviderBranch: json["serviceProviderBranch"] == null ? null : List.from(json["serviceProviderBranch"].map((x) => ServiceProviderBranch.fromJson(x))), + ); + + Map toJson() => { + "id": id == null ? null : id, + "companyName": companyName == null ? null : companyName, + "companyDescription": companyDescription == null ? null : companyDescription, + "allDocStatus": allDocStatus == null ? null : allDocStatus, + "isValidSubscription": isValidSubscription == null ? null : isValidSubscription, + "userID": userId == null ? null : userId, + "serviceProviderBranch": serviceProviderBranch == null ? null : List.from(serviceProviderBranch!.map((x) => x.toJson())), + }; +} + +class ServiceProviderBranch { + ServiceProviderBranch({ + this.id, + this.cityId, + this.cityName, + this.branchName, + this.branchDescription, + this.address, + this.latitude, + this.longitude, + this.status, + this.serviceProviderServices, + this.countryID, + this.countryName, + this.categories, + }); + + final int? id; + int? countryID; + final String? countryName; + final int? cityId; + final dynamic? cityName; + final String? branchName; + final String? branchDescription; + final String? address; + final String? latitude; + final String? longitude; + final int? status; + final List? serviceProviderServices; + List? categories; + + factory ServiceProviderBranch.fromJson(Map json) => ServiceProviderBranch( + id: json["id"] == null ? null : json["id"], + countryID: 0, + countryName: "", + cityId: json["cityID"] == null ? null : json["cityID"], + cityName: json["cityName"], + branchName: json["branchName"] == null ? null : json["branchName"], + branchDescription: json["branchDescription"] == null ? null : json["branchDescription"], + address: json["address"] == null ? null : json["address"], + latitude: json["latitude"] == null ? null : json["latitude"], + longitude: json["longitude"] == null ? null : json["longitude"], + status: json["status"] == null ? null : json["status"], + serviceProviderServices: json["serviceProviderServices"] == null ? null : List.from(json["serviceProviderServices"].map((x) => ServiceProviderService.fromJson(x))), + categories: [], + ); + + Map toJson() => { + "id": id == null ? null : id, + "cityID": cityId == null ? null : cityId, + "cityName": cityName, + "branchName": branchName == null ? null : branchName, + "branchDescription": branchDescription == null ? null : branchDescription, + "address": address == null ? null : address, + "latitude": latitude == null ? null : latitude, + "longitude": longitude == null ? null : longitude, + "status": status == null ? null : status, + "serviceProviderServices": serviceProviderServices == null ? null : List.from(serviceProviderServices!.map((x) => x.toJson())), + }; +} + +class ServiceProviderService { + ServiceProviderService({ + this.serviceId, + this.serviceName, + this.serviceNameN, + this.categoryId, + this.categoryName, + this.serviceStatus, + }); + + final int? serviceId; + final String? serviceName; + final String? serviceNameN; + final int? categoryId; + final String? categoryName; + final int? serviceStatus; + + factory ServiceProviderService.fromJson(Map json) => ServiceProviderService( + serviceId: json["serviceID"] == null ? null : json["serviceID"], + serviceName: json["serviceName"] == null ? null : json["serviceName"], + serviceNameN: json["serviceNameN"] == null ? null : json["serviceNameN"], + categoryId: json["categoryID"] == null ? null : json["categoryID"], + categoryName: json["categoryName"] == null ? null : json["categoryName"], + serviceStatus: json["serviceStatus"] == null ? null : json["serviceStatus"], + ); + + Map toJson() => { + "serviceID": serviceId == null ? null : serviceId, + "serviceName": serviceName == null ? null : serviceName, + "serviceNameN": serviceNameN == null ? null : serviceNameN, + "categoryID": categoryId == null ? null : categoryId, + "categoryName": categoryName == null ? null : categoryName, + "serviceStatus": serviceStatus == null ? null : serviceStatus, + }; +} diff --git a/lib/models/profile/categroy.dart b/lib/models/profile/categroy.dart index 6f566f1..a8395d3 100644 --- a/lib/models/profile/categroy.dart +++ b/lib/models/profile/categroy.dart @@ -4,6 +4,10 @@ import 'dart:convert'; +import 'package:equatable/equatable.dart'; + +import 'branch2.dart'; + Category categoryFromJson(String str) => Category.fromJson(json.decode(str)); String categoryToJson(Category data) => json.encode(data.toJson()); @@ -22,27 +26,29 @@ class Category { String? message; factory Category.fromJson(Map json) => Category( - totalItemsCount: json["totalItemsCount"] == null ? null : json["totalItemsCount"], - data: json["data"] == null ? null : List.from(json["data"].map((x) => CategoryData.fromJson(x))), - messageStatus: json["messageStatus"] == null ? null : json["messageStatus"], - message: json["message"] == null ? null : json["message"], - ); + totalItemsCount: json["totalItemsCount"] == null ? null : json["totalItemsCount"], + data: json["data"] == null ? null : List.from(json["data"].map((x) => CategoryData.fromJson(x))), + messageStatus: json["messageStatus"] == null ? null : json["messageStatus"], + message: json["message"] == null ? null : json["message"], + ); Map toJson() => { - "totalItemsCount": totalItemsCount == null ? null : totalItemsCount, - "data": data == null ? null : List.from(data!.map((x) => x.toJson())), - "messageStatus": messageStatus == null ? null : messageStatus, - "message": message == null ? null : message, - }; + "totalItemsCount": totalItemsCount == null ? null : totalItemsCount, + "data": data == null ? null : List.from(data!.map((x) => x.toJson())), + "messageStatus": messageStatus == null ? null : messageStatus, + "message": message == null ? null : message, + }; } -class CategoryData { +// ignore: must_be_immutable +class CategoryData extends Equatable { CategoryData({ this.id, this.categoryName, this.categoryNameN, this.serviceCategoryIconUrl, this.serviceCategoryImageUrl, + this.services, }); int? id; @@ -50,20 +56,25 @@ class CategoryData { String? categoryNameN; dynamic? serviceCategoryIconUrl; dynamic? serviceCategoryImageUrl; + List? services; factory CategoryData.fromJson(Map json) => CategoryData( - id: json["id"] == null ? null : json["id"], - categoryName: json["categoryName"] == null ? null : json["categoryName"], - categoryNameN: json["categoryNameN"] == null ? null : json["categoryNameN"], - serviceCategoryIconUrl: json["serviceCategoryIconUrl"], - serviceCategoryImageUrl: json["serviceCategoryImageUrl"], - ); + id: json["id"] == null ? null : json["id"], + categoryName: json["categoryName"] == null ? null : json["categoryName"], + categoryNameN: json["categoryNameN"] == null ? null : json["categoryNameN"], + serviceCategoryIconUrl: json["serviceCategoryIconUrl"], + serviceCategoryImageUrl: json["serviceCategoryImageUrl"], + services: [], + ); Map toJson() => { - "id": id == null ? null : id, - "categoryName": categoryName == null ? null : categoryName, - "categoryNameN": categoryNameN == null ? null : categoryNameN, - "serviceCategoryIconUrl": serviceCategoryIconUrl, - "serviceCategoryImageUrl": serviceCategoryImageUrl, - }; + "id": id == null ? null : id, + "categoryName": categoryName == null ? null : categoryName, + "categoryNameN": categoryNameN == null ? null : categoryNameN, + "serviceCategoryIconUrl": serviceCategoryIconUrl, + "serviceCategoryImageUrl": serviceCategoryImageUrl, + }; + + @override + List get props => [id ?? 0]; } diff --git a/lib/pages/dashboard/dashboard_page.dart b/lib/pages/dashboard/dashboard_page.dart index aefce54..db80564 100644 --- a/lib/pages/dashboard/dashboard_page.dart +++ b/lib/pages/dashboard/dashboard_page.dart @@ -2,6 +2,7 @@ import 'package:car_provider_app/api/api_client.dart'; import 'package:car_provider_app/api/client/user_api_client.dart'; import 'package:car_provider_app/api/shared_prefrence.dart'; import 'package:car_provider_app/classes/app_state.dart'; +import 'package:car_provider_app/classes/colors.dart'; import 'package:car_provider_app/classes/consts.dart'; import 'package:car_provider_app/classes/utils.dart'; import 'package:car_provider_app/config/routes.dart'; @@ -11,19 +12,21 @@ import 'package:car_provider_app/theme/colors.dart'; import 'package:car_provider_app/utils/navigator.dart'; import 'package:car_provider_app/utils/utils.dart'; import 'package:car_provider_app/widgets/app_bar.dart'; -import 'package:car_provider_app/widgets/show_fill_button.dart'; +import 'package:car_provider_app/widgets/button/show_fill_button.dart'; import 'package:car_provider_app/extensions/int_extensions.dart'; import 'package:car_provider_app/extensions/string_extensions.dart'; import 'package:car_provider_app/extensions/widget_extensions.dart'; import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:http/http.dart'; import 'package:image_picker/image_picker.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'dart:io'; import '../../generated/locale_keys.g.dart'; +import '../../utils/location/Location.dart'; class DashboardPage extends StatefulWidget { @override @@ -48,11 +51,17 @@ class _DashboardPageState extends State { void initState() { // TODO: implement initState super.initState(); - fetchUsername(); + fetchUsernameAndLocation(); } - fetchUsername() async { + fetchUsernameAndLocation() async { userName = await SharedPrefManager.getPhoneOrEmail(); + Location.getCurrentLocation( + (LatLng? latlng) { + AppState().currentLocation = latlng ?? new LatLng(0, 0); + }, + ); + setState(() {}); } @@ -60,7 +69,9 @@ class _DashboardPageState extends State { Widget build(BuildContext context) { return Scaffold( appBar: appBar( + context, title: LocaleKeys.logo_brand.tr(), + isRemoveBackButton: true, ), drawer: showDrawer(context), body: Container( @@ -82,7 +93,7 @@ class _DashboardPageState extends State { Container( width: double.infinity, height: 200, - color: accentColor.withOpacity(0.3), + color: MyColors.darkPrimaryColor.withOpacity(0.01), child: Image.network(ApiConsts.baseUrlServices + AppState().getUser.data!.userInfo!.userImageUrl.toString()), ), Positioned( @@ -103,7 +114,7 @@ class _DashboardPageState extends State { ), child: Icon( Icons.edit, - color: Colors.blue, + color: MyColors.darkPrimaryColor, ).onPress(() { _openImagePicker(); // _handleURLButtonPress(context, ImageSourceType.camera); @@ -119,7 +130,7 @@ class _DashboardPageState extends State { ), child: Icon( Icons.delete, - color: Colors.blue, + color: Colors.red, ).onPress(() async { Utils.showLoading(context); ImageResponse response = await UserApiClent().UpdateUserImage(""); @@ -150,7 +161,7 @@ class _DashboardPageState extends State { // ), Container( width: double.infinity, - color: accentColor.withOpacity(0.1), + color: MyColors.darkPrimaryColor.withOpacity(0.1), padding: EdgeInsets.all(20), child: Row( children: [ @@ -159,13 +170,16 @@ class _DashboardPageState extends State { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - userName.toText24(), - AppState().getUser.data!.userInfo!.roleName!.toText12(), + userName.toText20(isBold: true), + AppState().getUser.data!.userInfo!.roleName!.toText10(), ], ), ), ShowFillButton( title: LocaleKeys.edit.tr(), + fontSize: 12, + maxHeight: 35, + maxWidth: 70, onPressed: () { navigateWithName(context, AppRoutes.editAccoundPage); }, @@ -174,22 +188,22 @@ class _DashboardPageState extends State { ), ), ListTile( - leading: SvgPicture.asset("assets/images/ic_notification.svg"), + leading: SvgPicture.asset("assets/images/ic_notification.svg", color: MyColors.darkPrimaryColor), title: LocaleKeys.notifications.tr().toText12(), ), ListTile( - leading: SvgPicture.asset("assets/images/ic_settings.svg"), + leading: SvgPicture.asset("assets/images/ic_settings.svg", color: MyColors.darkPrimaryColor), title: LocaleKeys.general.tr().toText12(), ), ListTile( - leading: SvgPicture.asset("assets/images/ic_notes.svg"), + leading: SvgPicture.asset("assets/images/ic_notes.svg", color: MyColors.darkPrimaryColor), title: LocaleKeys.defineLicences.tr().toText12(), onTap: () { navigateWithName(context, AppRoutes.defineLicense); }, ), ListTile( - leading: SvgPicture.asset("assets/images/ic_car.svg"), + leading: SvgPicture.asset("assets/images/ic_car.svg", color: MyColors.darkPrimaryColor), title: LocaleKeys.dealershipSettings.tr().toText12(), onTap: () { navigateWithName(context, AppRoutes.dealershipSetting); @@ -200,7 +214,7 @@ class _DashboardPageState extends State { "assets/images/ic_world.png", width: 20, height: 20, - color: Colors.blue, + color: MyColors.darkPrimaryColor, ), title: LocaleKeys.english.tr().toText12(), onTap: () { @@ -232,7 +246,7 @@ class _DashboardPageState extends State { // }, // ), ListTile( - leading: SvgPicture.asset("assets/images/ic_logout.svg"), + leading: SvgPicture.asset("assets/images/ic_logout.svg", color: MyColors.darkPrimaryColor), title: LocaleKeys.signOut.tr().toText12(), onTap: () async { final pref = await SharedPreferences.getInstance(); diff --git a/lib/pages/location/pick_location_page.dart b/lib/pages/location/pick_location_page.dart index 34bad09..d7c4767 100644 --- a/lib/pages/location/pick_location_page.dart +++ b/lib/pages/location/pick_location_page.dart @@ -2,7 +2,8 @@ import 'dart:async'; import 'package:car_provider_app/generated/locale_keys.g.dart'; import 'package:car_provider_app/utils/navigator.dart'; -import 'package:car_provider_app/widgets/show_fill_button.dart'; +import 'package:car_provider_app/widgets/app_bar.dart'; +import 'package:car_provider_app/widgets/button/show_fill_button.dart'; import 'package:easy_localization/src/public_ext.dart'; import 'package:flutter/material.dart'; import 'package:geocoding/geocoding.dart'; @@ -55,41 +56,45 @@ class _PickLocationPageState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - title: Text(LocaleKeys.pickLocation.tr()), - ), + appBar: appBar(context, title: LocaleKeys.pickLocation.tr()), body: Container( - child: Stack( + child: Column( children: [ - if (appMap != null) appMap, - ValueListenableBuilder( - builder: (BuildContext context, String value, Widget? child) { - // This builder will only get called when the _counter - // is updated. - return value.isNotEmpty - ? Container( - width: double.infinity, - margin: EdgeInsets.all(12), - child: Card( - child: Padding( - padding: const EdgeInsets.all(12.0), - child: Text(value ?? ""), - )), - ) - : Container(); - }, - valueListenable: _counter, - ), - Align( - alignment: Alignment.center, - child: Icon( - Icons.place, - color: Colors.red, - size: 50, + Expanded( + child: Stack( + children: [ + if (appMap != null) appMap, + ValueListenableBuilder( + builder: (BuildContext context, String value, Widget? child) { + // This builder will only get called when the _counter + // is updated. + return value.isNotEmpty + ? Container( + width: double.infinity, + margin: EdgeInsets.all(12), + child: Card( + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Text(value ?? ""), + )), + ) + : Container(); + }, + valueListenable: _counter, + ), + Align( + alignment: Alignment.center, + child: Icon( + Icons.place, + color: Colors.red, + size: 50, + ), + ), + ], ), ), - Align( - alignment: Alignment.bottomCenter, + Container( + width: double.infinity, child: Padding( padding: const EdgeInsets.all(12.0), child: ShowFillButton( @@ -111,8 +116,8 @@ class _PickLocationPageState extends State { latitude = _position.target.latitude; longitude = _position.target.longitude; List placemarks = await placemarkFromCoordinates(latitude, longitude); - _counter.value='${placemarks.first.street}, ${placemarks.first.subLocality}, ${placemarks.first.locality}, ${placemarks.first.postalCode}, ${placemarks.first.country}'; - print("Address121: "+_counter.value); + _counter.value = '${placemarks.first.street}, ${placemarks.first.subLocality}, ${placemarks.first.locality}, ${placemarks.first.postalCode}, ${placemarks.first.country}'; + print("Address121: " + _counter.value); // _counter.value = (placemarks.first.name) ?? "" + " " + (placemarks.first.street ?? "") + " " + (placemarks.first.country ?? ""); } diff --git a/lib/pages/settings/branch/branch_detail_page.dart b/lib/pages/settings/branch/branch_detail_page.dart new file mode 100644 index 0000000..17521b3 --- /dev/null +++ b/lib/pages/settings/branch/branch_detail_page.dart @@ -0,0 +1,188 @@ +import 'package:car_provider_app/classes/colors.dart'; +import 'package:car_provider_app/config/constants.dart'; +import 'package:car_provider_app/extensions/int_extensions.dart'; +import 'package:car_provider_app/extensions/string_extensions.dart'; +import 'package:car_provider_app/widgets/app_bar.dart'; +import 'package:car_provider_app/widgets/button/show_fill_button.dart'; +import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/svg.dart'; +import 'package:sizer/sizer.dart'; + +import '../../../config/routes.dart'; +import '../../../generated/locale_keys.g.dart'; +import '../../../models/profile/branch.dart'; +import '../../../models/profile/branch2.dart'; +import '../../../models/profile/categroy.dart'; +import '../../../utils/navigator.dart'; + +class BranchDetailPage extends StatefulWidget { + ServiceProviderBranch branchData; + + BranchDetailPage(this.branchData); + + @override + State createState() => _BranchDetailPageState(); +} + +class _BranchDetailPageState extends State { + List categories = []; + + @override + void initState() { + // TODO: implement initState + super.initState(); + widget.branchData.serviceProviderServices!.forEach((element) { + + categories.add( + new CategoryData( + id: element.categoryId, + categoryName: element.categoryName, + categoryNameN: element.categoryName, + ), + ); + }); + categories = categories.toSet().toList(); + print(categories); + categories.forEach((pelement) { + widget.branchData.serviceProviderServices!.forEach((element) { + if (pelement.id == element.categoryId) { + if (pelement.services == null) pelement.services = []; + pelement.services!.add(element); + } + }); + }); + widget.branchData.categories = categories; + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: appBar( + context, + title: LocaleKeys.branchName.tr(), + ), + body: Container( + width: double.infinity, + height: double.infinity, + child: Column( + children: [ + Expanded( + child: SingleChildScrollView( + padding: EdgeInsets.all(20), + child: Column( + children: [ + Row( + children: [ + Expanded( + child: titleWidget(icons + "ic_branchs.svg", "Branch Info"), + ), + IconButton( + onPressed: () { + navigateWithName(context, AppRoutes.defineBranch, arguments: widget.branchData); + }, + icon: Icon( + Icons.edit, + ), + ) + ], + ), + 8.height, + Column( + children: [ + showData("Country:", widget.branchData.countryID.toString()), + showData("City", widget.branchData.cityId.toString()), + showData("Branch Name:", widget.branchData.branchName.toString()), + showData("Branch Description:", widget.branchData.branchDescription.toString()), + showData("Address:", widget.branchData.address.toString()), + ], + ), + Container( + width: double.infinity, + height: 1, + color: Colors.grey, + margin: EdgeInsets.symmetric(vertical: 12), + ), + ListView.builder( + itemBuilder: (context, pIndex) { + return Container( + width: double.infinity, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + categories[pIndex].categoryName.toString().toText16(isBold: true), + ListView.builder( + itemBuilder: (context, index) { + return Container( + child: ("- " + categories[pIndex].services![index].serviceName.toString()).toText14(), + ); + }, + itemCount: categories[pIndex].services?.length, + physics: NeverScrollableScrollPhysics(), + shrinkWrap: true, + ) + ], + ), + ); + }, + itemCount: categories.length, + physics: NeverScrollableScrollPhysics(), + shrinkWrap: true, + ), + ], + ), + ), + ), + Container( + width: double.infinity, + height: 1, + color: Colors.grey, + ), + Padding( + padding: const EdgeInsets.all(12.0), + child: ShowFillButton( + title: "Edit Services", + maxWidth: double.infinity, + onPressed: () { + navigateWithName( + context, + AppRoutes.createServices, + arguments: widget.branchData, + ); + }, + ), + ), + ], + ), + ), + ); + } + + Widget titleWidget(String icon, String title) { + return Row( + children: [ + SvgPicture.asset( + icon, + width: 18, + height: 18, + color: MyColors.darkPrimaryColor, + ), + 12.width, + title.toText16(color: Colors.black, isBold: true), + ], + ); + } + + Widget showData(String title, String value) { + return Row( + children: [ + title.toText10(color: Colors.black, isBold: true), + 8.width, + value.toText12( + color: MyColors.textColor, + ) + ], + ); + } +} diff --git a/lib/pages/settings/branch/branch_list_page.dart b/lib/pages/settings/branch/branch_list_page.dart new file mode 100644 index 0000000..4449f56 --- /dev/null +++ b/lib/pages/settings/branch/branch_list_page.dart @@ -0,0 +1,168 @@ +import 'package:car_provider_app/api/client/branch_api_client.dart'; +import 'package:car_provider_app/classes/app_state.dart'; +import 'package:car_provider_app/extensions/int_extensions.dart'; +import 'package:car_provider_app/extensions/string_extensions.dart'; +import 'package:car_provider_app/extensions/widget_extensions.dart'; +import 'package:car_provider_app/utils/utils.dart'; +import 'package:car_provider_app/widgets/app_bar.dart'; +import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/svg.dart'; +import 'package:geolocator/geolocator.dart'; + +import '../../../classes/colors.dart'; +import '../../../classes/utils.dart'; +import '../../../config/routes.dart'; +import '../../../generated/locale_keys.g.dart'; + +import '../../../models/m_response.dart'; +import '../../../models/profile/branch.dart'; +import '../../../models/profile/branch2.dart'; +import '../../../utils/navigator.dart'; +import '../../../widgets/button/show_fill_button.dart'; + +class BranchListPage extends StatefulWidget { + @override + State createState() => _BranchListPageState(); +} + +class _BranchListPageState extends State { + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: appBar( + context, + title: LocaleKeys.myServiceBranches.tr(), + ), + floatingActionButton: FloatingActionButton( + child: Icon( + Icons.add, + color: Colors.white, + ), + onPressed: () async { + await navigateWithName(context, AppRoutes.defineBranch); + setState(() {}); + }, + ), + body: Container( + width: double.infinity, + height: double.infinity, + child: Builder(builder: (context) { + return FutureBuilder( + future: BranchApiClent().getBranchAndServices(), + builder: (context, snapshot) { + if (snapshot.hasData) { + return snapshot.data!.data!.serviceProviderBranch!.length == 0 + ? Center(child: Text(LocaleKeys.no_branch.tr())) + : ListView.separated( + itemBuilder: (context, index) { + return Row( + children: [ + Container( + width: 74, + height: 50, + decoration: BoxDecoration( + color: MyColors.darkPrimaryColor, + borderRadius: BorderRadius.all(Radius.circular(8)), + ), + padding: EdgeInsets.all(6), + child: SvgPicture.asset( + "assets/icons/ic_branchs.svg", + color: Colors.white, + ), + ), + 12.width, + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Row( + children: [ + Icon( + Icons.place, + size: 12, + color: MyColors.darkPrimaryColor, + ), + Geolocator.distanceBetween( + AppState().currentLocation.latitude, + AppState().currentLocation.latitude, + double.parse(snapshot.data!.data!.serviceProviderBranch![index].latitude ?? "0"), + double.parse(snapshot.data!.data!.serviceProviderBranch![index].longitude ?? "0")) + .toStringAsFixed(2) + .toText12( + color: MyColors.darkPrimaryColor, + ) + ], + ), + Text( + snapshot.data!.data!.serviceProviderBranch![index].branchName ?? "", + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.bold, + ), + ), + LocaleKeys.tapToEdit.tr().toText10(color: MyColors.grey70Color), + ], + ), + ), + 12.width, + IconButton( + onPressed: () async { + Utils.showLoading(context); + MResponse res = await BranchApiClent().updateBranch( + snapshot.data!.data!.serviceProviderBranch![index].id ?? 0, + snapshot.data!.data!.serviceProviderBranch![index].branchName ?? "", + snapshot.data!.data!.serviceProviderBranch![index].branchDescription ?? "", + snapshot.data!.data!.serviceProviderBranch![index].cityId.toString(), + snapshot.data!.data!.serviceProviderBranch![index].address ?? "", + snapshot.data!.data!.serviceProviderBranch![index].latitude.toString(), + snapshot.data!.data!.serviceProviderBranch![index].longitude.toString(), + isNeedToDelete: false); + Utils.hideLoading(context); + if (res.messageStatus == 1) { + Utils.showToast(LocaleKeys.branch_deleted.tr()); + setState(() {}); + } else { + Utils.showToast(res.message ?? ""); + } + }, + icon: Icon(Icons.delete), + color: Colors.red, + ), + Icon( + Icons.arrow_forward_rounded, + size: 16, + ), + ], + ).toContainer().onPress(() async { + // await navigateWithName(context, AppRoutes.defineBranch, arguments: snapshot.data!.data![index]); + // setState(() {}); + snapshot.data!.data!.serviceProviderBranch![index].countryID=snapshot.data!.data!.countryID; + await navigateWithName(context, AppRoutes.branchDetail, arguments: snapshot.data!.data!.serviceProviderBranch![index]); + setState(() {}); + }); + }, + separatorBuilder: (context, index) { + return 12.height; + }, + itemCount: snapshot.data!.data!.serviceProviderBranch!.length, + padding: EdgeInsets.all(12), + ); + } else { + return Center( + child: CircularProgressIndicator(), + ); + } + }, + ); + }), + ), + ); + } +} diff --git a/lib/pages/settings/define_branch_page.dart b/lib/pages/settings/branch/define_branch_page.dart similarity index 58% rename from lib/pages/settings/define_branch_page.dart rename to lib/pages/settings/branch/define_branch_page.dart index a43c3b0..65c71f5 100644 --- a/lib/pages/settings/define_branch_page.dart +++ b/lib/pages/settings/branch/define_branch_page.dart @@ -2,22 +2,27 @@ import 'package:car_provider_app/api/client/branch_api_client.dart'; import 'package:car_provider_app/api/client/user_api_client.dart'; import 'package:car_provider_app/classes/utils.dart'; import 'package:car_provider_app/extensions/int_extensions.dart'; +import 'package:car_provider_app/extensions/string_extensions.dart'; import 'package:car_provider_app/models/m_response.dart'; import 'package:car_provider_app/models/profile/branch.dart'; import 'package:car_provider_app/models/user/cities.dart'; import 'package:car_provider_app/models/user/country.dart'; import 'package:car_provider_app/pages/location/pick_location_page.dart'; import 'package:car_provider_app/utils/utils.dart'; +import 'package:car_provider_app/widgets/app_bar.dart'; import 'package:car_provider_app/widgets/dropdown/dropdow_field.dart'; -import 'package:car_provider_app/widgets/show_fill_button.dart'; +import 'package:car_provider_app/widgets/button/show_fill_button.dart'; import 'package:car_provider_app/widgets/txt_field.dart'; import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; -import '../../generated/locale_keys.g.dart'; +import '../../../classes/colors.dart'; +import '../../../generated/locale_keys.g.dart'; +import '../../../models/profile/branch2.dart'; +import '../../../utils/navigator.dart'; class DefineBranchPage extends StatefulWidget { - BranchData branchData; + ServiceProviderBranch? branchData; DefineBranchPage(this.branchData); @@ -50,8 +55,8 @@ class _DefineBranchPageState extends State { country = await UserApiClent().getAllCountries(); setState(() { country!.data?.forEach((element) { - if (widget.branchData.id != null) { - if (element.id == widget.branchData.countryID) { + if (widget.branchData!.id != null) { + if (element.id == widget.branchData!.countryID) { countryValue = new DropValue( element.id ?? 0, EasyLocalization.of(context)?.currentLocale?.countryCode == "SA" ? (element.countryNameN ?? "") : (element.countryName ?? ""), element.countryCode ?? ""); } @@ -59,7 +64,7 @@ class _DefineBranchPageState extends State { countryDropList.add( new DropValue(element.id ?? 0, EasyLocalization.of(context)?.currentLocale?.countryCode == "SA" ? (element.countryNameN ?? "") : (element.countryName ?? ""), element.countryCode ?? "")); }); - if (widget.branchData.id != null) fetchCites(); + if (widget.branchData!.id != null) fetchCites(); }); } @@ -71,15 +76,15 @@ class _DefineBranchPageState extends State { cities = await UserApiClent().getAllCites(countryId.toString()); setState(() { cities!.data?.forEach((element) { - if (widget.branchData.id != null) { - if (element.id == widget.branchData.cityId) { - address = widget.branchData.address!; - branchName = widget.branchData.branchName!; - branchDescription = widget.branchData.branchDescription!; - latitude = double.parse(widget.branchData.latitude ?? ""); - longitude = double.parse(widget.branchData.longitude ?? ""); - countryId = widget.branchData.countryID!; - cityId = widget.branchData.cityId!; + if (widget.branchData!.id != null) { + if (element.id == widget.branchData!.cityId) { + address = widget.branchData!.address!; + branchName = widget.branchData!.branchName!; + branchDescription = widget.branchData!.branchDescription!; + latitude = double.parse(widget.branchData!.latitude ?? ""); + longitude = double.parse(widget.branchData!.longitude ?? ""); + countryId = widget.branchData!.countryID!; + cityId = widget.branchData!.cityId!; cityValue = new DropValue(element.id ?? 0, EasyLocalization.of(context)?.currentLocale?.countryCode == "SA" ? (element.cityNameN ?? "") : (element.cityName ?? ""), element.id.toString() ?? ""); } @@ -93,11 +98,7 @@ class _DefineBranchPageState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - title: Text( - LocaleKeys.defineBranches.tr(), - ), - ), + appBar: appBar(context), body: Container( width: double.infinity, height: double.infinity, @@ -106,9 +107,15 @@ class _DefineBranchPageState extends State { Expanded( child: SingleChildScrollView( child: Padding( - padding: const EdgeInsets.all(12.0), + padding: const EdgeInsets.all(20.0), child: Column( children: [ + LocaleKeys.defineBranches.tr().toText20(isBold: true), + 12.height, + LocaleKeys.branchLocation.tr().toText14(color: MyColors.lightTextColor), + 20.height, + LocaleKeys.chooseCountry.tr().toText14(color: MyColors.lightTextColor), + 8.height, country != null ? DropdownField( (DropValue value) { @@ -170,9 +177,8 @@ class _DefineBranchPageState extends State { }, ), 12.height, - ShowFillButton( - title: LocaleKeys.pickAddress.tr(), - onPressed: () { + InkWell( + onTap: () { navigateTo( context, PickLocationPage( @@ -186,6 +192,38 @@ class _DefineBranchPageState extends State { ), ); }, + child: Container( + width: double.infinity, + height: 45, + decoration: BoxDecoration( + color: Colors.transparent, + border: Border.all(color: MyColors.darkPrimaryColor, width: 2), + borderRadius: BorderRadius.all(Radius.circular(8)), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Icon( + Icons.place_outlined, + size: 18, + color: MyColors.darkPrimaryColor, + ), + 8.width, + Text( + LocaleKeys.pickAddress.tr(), + style: TextStyle( + color: MyColors.darkPrimaryColor, + ), + ), + Icon( + Icons.place_outlined, + size: 18, + color: Colors.transparent, + ), + ], + ), + ), ), ], ), @@ -194,32 +232,38 @@ class _DefineBranchPageState extends State { ), ), ), - Padding( - padding: const EdgeInsets.all(12.0), - child: ShowFillButton( - title: widget.branchData.id == null ? LocaleKeys.createBranch.tr() : LocaleKeys.updateBranch.tr(), - onPressed: () async { - if (widget.branchData.id == null) { - Utils.showLoading(context); - MResponse res = await BranchApiClent().createBranch(branchName, branchDescription, cityId.toString(), address, latitude.toString(), longitude.toString()); - Utils.hideLoading(context); - if (res.messageStatus == 1) { - Utils.showToast(LocaleKeys.branch_created.tr()); + Container( + width: double.infinity, + child: Padding( + padding: const EdgeInsets.only(left: 20, right: 20, bottom: 20), + child: ShowFillButton( + title: widget.branchData!.id == null ? LocaleKeys.createBranch.tr() : LocaleKeys.updateBranch.tr(), + onPressed: () async { + if (widget.branchData!.id == null) { + Utils.showLoading(context); + MResponse res = await BranchApiClent().createBranch(branchName, branchDescription, cityId.toString(), address, latitude.toString(), longitude.toString()); + Utils.hideLoading(context); + if (res.messageStatus == 1) { + Utils.showToast(LocaleKeys.branch_created.tr()); + pop(context); + } else { + Utils.showToast(res.message ?? ""); + } } else { - Utils.showToast(res.message ?? ""); + Utils.showLoading(context); + MResponse res = + await BranchApiClent().updateBranch(widget.branchData!.id ?? 0, branchName, branchDescription, cityId.toString(), address, latitude.toString(), longitude.toString()); + Utils.hideLoading(context); + if (res.messageStatus == 1) { + Utils.showToast(LocaleKeys.branch_updated.tr()); + pop(context); + pop(context); + } else { + Utils.showToast(res.message ?? ""); + } } - } else { - Utils.showLoading(context); - MResponse res = - await BranchApiClent().updateBranch(widget.branchData.id ?? 0, branchName, branchDescription, cityId.toString(), address, latitude.toString(), longitude.toString()); - Utils.hideLoading(context); - if (res.messageStatus == 1) { - Utils.showToast(LocaleKeys.branch_updated.tr()); - } else { - Utils.showToast(res.message ?? ""); - } - } - }, + }, + ), ), ), ], diff --git a/lib/pages/settings/branch_detail_page.dart b/lib/pages/settings/branch_detail_page.dart deleted file mode 100644 index 6b61a46..0000000 --- a/lib/pages/settings/branch_detail_page.dart +++ /dev/null @@ -1,146 +0,0 @@ -import 'package:car_provider_app/api/client/branch_api_client.dart'; -import 'package:car_provider_app/extensions/int_extensions.dart'; -import 'package:easy_localization/easy_localization.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_svg/svg.dart'; - -import '../../classes/utils.dart'; -import '../../config/routes.dart'; -import '../../generated/locale_keys.g.dart'; - -import '../../models/m_response.dart'; -import '../../models/profile/branch.dart'; -import '../../utils/navigator.dart'; -import '../../widgets/show_fill_button.dart'; - -class BranchDetailPage extends StatefulWidget { - @override - State createState() => _BranchDetailPageState(); -} - -class _BranchDetailPageState extends State { - @override - void initState() { - super.initState(); - } - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text( - LocaleKeys.defineBranches.tr(), - ), - ), - body: Container( - width: double.infinity, - height: double.infinity, - child: Column( - children: [ - Expanded( - child: FutureBuilder( - future: BranchApiClent().fetchBranch(), - builder: (context, snapshot) { - if (snapshot.hasData) { - return snapshot.data!.data!.length == 0 - ? Center(child: Text(LocaleKeys.no_branch.tr())) - : ListView.separated( - itemBuilder: (context, index) { - return Row( - children: [ - Container( - width: 44, - height: 44, - color: Colors.blue, - padding: EdgeInsets.all(6), - child: SvgPicture.asset( - "assets/icons/ic_branchs.svg", - color: Colors.white, - ), - ), - 12.width, - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Text( - snapshot.data!.data![index].branchName ?? "", - style: TextStyle( - fontSize: 18, - fontWeight: FontWeight.bold, - ), - ), - 8.height, - Text( - snapshot.data!.data![index].address ?? "N/A", - style: TextStyle( - fontSize: 16, - ), - ), - ], - ), - ), - ShowFillButton( - title: LocaleKeys.edit.tr(), - fontSize: 12, - width: 50, - height: 30, - horizontalPadding: 8, - onPressed: () async { - await navigateWithName(context, AppRoutes.defineBranch, arguments: snapshot.data!.data![index]); - setState(() {}); - }, - ), - 12.width, - ShowFillButton( - title: LocaleKeys.remove.tr(), - fontSize: 12, - width: 50, - height: 30, - horizontalPadding: 8, - onPressed: () async { - Utils.showLoading(context); - MResponse res = - await BranchApiClent().updateBranch(snapshot.data!.data![index].id ?? 0, snapshot.data!.data![index].branchName??"", snapshot.data!.data![index].branchDescription??"", snapshot.data!.data![index].cityId.toString(), snapshot.data!.data![index].address??"", snapshot.data!.data![index].latitude.toString(), snapshot.data!.data![index].longitude.toString(),isNeedToDelete: false); - Utils.hideLoading(context); - if (res.messageStatus == 1) { - Utils.showToast(LocaleKeys.branch_deleted.tr()); - setState(() {}); - } else { - Utils.showToast(res.message ?? ""); - } - }, - ) - ], - ); - }, - separatorBuilder: (context, index) { - return 12.height; - }, - itemCount: snapshot.data!.data!.length, - padding: EdgeInsets.all(12), - ); - } else { - return Center( - child: CircularProgressIndicator(), - ); - } - }, - )), - Padding( - padding: const EdgeInsets.all(12.0), - child: ShowFillButton( - title: LocaleKeys.createBranch.tr(), - onPressed: () async { - await navigateWithName(context, AppRoutes.defineBranch, arguments: new BranchData()); - setState(() {}); - }, - ), - ) - ], - ), - ), - ); - } -} diff --git a/lib/pages/settings/create_services_page.dart b/lib/pages/settings/create_services_page.dart index f8d072b..227aa1d 100644 --- a/lib/pages/settings/create_services_page.dart +++ b/lib/pages/settings/create_services_page.dart @@ -6,15 +6,25 @@ import 'package:car_provider_app/models/profile/branch.dart'; import 'package:car_provider_app/models/profile/categroy.dart'; import 'package:car_provider_app/models/profile/services.dart'; import 'package:car_provider_app/models/user/country.dart'; +import 'package:car_provider_app/utils/navigator.dart'; +import 'package:car_provider_app/widgets/app_bar.dart'; import 'package:car_provider_app/widgets/dropdown/dropdow_field.dart'; -import 'package:car_provider_app/widgets/show_fill_button.dart'; +import 'package:car_provider_app/widgets/button/show_fill_button.dart'; import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/src/public_ext.dart'; import 'package:flutter/material.dart'; import 'package:car_provider_app/extensions/int_extensions.dart'; import 'package:car_provider_app/extensions/string_extensions.dart'; +import '../../classes/colors.dart'; +import '../../models/profile/branch2.dart'; +import '../../utils/utils.dart'; + class CreateServicesPage extends StatefulWidget { + ServiceProviderBranch? serviceProviderBranch; + + CreateServicesPage(this.serviceProviderBranch); + @override State createState() => _CreateServicesPageState(); } @@ -22,6 +32,7 @@ class CreateServicesPage extends StatefulWidget { class _CreateServicesPageState extends State { String? branchName; int categoryId = -1, branchId = -1; + DropValue? branchValue; List countryDropList = []; List categoryDropList = []; @@ -34,6 +45,12 @@ class _CreateServicesPageState extends State { void initState() { // TODO: implement initState super.initState(); + if (widget.serviceProviderBranch != null) { + branchId = widget.serviceProviderBranch!.id ?? -1; + branchValue = new DropValue(branchId, widget.serviceProviderBranch!.branchName ?? "", ""); + print("llll1 " + branchId.toString() + " " + widget.serviceProviderBranch!.branchName.toString()); + if (branchId != 1) fetchBrancheCategory(); + } fetchBranches(); } @@ -50,7 +67,15 @@ class _CreateServicesPageState extends State { category = await BranchApiClent().fetchBranchCategory(); setState(() { category!.data?.forEach((element) { - categoryDropList.add(new DropValue(element.id ?? 0, ((element.categoryName!.isEmpty ? "N/A" :EasyLocalization.of(context)?.currentLocale?.countryCode == "SA"? element.categoryNameN:element.categoryName) ?? "N/A"), "")); + categoryDropList.add(new DropValue( + element.id ?? 0, + ((element.categoryName!.isEmpty + ? "N/A" + : EasyLocalization.of(context)?.currentLocale?.countryCode == "SA" + ? element.categoryNameN + : element.categoryName) ?? + "N/A"), + "")); }); }); } @@ -63,9 +88,7 @@ class _CreateServicesPageState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - title: Text(LocaleKeys.defineServices.tr()), - ), + appBar: appBar(context, title: LocaleKeys.defineServices.tr()), body: Container( width: double.infinity, height: double.infinity, @@ -78,15 +101,39 @@ class _CreateServicesPageState extends State { child: Column( children: [ branch != null - ? DropdownField((DropValue value) { - setState(() { - // countryCode = value.subValue; - // countryId = value.id; - // fetchCites(); - branchId = value.id; - fetchBrancheCategory(); - }); - }, list: countryDropList, hint: LocaleKeys.selectBranch.tr()) + ? (branchValue != null && branchId != -1) + ? Container( + width: double.infinity, + child: Text( + branchValue!.value ?? "", + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.bold, + ), + ), + decoration: containerColorRadiusBorderWidth( + MyColors.textFieldColor, + 8, + MyColors.textFieldColor, + 0, + ), + margin: EdgeInsets.all(0), + padding: EdgeInsets.only(left: 8, right: 8, bottom: 12, top: 12), + ) + : DropdownField( + (DropValue value) { + setState(() { + // countryCode = value.subValue; + // countryId = value.id; + // fetchCites(); + branchId = value.id; + fetchBrancheCategory(); + }); + }, + list: countryDropList, + hint: LocaleKeys.selectBranch.tr(), + dropdownValue: branchValue, + ) : CircularProgressIndicator(), 12.height, (category != null) @@ -103,34 +150,36 @@ class _CreateServicesPageState extends State { ? Container() : CircularProgressIndicator(), 12.height, - if (services != null) - ListView.separated( - itemBuilder: (context, index) { - return Padding( - padding: const EdgeInsets.all(8.0), - child: Row( - children: [ - Checkbox( - value: services!.data![index].isSelected, - onChanged: (v) { - setState(() { - services!.data![index].isSelected = v; - }); - }, - ), - 12.width, - ((EasyLocalization.of(context)?.currentLocale?.countryCode == "SA"?services!.data![index].descriptionN:services!.data![index].description) ?? "").toText12() - ], - ), - ); - }, - separatorBuilder: (context, index) { - return 1.height; - }, - itemCount: services!.data!.length, - physics: NeverScrollableScrollPhysics(), - shrinkWrap: true, - ) + if ((categoryId != -1)) + services == null + ? CircularProgressIndicator() + : ListView.separated( + itemBuilder: (context, index) { + return Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + children: [ + Checkbox( + value: services!.data![index].isSelected, + onChanged: (v) { + setState(() { + services!.data![index].isSelected = v; + }); + }, + ), + 12.width, + ((EasyLocalization.of(context)?.currentLocale?.countryCode == "SA" ? services!.data![index].descriptionN : services!.data![index].description) ?? "").toText12() + ], + ), + ); + }, + separatorBuilder: (context, index) { + return 1.height; + }, + itemCount: services!.data!.length, + physics: NeverScrollableScrollPhysics(), + shrinkWrap: true, + ) ], ), ), @@ -141,7 +190,7 @@ class _CreateServicesPageState extends State { padding: const EdgeInsets.all(12.0), child: ShowFillButton( title: LocaleKeys.save.tr(), - width: double.infinity, + maxWidth: double.infinity, onPressed: () { createService(); }, @@ -168,21 +217,47 @@ class _CreateServicesPageState extends State { createService() async { List> map = []; - for (int i = 0; i < services!.data!.length; i++) { - if (services!.data![i].isSelected ?? false) { - var postParams = { - // "id": services!.data![i].id, - "providerBranchID": branchId, - "serviceID": services!.data![i].id, - "isAllowAppointment": true, - "isActive": true - }; - map.add(postParams); + if (widget.serviceProviderBranch != null && branchId != -1) { + for (int i = 0; i < services!.data!.length; i++) { + if (services!.data![i].isSelected ?? false) { + var postParams = { + // "id": services!.data![i].id, + "providerBranchID": branchId, + "serviceID": services!.data![i].id, + "isAllowAppointment": true, + "isActive": true + }; + map.add(postParams); + } + } + Utils.showLoading(context); + MResponse mResponse = await BranchApiClent().createService(map); + Utils.hideLoading(context); + + if (widget.serviceProviderBranch != null) { + Utils.showToast(mResponse.message ?? ""); + if (mResponse.messageStatus != 2) { + pop(context); + pop(context); + } + } + } else { + for (int i = 0; i < services!.data!.length; i++) { + if (services!.data![i].isSelected ?? false) { + var postParams = { + // "id": services!.data![i].id, + "providerBranchID": branchId, + "serviceID": services!.data![i].id, + "isAllowAppointment": true, + "isActive": true + }; + map.add(postParams); + } } + Utils.showLoading(context); + MResponse mResponse = await BranchApiClent().createService(map); + Utils.hideLoading(context); + Utils.showToast(mResponse.message ?? ""); } - Utils.showLoading(context); - MResponse mResponse = await BranchApiClent().createService(map); - Utils.hideLoading(context); - Utils.showToast(mResponse.message ?? ""); } } diff --git a/lib/pages/settings/dealership_page.dart b/lib/pages/settings/dealership_page.dart index fb1795a..f19b247 100644 --- a/lib/pages/settings/dealership_page.dart +++ b/lib/pages/settings/dealership_page.dart @@ -1,47 +1,69 @@ import 'package:car_provider_app/config/routes.dart'; import 'package:car_provider_app/extensions/string_extensions.dart'; import 'package:car_provider_app/generated/locale_keys.g.dart'; +import 'package:car_provider_app/models/m_response.dart'; import 'package:car_provider_app/utils/navigator.dart'; +import 'package:car_provider_app/widgets/app_bar.dart'; import 'package:easy_localization/src/public_ext.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import '../../api/client/branch_api_client.dart'; +import '../../classes/colors.dart'; +import '../../models/profile/branch2.dart'; + class DealershipPage extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - title: Text(LocaleKeys.dealershipSettings.tr()), - ), + appBar: appBar(context, title: LocaleKeys.dealershipSettings.tr()), body: Container( width: double.infinity, height: double.infinity, child: Column( children: [ ListTile( - leading: SvgPicture.asset("assets/icons/ic_settings.svg"), + leading: SvgPicture.asset( + "assets/icons/ic_settings.svg", + color: MyColors.darkPrimaryColor, + ), title: LocaleKeys.general.tr().toText12(), ), ListTile( - leading: SvgPicture.asset("assets/icons/ic_branchs.svg"), + leading: SvgPicture.asset( + "assets/icons/ic_branchs.svg", + color: MyColors.darkPrimaryColor, + ), title: LocaleKeys.defineBranches.tr().toText12(), onTap: () { - navigateWithName(context, AppRoutes.branch); + navigateWithName(context, AppRoutes.branchList); }, ), ListTile( - leading: SvgPicture.asset("assets/icons/ic_services.svg"), + leading: SvgPicture.asset( + "assets/icons/ic_services.svg", + color: MyColors.darkPrimaryColor, + ), title: LocaleKeys.defineServices.tr().toText12(), onTap: () { navigateWithName(context, AppRoutes.createServices); }, ), ListTile( - leading: SvgPicture.asset("assets/icons/ic_provider.svg"), + leading: SvgPicture.asset( + "assets/icons/ic_provider.svg", + color: MyColors.darkPrimaryColor, + ), title: LocaleKeys.defineProviders.tr().toText12(), + onTap: () async { + // Branch2 mResponse = await BranchApiClent().getBranchAndServices(); + }, ), ListTile( - leading: SvgPicture.asset("assets/icons/ic_close_account.svg"), + leading: SvgPicture.asset( + "assets/icons/ic_close_account.svg", + color: MyColors.darkPrimaryColor, + ), title: LocaleKeys.closeAccount.tr().toText12(), ), ], diff --git a/lib/pages/settings/define_license_page.dart b/lib/pages/settings/define_license_page.dart index 4b9e11b..e5780b7 100644 --- a/lib/pages/settings/define_license_page.dart +++ b/lib/pages/settings/define_license_page.dart @@ -4,16 +4,20 @@ import 'dart:io'; import 'package:car_provider_app/api/client/profile_api_client.dart'; import 'package:car_provider_app/classes/app_state.dart'; import 'package:car_provider_app/classes/utils.dart'; +import 'package:car_provider_app/extensions/string_extensions.dart'; import 'package:car_provider_app/models/profile/document.dart'; import 'package:car_provider_app/utils/utils.dart'; -import 'package:car_provider_app/widgets/show_fill_button.dart'; +import 'package:car_provider_app/widgets/button/show_fill_button.dart'; import 'package:car_provider_app/widgets/txt_field.dart'; import 'package:easy_localization/easy_localization.dart'; import 'package:file_picker/file_picker.dart'; import 'package:flutter/material.dart'; import 'package:car_provider_app/extensions/int_extensions.dart'; +import 'package:sizer/sizer.dart'; +import '../../classes/colors.dart'; import '../../generated/locale_keys.g.dart'; +import '../../widgets/app_bar.dart'; class DefineLicensePage extends StatefulWidget { @override @@ -38,8 +42,9 @@ class _DefineLicensePageState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - title: Text(LocaleKeys.defineLicences.tr()), + appBar: appBar( + context, + title: "", ), body: Container( width: double.infinity, @@ -47,13 +52,26 @@ class _DefineLicensePageState extends State { child: Column( children: [ Expanded( - child: showWidget(), + child: SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.all(20.0), + child: Column( + children: [ + LocaleKeys.defineLicences.tr().toText20(isBold: true), + 12.height, + LocaleKeys.defineLicenese.tr().toText14(color: MyColors.lightTextColor), + 20.height, + showWidget(), + ], + ), + ), + ), ), Padding( padding: const EdgeInsets.all(12.0), child: ShowFillButton( title: LocaleKeys.update.tr(), - width: double.infinity, + maxWidth: double.infinity, onPressed: () { if (AppState().getUser.data!.userInfo!.roleId == 5) { if (validation()) { @@ -102,35 +120,78 @@ class _DefineLicensePageState extends State { : ListView.separated( itemBuilder: (context, index) { return Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, children: [ - Text(document?.data![index].documentName ?? ""), - Row( - children: [ - Flexible( - child: TxtField( - hint: LocaleKeys.selectAttachment.tr(), - value: document?.data![index].documentUrl ?? "", - isNeedClickAll: true, - maxLines: 2, - ), + Text( + document?.data![index].documentName ?? "", + style: TextStyle( + fontSize: 16, + ), + ), + Padding( + padding: const EdgeInsets.only(left: 20, right: 20, top: 4, bottom: 8), + child: "Please enter the detail for commercial records and attach the license images".toText14(color: MyColors.lightTextColor, textAlign: TextAlign.center), + ), + TxtField( + hint: LocaleKeys.description.tr(), + maxLines: 3, + ), + if (((document?.data![index].documentUrl ?? "").toString().isNotEmpty)) + Column( + children: [ + 8.height, + (document?.data![index].documentUrl ?? "").toString().toText14( + color: MyColors.lightTextColor, + ), + ], + ), + 8.height, + InkWell( + onTap: () { + selectFile(index); + }, + child: Container( + width: double.infinity, + height: 45, + decoration: BoxDecoration( + color: Colors.transparent, + border: Border.all(color: MyColors.darkPrimaryColor, width: 2), + borderRadius: BorderRadius.all(Radius.circular(8)), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Icon( + Icons.attach_file, + size: 18, + color: MyColors.darkPrimaryColor, + ), + 8.width, + Text( + LocaleKeys.attachFile.tr(), + style: TextStyle( + color: MyColors.darkPrimaryColor, + ), + ), + Icon( + Icons.attach_file, + size: 18, + color: Colors.transparent, + ), + ], ), - IconButton( - onPressed: () { - selectFile(index); - }, - icon: Icon(Icons.insert_link_rounded), - ) - ], + ), ), ], ); }, separatorBuilder: (context, index) { - return 12.height; + return 20.height; }, - padding: EdgeInsets.all(12), itemCount: document!.data!.length, + physics: NeverScrollableScrollPhysics(), + shrinkWrap: true, ); } else { return Center( diff --git a/lib/pages/user/change_email_page.dart b/lib/pages/user/change_email_page.dart index 8a381c4..6d81d97 100644 --- a/lib/pages/user/change_email_page.dart +++ b/lib/pages/user/change_email_page.dart @@ -12,7 +12,7 @@ import 'package:car_provider_app/widgets/app_bar.dart'; import 'package:car_provider_app/widgets/dialog/dialogs.dart'; import 'package:car_provider_app/widgets/dialog/message_dialog.dart'; import 'package:car_provider_app/widgets/dialog/otp_dialog.dart'; -import 'package:car_provider_app/widgets/show_fill_button.dart'; +import 'package:car_provider_app/widgets/button/show_fill_button.dart'; import 'package:easy_localization/src/public_ext.dart'; import 'package:flutter/material.dart'; @@ -32,7 +32,7 @@ class _ChangeEmailPageState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: appBar(title: "Change Email"), + appBar: appBar(context,title: "Change Email"), body: SingleChildScrollView( child: Container( // width: double.infinity, @@ -72,7 +72,7 @@ class _ChangeEmailPageState extends State { 40.height, ShowFillButton( title: "Confirm", - width: double.infinity, + maxWidth: double.infinity, onPressed: () { changeEmail(context); }, diff --git a/lib/pages/user/change_mobile_page.dart b/lib/pages/user/change_mobile_page.dart index 0a54f6f..e30fa4f 100644 --- a/lib/pages/user/change_mobile_page.dart +++ b/lib/pages/user/change_mobile_page.dart @@ -12,7 +12,7 @@ import 'package:car_provider_app/widgets/app_bar.dart'; import 'package:car_provider_app/widgets/dialog/dialogs.dart'; import 'package:car_provider_app/widgets/dialog/message_dialog.dart'; import 'package:car_provider_app/widgets/dialog/otp_dialog.dart'; -import 'package:car_provider_app/widgets/show_fill_button.dart'; +import 'package:car_provider_app/widgets/button/show_fill_button.dart'; import 'package:easy_localization/src/public_ext.dart'; import 'package:flutter/material.dart'; @@ -33,7 +33,7 @@ class _ChangeMobilePageState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: appBar(title: LocaleKeys.changeMobile.tr()), + appBar: appBar(context,title: LocaleKeys.changeMobile.tr()), body: SingleChildScrollView( child: Container( // width: double.infinity, @@ -73,7 +73,7 @@ class _ChangeMobilePageState extends State { 40.height, ShowFillButton( title: LocaleKeys.confirm.tr(), - width: double.infinity, + maxWidth: double.infinity, onPressed: () { changeMobile(context); }, diff --git a/lib/pages/user/change_password_page.dart b/lib/pages/user/change_password_page.dart index 720c8e8..ba4aead 100644 --- a/lib/pages/user/change_password_page.dart +++ b/lib/pages/user/change_password_page.dart @@ -10,7 +10,7 @@ import 'package:car_provider_app/utils/utils.dart'; import 'package:car_provider_app/widgets/app_bar.dart'; import 'package:car_provider_app/widgets/dialog/dialogs.dart'; import 'package:car_provider_app/widgets/dialog/message_dialog.dart'; -import 'package:car_provider_app/widgets/show_fill_button.dart'; +import 'package:car_provider_app/widgets/button/show_fill_button.dart'; import 'package:car_provider_app/extensions/string_extensions.dart'; import 'package:car_provider_app/extensions/int_extensions.dart'; import 'package:car_provider_app/widgets/txt_field.dart'; @@ -36,7 +36,7 @@ class _ChangePasswordPageState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: appBar(title: LocaleKeys.changePassword.tr()), + appBar: appBar(context,title: LocaleKeys.changePassword.tr()), body: SingleChildScrollView( child: Container( // width: double.infinity, @@ -76,7 +76,7 @@ class _ChangePasswordPageState extends State { 40.height, ShowFillButton( title: LocaleKeys.confirm.tr(), - width: double.infinity, + maxWidth: double.infinity, onPressed: () { changePassword(context); }, diff --git a/lib/pages/user/complete_profile_page.dart b/lib/pages/user/complete_profile_page.dart index 5e74840..f654dab 100644 --- a/lib/pages/user/complete_profile_page.dart +++ b/lib/pages/user/complete_profile_page.dart @@ -1,4 +1,5 @@ import 'package:car_provider_app/api/client/user_api_client.dart'; +import 'package:car_provider_app/classes/colors.dart'; import 'package:car_provider_app/classes/utils.dart'; import 'package:car_provider_app/config/routes.dart'; import 'package:car_provider_app/models/m_response.dart'; @@ -10,7 +11,7 @@ import 'package:car_provider_app/widgets/app_bar.dart'; import 'package:car_provider_app/widgets/dialog/dialogs.dart'; import 'package:car_provider_app/widgets/dialog/message_dialog.dart'; import 'package:car_provider_app/widgets/dialog/otp_dialog.dart'; -import 'package:car_provider_app/widgets/show_fill_button.dart'; +import 'package:car_provider_app/widgets/button/show_fill_button.dart'; import 'package:car_provider_app/extensions/widget_extensions.dart'; import 'package:car_provider_app/extensions/int_extensions.dart'; import 'package:car_provider_app/extensions/string_extensions.dart'; @@ -42,7 +43,10 @@ class _CompleteProfilePageState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: appBar(title: LocaleKeys.signUp.tr(),), + appBar: appBar( + context, + title: LocaleKeys.signUp.tr(), + ), body: Container( width: double.infinity, height: double.infinity, @@ -51,9 +55,17 @@ class _CompleteProfilePageState extends State { padding: EdgeInsets.all(20), child: Column( children: [ + 6.height, LocaleKeys.completeProfile.tr().toText24(), 12.height, - + Padding( + padding: const EdgeInsets.symmetric(horizontal: 20), + child: LocaleKeys.profileMsg.tr().toText14( + color: MyColors.lightTextColor, + textAlign: TextAlign.center, + ), + ), + 12.height, TxtField( hint: LocaleKeys.firstName.tr(), value: firstName, @@ -73,7 +85,7 @@ class _CompleteProfilePageState extends State { TxtField( hint: LocaleKeys.email.tr(), value: email, - // isButtonEnable: email!.length > 0 ? true : false, + // isButtonEnable: email!.length > 0 ? true : false, buttonTitle: LocaleKeys.verify.tr(), onChanged: (v) { email = v; @@ -107,17 +119,32 @@ class _CompleteProfilePageState extends State { Row( children: [ buildCheckbox(), - LocaleKeys.termsOfService.tr().toText12(), + Expanded( + child: Column( + children: [ + LocaleKeys.termsOfService.tr().toText12(), + LocaleKeys.terms.tr().toText12(color: MyColors.darkPrimaryColor), + ], + ), + ), + Theme( + data: ThemeData(unselectedWidgetColor: Colors.transparent), + child: Checkbox( + value: false, + onChanged: (_) {}, + ), + ) ], ), 16.height, ShowFillButton( - title: LocaleKeys.continu.tr(), - width: double.infinity, + title: LocaleKeys.save.tr(), + maxWidth: double.infinity, onPressed: () { if (validation()) performCompleteProfile(); }, ), + 16.height, ], ), ), @@ -168,20 +195,26 @@ class _CompleteProfilePageState extends State { RegisterUser user = await UserApiClent().basicComplete(widget.user.data?.userId ?? "", firstName!, lastName!, email!, password!); Utils.hideLoading(context); if (user.messageStatus == 1) { - Utils.showToast(LocaleKeys.successfullyRegistered.tr(),); - //("Successfully Registered, Please login once"); + Utils.showToast( + LocaleKeys.successfullyRegistered.tr(), + ); + //("Successfully Registered, Please login once"); pop(context); // navigateReplaceWithName(context, AppRoutes.dashboard,arguments: user); } else { Utils.showToast(user.message ?? ""); } } else { - Utils.showToast(LocaleKeys.pleaseEnterSamePassword.tr(),); - //("Please enter same password"); + Utils.showToast( + LocaleKeys.pleaseEnterSamePassword.tr(), + ); + //("Please enter same password"); } } else { - Utils.showToast(LocaleKeys.passwordShouldContains.tr(),); - //("Password Should contains Character, Number, Capital and small letters"); + Utils.showToast( + LocaleKeys.passwordShouldContains.tr(), + ); + //("Password Should contains Character, Number, Capital and small letters"); } } @@ -205,8 +238,8 @@ class _CompleteProfilePageState extends State { } else if (lastName!.isEmpty) { Utils.showToast("Surname is mandatory"); isValid = false; - }else if (email!.isNotEmpty) { - if(!isEmail(email!)){ + } else if (email!.isNotEmpty) { + if (!isEmail(email!)) { Utils.showToast(LocaleKeys.enterValidEmail.tr()); //("Enter Valid Email"); isValid = false; @@ -221,5 +254,4 @@ class _CompleteProfilePageState extends State { } return isValid; } - } diff --git a/lib/pages/user/confirm_new_password_page.dart b/lib/pages/user/confirm_new_password_page.dart index f08b171..d7ff962 100644 --- a/lib/pages/user/confirm_new_password_page.dart +++ b/lib/pages/user/confirm_new_password_page.dart @@ -9,7 +9,7 @@ import 'package:car_provider_app/utils/utils.dart'; import 'package:car_provider_app/widgets/app_bar.dart'; import 'package:car_provider_app/widgets/dialog/dialogs.dart'; import 'package:car_provider_app/widgets/dialog/message_dialog.dart'; -import 'package:car_provider_app/widgets/show_fill_button.dart'; +import 'package:car_provider_app/widgets/button/show_fill_button.dart'; import 'package:car_provider_app/extensions/string_extensions.dart'; import 'package:car_provider_app/extensions/int_extensions.dart'; import 'package:car_provider_app/widgets/txt_field.dart'; @@ -35,7 +35,7 @@ class _ConfirmNewPasswordPageState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: appBar(title:LocaleKeys.forgetPassword.tr()), + appBar: appBar(context,title:LocaleKeys.forgetPassword.tr()), body: SingleChildScrollView( child: Container( // width: double.infinity, @@ -75,7 +75,7 @@ class _ConfirmNewPasswordPageState extends State { 40.height, ShowFillButton( title: LocaleKeys.confirm.tr(), - width: double.infinity, + maxWidth: double.infinity, onPressed: () { if (validation()) confirmPasswordOTP(context); }, diff --git a/lib/pages/user/edit_account_page.dart b/lib/pages/user/edit_account_page.dart index 4228d74..dab56f2 100644 --- a/lib/pages/user/edit_account_page.dart +++ b/lib/pages/user/edit_account_page.dart @@ -2,6 +2,7 @@ import 'dart:convert'; import 'package:car_provider_app/api/client/user_api_client.dart'; import 'package:car_provider_app/classes/app_state.dart'; +import 'package:car_provider_app/classes/colors.dart'; import 'package:car_provider_app/classes/utils.dart'; import 'package:car_provider_app/config/routes.dart'; import 'package:car_provider_app/extensions/int_extensions.dart'; @@ -17,6 +18,7 @@ import 'package:car_provider_app/widgets/dialog/otp_dialog.dart'; import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:sizer/sizer.dart'; import '../../generated/locale_keys.g.dart'; @@ -32,61 +34,94 @@ class _EditAccountPageState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: appBar(title: LocaleKeys.editAccount.tr()), + appBar: appBar(context, title: LocaleKeys.editAccount.tr()), body: Container( width: double.infinity, height: double.infinity, - padding: EdgeInsets.all(40), + padding: EdgeInsets.all(20), child: Column( children: [ 20.height, - ListTile( - leading: SvgPicture.asset("assets/images/ic_lock.svg"), - title: LocaleKeys.changePassword.tr().toText12(), - onTap: () { - navigateWithName(context, AppRoutes.changePassword); - }, + Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SvgPicture.asset( + "assets/images/ic_lock.svg", + color: MyColors.darkPrimaryColor, + width: 16, + ), + 20.width, + Expanded(child: LocaleKeys.changePassword.tr().toText12(isBold: true)), + RaisedButton( + onPressed: () { + navigateWithName(context, AppRoutes.changePassword); + }, + child: Text( + LocaleKeys.change.tr(), + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + ), + ), + color: MyColors.darkPrimaryColor, + textColor: Colors.white, + padding: EdgeInsets.symmetric(horizontal: 8, vertical: 8), + ), + ], ), 15.height, Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.start, children: [ - SvgPicture.asset("assets/images/ic_mobile.svg"), - LocaleKeys.changeMobile.tr().toText12(), - LocaleKeys.verify.tr().toText12(), + SvgPicture.asset( + "assets/images/ic_mobile.svg", + color: MyColors.darkPrimaryColor, + width: 16, + ), + 20.width, + Expanded(child: LocaleKeys.changeMobile.tr().toText12(isBold: true)), + LocaleKeys.verify.tr().toText12(color: Colors.green), + 20.width, RaisedButton( - onPressed: () { - navigateWithName(context, AppRoutes.changeMobilePage); - }, - child: Text( - LocaleKeys.change.tr(), - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.w600, - ), + onPressed: () { + navigateWithName(context, AppRoutes.changeMobilePage); + }, + child: Text( + LocaleKeys.change.tr(), + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, ), - color: Colors.blue, - textColor: Colors.white, - padding: EdgeInsets.symmetric(horizontal: 8, vertical: 8)) + ), + textColor: Colors.white, + color: MyColors.darkPrimaryColor, + padding: EdgeInsets.symmetric(horizontal: 8, vertical: 8), + ) ], ), 20.height, Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.start, children: [ - Icon( - Icons.email, - color: Colors.blue, + SvgPicture.asset( + "assets/images/ic_email.svg", + color: MyColors.darkPrimaryColor, + width: 16, ), - LocaleKeys.changeEmail.tr().toText12(), + 20.width, + Expanded(child: LocaleKeys.changeEmail.tr().toText12(isBold: true)), InkWell( - child: ((AppState().getUser.data!.userInfo!.isEmailVerified ?? false) ? LocaleKeys.verified.tr() : LocaleKeys.verify.tr()).toText12(), + child: ((AppState().getUser.data!.userInfo!.isEmailVerified ?? false) ? LocaleKeys.verified.tr() : LocaleKeys.verify.tr()).toText12(color: Colors.green), onTap: (AppState().getUser.data!.userInfo!.isEmailVerified ?? false) ? null : () { verifyEmail(context); }, ), + 20.width, RaisedButton( onPressed: () { navigateWithName(context, AppRoutes.changeEmailPage); @@ -98,8 +133,8 @@ class _EditAccountPageState extends State { fontWeight: FontWeight.w600, ), ), - color: Colors.blue, textColor: Colors.white, + color: MyColors.darkPrimaryColor, padding: EdgeInsets.symmetric(horizontal: 8, vertical: 8)) ], ) diff --git a/lib/pages/user/forget_password_method_page.dart b/lib/pages/user/forget_password_method_page.dart index 8767d37..c5c3a16 100644 --- a/lib/pages/user/forget_password_method_page.dart +++ b/lib/pages/user/forget_password_method_page.dart @@ -36,7 +36,7 @@ class _ForgetPasswordMethodPageState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: appBar(title: LocaleKeys.forgetPassword.tr()), + appBar: appBar(context,title: LocaleKeys.forgetPassword.tr()), body: Container( width: double.infinity, height: double.infinity, diff --git a/lib/pages/user/forget_password_page.dart b/lib/pages/user/forget_password_page.dart index f30e18c..b7ef43b 100644 --- a/lib/pages/user/forget_password_page.dart +++ b/lib/pages/user/forget_password_page.dart @@ -14,7 +14,7 @@ import 'package:car_provider_app/widgets/button/show_image_button.dart'; import 'package:car_provider_app/widgets/dialog/dialogs.dart'; import 'package:car_provider_app/widgets/dialog/message_dialog.dart'; import 'package:car_provider_app/widgets/dialog/otp_dialog.dart'; -import 'package:car_provider_app/widgets/show_fill_button.dart'; +import 'package:car_provider_app/widgets/button/show_fill_button.dart'; import 'package:car_provider_app/extensions/string_extensions.dart'; import 'package:car_provider_app/extensions/int_extensions.dart'; import 'package:car_provider_app/extensions/widget_extensions.dart'; @@ -26,6 +26,7 @@ import 'package:car_provider_app/models/user/user.dart'; import 'dart:convert'; import 'package:http/http.dart'; +import '../../classes/colors.dart'; import '../../generated/locale_keys.g.dart'; import '../../models/user/country.dart'; import '../../widgets/dropdown/dropdow_field.dart'; @@ -55,58 +56,77 @@ class _ForgetPasswordPageState extends State { setState(() {}); } - @override Widget build(BuildContext context) { return Scaffold( - appBar: appBar(title: LocaleKeys.changePassword.tr()), + appBar: appBar(context, title: ""), body: Container( width: double.infinity, height: double.infinity, - padding: EdgeInsets.all(40), - child: Column( - children: [ - mFlex(1), - LoginEmailTab( - onSelection: (ClassType type) { - setState(() { - this.type = type; - }); - }, - ), - 50.height, - LocaleKeys.retrievePassword.tr().toText24(), - 12.height, - type == ClassType.NUMBER ? Column(children: [ - getCountry(), - TxtField( - hint: "5********", - value: userName, - onChanged: (v) { - userName = v; - }, - ) - ],) : TxtField( - hint: LocaleKeys.emailAddress.tr(), - value: userName, - onChanged: (v) { - userName = v; - }, - ), - 50.height, - ShowFillButton( - title: LocaleKeys.continu.tr(), - width: double.infinity, - onPressed: () { - if (userName.isNum() && type==ClassType.NUMBER) { - forgetPasswordPhoneOTP(context); - } else if (!userName.isNum() && type==ClassType.EMAIL) { - forgetPasswordEmailOTP(context); - } - }, + padding: EdgeInsets.all(20), + child: SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height, + child: Column( + children: [ + 12.height, + LocaleKeys.forgetPassword.tr().toText20(), + 20.height, + LocaleKeys.retrievePassword.tr().toText14( + color: MyColors.lightTextColor, + textAlign: TextAlign.center, + ), + 30.height, + LoginEmailTab( + onSelection: (ClassType type) { + setState(() { + this.type = type; + }); + }, + ), + 12.height, + type == ClassType.NUMBER + ? Column( + children: [ + getCountry(), + 6.height, + TxtField( + hint: "5********", + value: userName, + onChanged: (v) { + userName = v; + }, + ) + ], + ) + : TxtField( + hint: LocaleKeys.emailAddress.tr(), + value: userName, + onChanged: (v) { + userName = v; + }, + ), + 20.height, + (type == ClassType.NUMBER ? LocaleKeys.retriveOnPhone.tr() : LocaleKeys.retriveOnEmail.tr()).toText14( + color: MyColors.lightTextColor, + textAlign: TextAlign.center, + ), + 30.height, + ShowFillButton( + title: LocaleKeys.send.tr(), + maxWidth: double.infinity, + onPressed: () { + if (userName.isNum() && type == ClassType.NUMBER) { + forgetPasswordPhoneOTP(context); + } else if (!userName.isNum() && type == ClassType.EMAIL) { + forgetPasswordEmailOTP(context); + } + }, + ), + mFlex(10), + ], ), - mFlex(10), - ], + ), ), ), ); @@ -124,7 +144,7 @@ class _ForgetPasswordPageState extends State { element.countryCode ?? "")); }); return Padding( - padding: const EdgeInsets.all(2.0), + padding: const EdgeInsets.all(0.0), child: DropdownField((DropValue value) { countryCode = value.subValue; }, list: dropList, hint: LocaleKeys.chooseCountry.tr()), @@ -138,7 +158,7 @@ class _ForgetPasswordPageState extends State { Future forgetPasswordPhoneOTP(BuildContext context) async { Utils.showLoading(context); - Response response = await UserApiClent().ForgetPasswordOTPRequest(countryCode+userName, otpType); + Response response = await UserApiClent().ForgetPasswordOTPRequest(countryCode + userName, otpType); Utils.hideLoading(context); PasswordOTPRequest otpRequest = PasswordOTPRequest.fromJson(jsonDecode(response.body)); if (otpRequest.messageStatus == 1) { diff --git a/lib/pages/user/login_method_selection_page.dart b/lib/pages/user/login_method_selection_page.dart index c9ab7fc..9098662 100644 --- a/lib/pages/user/login_method_selection_page.dart +++ b/lib/pages/user/login_method_selection_page.dart @@ -33,65 +33,68 @@ class LoginMethodSelectionPage extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( - appBar: appBar(title: LocaleKeys.login.tr()), + appBar: appBar(context, title: LocaleKeys.log_in.tr()), body: Container( width: double.infinity, height: double.infinity, - padding: EdgeInsets.all(40), - child: Column( - children: [ - LocaleKeys.loginSelection.tr().toText24(), - mFlex(2), - Row( - children: [ - Expanded( - child: ShowImageButton( - onClick: () { - performBasicOtp(context); - }, - title: LocaleKeys.fingerPrint.tr(), - icon: icons + "ic_fingerprint.png", + padding: EdgeInsets.all(20), + child: SingleChildScrollView( + child: Column( + children: [ + LocaleKeys.loginSelection.tr().toText20(), + 30.height, + LocaleKeys.welcomeBack.tr().toText20(), + 40.height, + Row( + children: [ + Expanded( + child: ShowImageButton( + onClick: () { + performBasicOtp(context); + }, + title: LocaleKeys.fingerPrint.tr(), + icon: icons + "ic_fingerprint.svg", + ), ), - ), - 20.width, - Expanded( - child: ShowImageButton( - onClick: () { - performBasicOtp(context); - }, - title: LocaleKeys.faceRecognition.tr(), - icon: icons + "ic_face_id.png", + 20.width, + Expanded( + child: ShowImageButton( + onClick: () { + performBasicOtp(context); + }, + title: LocaleKeys.faceRecognition.tr(), + icon: icons + "ic_face.svg", + ), ), - ), - ], - ), - 40.height, - Row( - children: [ - Expanded( - child: ShowImageButton( - onClick: () { - performBasicOtp(context); - }, - title: LocaleKeys.SMS.tr(), - icon: icons + "ic_sms.png", + ], + ), + 40.height, + Row( + children: [ + Expanded( + child: ShowImageButton( + onClick: () { + performBasicOtp(context); + }, + title: LocaleKeys.SMS.tr(), + icon: icons + "ic_sms.svg", + ), ), - ), - 20.width, - Expanded( - child: ShowImageButton( - onClick: () { - // navigateWithName(context, AppRoutes.dashboard); - performBasicOtp(context); - }, - title: LocaleKeys.whatsapp.tr(), - icon: icons + "ic_whatsapp.png", + 20.width, + Expanded( + child: ShowImageButton( + onClick: () { + // navigateWithName(context, AppRoutes.dashboard); + performBasicOtp(context); + }, + title: LocaleKeys.whatsapp.tr(), + icon: icons + "ic_whatsapp.svg", + ), ), - ), - ], - ), - mFlex(10), - ], + ], + ), + ], + ), ), ), ); @@ -119,7 +122,8 @@ class LoginMethodSelectionPage extends StatelessWidget { SharedPrefManager.setUserId(user.data!.userInfo!.userId ?? ""); SharedPrefManager.setRefreshToken(user.data!.refreshToken ?? ""); SharedPrefManager.setData(jsonEncode(user.data!.userInfo!.toJson())); - navigateReplaceWithName(context, AppRoutes.dashboard); + // pop(context); + navigateReplaceWithNameTillLast(context, AppRoutes.dashboard); } else { Utils.showToast("Sorry, Only Provider's can log in this app"); } diff --git a/lib/pages/user/login_verification_page.dart b/lib/pages/user/login_verification_page.dart index abb1d64..3c05ae5 100644 --- a/lib/pages/user/login_verification_page.dart +++ b/lib/pages/user/login_verification_page.dart @@ -88,7 +88,7 @@ class _LoginVerificationPageState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: appBar(title: LocaleKeys.login.tr()), + appBar: appBar(context,title: LocaleKeys.login.tr()), body: Container( width: double.infinity, height: double.infinity, diff --git a/lib/pages/user/login_verify_account_page.dart b/lib/pages/user/login_verify_account_page.dart index b99203a..1f28282 100644 --- a/lib/pages/user/login_verify_account_page.dart +++ b/lib/pages/user/login_verify_account_page.dart @@ -26,7 +26,7 @@ class LoginVerifyAccountPage extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( - appBar: appBar(title: LocaleKeys.login.tr()), + appBar: appBar(context,title: LocaleKeys.login.tr()), body: Container( width: double.infinity, height: double.infinity, @@ -130,7 +130,7 @@ class LoginVerifyAccountPage extends StatelessWidget { title: LocaleKeys.phoneNumberVerified.tr(), onClick: () { pop(context); - navigateWithName(context, AppRoutes.profile1,arguments: user); + navigateWithName(context, AppRoutes.profile1, arguments: user); }, ), ); diff --git a/lib/pages/user/login_with_password_page.dart b/lib/pages/user/login_with_password_page.dart index f12110a..5fb56fa 100644 --- a/lib/pages/user/login_with_password_page.dart +++ b/lib/pages/user/login_with_password_page.dart @@ -18,13 +18,15 @@ import 'package:car_provider_app/widgets/dialog/otp_dialog.dart'; import 'package:car_provider_app/extensions/int_extensions.dart'; import 'package:car_provider_app/extensions/string_extensions.dart'; import 'package:car_provider_app/extensions/widget_extensions.dart'; -import 'package:car_provider_app/widgets/show_fill_button.dart'; +import 'package:car_provider_app/widgets/button/show_fill_button.dart'; import 'package:car_provider_app/widgets/tab/login_email_tab.dart'; import 'package:car_provider_app/widgets/txt_field.dart'; import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:http/http.dart'; +import 'package:sizer/sizer.dart'; +import '../../classes/colors.dart'; import '../../generated/locale_keys.g.dart'; import '../../models/user/country.dart'; import '../../widgets/dropdown/dropdow_field.dart'; @@ -57,65 +59,77 @@ class _LoginWithPasswordState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: appBar(title: LocaleKeys.login.tr()), + appBar: appBar(context, title: ""), body: Container( width: double.infinity, height: double.infinity, - padding: EdgeInsets.all(40), - child: Column( - children: [ - LoginEmailTab( - onSelection: (ClassType type) { - setState(() { - this.type = type; - }); - }, - ), - 50.height, - (type == ClassType.NUMBER ? LocaleKeys.enterPhoneNumber.tr() : LocaleKeys.enterEmail.tr()).toText24(), - mFlex(1), - Column( - children: [ - if (type == ClassType.NUMBER) getCountry(context), - 6.height, - TxtField( - hint: type == ClassType.NUMBER ? LocaleKeys.enterPhoneNumber.tr() : LocaleKeys.enterEmail.tr(), - value: phoneNum, - onChanged: (v) { - phoneNum = v; - }, - ), - 6.height, - TxtField( - hint: LocaleKeys.EnterPass.tr(), - value: password, - isPasswordEnabled: true, - maxLines: 1, - onChanged: (v) { - password = v; - }, - ), - ], - ), - 10.height, - Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - LocaleKeys.forgetPassword.tr().toText12(color: Colors.blue).onPress(() { + padding: EdgeInsets.all(20), + child: SingleChildScrollView( + child: Column( + children: [ + 12.height, + LocaleKeys.log_in.tr().toText20(), + 20.height, + (type == ClassType.NUMBER ? LocaleKeys.enterPhoneNumber.tr() : LocaleKeys.enterEmail.tr()).toText14( + color: MyColors.lightTextColor, + textAlign: TextAlign.center, + ), + 30.height, + LoginEmailTab( + onSelection: (ClassType type) { + setState(() { + this.type = type; + }); + }, + ), + 10.height, + Column( + children: [ + if (type == ClassType.NUMBER) getCountry(context), + 10.height, + TxtField( + hint: type == ClassType.NUMBER ? LocaleKeys.enterPhoneNumber.tr() : LocaleKeys.enterEmail.tr(), + value: phoneNum, + isSidePaddingZero: true, + onChanged: (v) { + phoneNum = v; + }, + ), + 10.height, + TxtField( + hint: LocaleKeys.EnterPass.tr(), + value: password, + isPasswordEnabled: true, + isSidePaddingZero: true, + maxLines: 1, + onChanged: (v) { + password = v; + }, + ), + ], + ), + 10.height, + ShowFillButton( + title: LocaleKeys.forgetPassword.tr(), + isFlatButton: true, + isBold: false, + fontSize: 14, + txtColor: Colors.blue, + onPressed: () { navigateWithName(context, AppRoutes.forgetPassword); - }), - ], - ), - 50.height, - ShowFillButton( - title: LocaleKeys.login.tr(), - width: double.infinity, - onPressed: () { - performBasicOtp(context); - }, - ), - mFlex(10), - ], + }, + ), + 30.height, + ShowFillButton( + title: LocaleKeys.login.tr(), + maxWidth: double.infinity, + onPressed: () { + performBasicOtp(context); + }, + ), + 20.height, + ], + ), ), ), ); @@ -132,19 +146,19 @@ class _LoginWithPasswordState extends State { : (element.countryName ?? "") + " " + (element.countryCode ?? ""), element.countryCode ?? "")); }); - return Padding( - padding: const EdgeInsets.all(2.0), - child: DropdownField( - (DropValue value) { - countryCode = value.subValue; - }, - list: dropList, - hint: LocaleKeys.chooseCountry.tr(), - ), + return DropdownField( + (DropValue value) { + countryCode = value.subValue; + }, + list: dropList, + hint: LocaleKeys.chooseCountry.tr(), ); } else { return Center( - child: CircularProgressIndicator(), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: CircularProgressIndicator(), + ), ); } } diff --git a/lib/pages/user/profile/profile_1_page.dart b/lib/pages/user/profile/profile_1_page.dart index fec7ce4..18e45d5 100644 --- a/lib/pages/user/profile/profile_1_page.dart +++ b/lib/pages/user/profile/profile_1_page.dart @@ -4,7 +4,7 @@ import 'package:car_provider_app/utils/navigator.dart'; import 'package:car_provider_app/widgets/app_bar.dart'; import 'package:car_provider_app/widgets/extensions/int_extensions.dart'; import 'package:car_provider_app/widgets/extensions/string_extensions.dart'; -import 'package:car_provider_app/widgets/show_fill_button.dart'; +import 'package:car_provider_app/widgets/button/show_fill_button.dart'; import 'package:car_provider_app/widgets/txt_field.dart'; import 'package:easy_localization/src/public_ext.dart'; import 'package:flutter/material.dart'; @@ -13,7 +13,7 @@ class Profile1Page extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( - appBar: appBar(title: LocaleKeys.signUp.tr()), + appBar: appBar(context,title: LocaleKeys.signUp.tr()), body: Container( width: double.infinity, height: double.infinity, @@ -57,7 +57,7 @@ class Profile1Page extends StatelessWidget { 16.height, ShowFillButton( title: LocaleKeys.continu.tr(), - width: double.infinity, + maxWidth: double.infinity, onPressed: () { navigateWithName(context, AppRoutes.profile2); }, diff --git a/lib/pages/user/profile/profile_2_page.dart b/lib/pages/user/profile/profile_2_page.dart index 324d449..f51a13e 100644 --- a/lib/pages/user/profile/profile_2_page.dart +++ b/lib/pages/user/profile/profile_2_page.dart @@ -5,7 +5,7 @@ import 'package:car_provider_app/utils/utils.dart'; import 'package:car_provider_app/widgets/app_bar.dart'; import 'package:car_provider_app/widgets/extensions/int_extensions.dart'; import 'package:car_provider_app/widgets/extensions/string_extensions.dart'; -import 'package:car_provider_app/widgets/show_fill_button.dart'; +import 'package:car_provider_app/widgets/button/show_fill_button.dart'; import 'package:car_provider_app/widgets/txt_field.dart'; import 'package:easy_localization/src/public_ext.dart'; import 'package:flutter/material.dart'; @@ -14,7 +14,7 @@ class Profile2Page extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( - appBar: appBar(title: LocaleKeys.signUp.tr()), + appBar: appBar(context,title: LocaleKeys.signUp.tr()), body: Container( width: double.infinity, height: double.infinity, @@ -47,7 +47,7 @@ class Profile2Page extends StatelessWidget { 30.height, ShowFillButton( title: LocaleKeys.save.tr(), - width: double.infinity, + maxWidth: double.infinity, onPressed: () { navigateWithName(context, AppRoutes.profile3); }, diff --git a/lib/pages/user/profile/profile_3_page.dart b/lib/pages/user/profile/profile_3_page.dart index 135528d..7d182aa 100644 --- a/lib/pages/user/profile/profile_3_page.dart +++ b/lib/pages/user/profile/profile_3_page.dart @@ -5,7 +5,7 @@ import 'package:car_provider_app/widgets/dialog/message_dialog.dart'; import 'package:car_provider_app/widgets/dropdown/dropdow_field.dart'; import 'package:car_provider_app/widgets/extensions/int_extensions.dart'; import 'package:car_provider_app/widgets/extensions/string_extensions.dart'; -import 'package:car_provider_app/widgets/show_fill_button.dart'; +import 'package:car_provider_app/widgets/button/show_fill_button.dart'; import 'package:car_provider_app/widgets/txt_field.dart'; import 'package:easy_localization/src/public_ext.dart'; import 'package:flutter/material.dart'; @@ -14,7 +14,7 @@ class Profile3Page extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( - appBar: appBar(title: LocaleKeys.signUp.tr()), + appBar: appBar(context,title: LocaleKeys.signUp.tr()), body: Container( width: double.infinity, height: double.infinity, @@ -46,7 +46,7 @@ class Profile3Page extends StatelessWidget { 50.height, ShowFillButton( title: LocaleKeys.save.tr(), - width: double.infinity, + maxWidth: double.infinity, onPressed: () { showMDialog(context, child: MessageDialog( diff --git a/lib/pages/user/register_page.dart b/lib/pages/user/register_page.dart index 5b37b67..a3801bc 100644 --- a/lib/pages/user/register_page.dart +++ b/lib/pages/user/register_page.dart @@ -13,7 +13,7 @@ import 'package:car_provider_app/widgets/app_bar.dart'; import 'package:car_provider_app/widgets/dialog/dialogs.dart'; import 'package:car_provider_app/widgets/dialog/otp_dialog.dart'; import 'package:car_provider_app/widgets/dropdown/dropdow_field.dart'; -import 'package:car_provider_app/widgets/show_fill_button.dart'; +import 'package:car_provider_app/widgets/button/show_fill_button.dart'; import 'package:car_provider_app/extensions/int_extensions.dart'; import 'package:car_provider_app/extensions/string_extensions.dart'; import 'package:car_provider_app/extensions/widget_extensions.dart'; @@ -21,6 +21,7 @@ import 'package:car_provider_app/widgets/txt_field.dart'; import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; +import '../../classes/colors.dart'; import '../../generated/locale_keys.g.dart'; class RegisterPage extends StatelessWidget { @@ -30,69 +31,96 @@ class RegisterPage extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( - appBar: appBar(title: LocaleKeys.signUp.tr()), + appBar: appBar(context, title: ""), body: Container( width: double.infinity, height: double.infinity, - padding: EdgeInsets.all(40), - child: Column( - children: [ - LocaleKeys.enterPhoneNumber.tr().toText24(), - 12.height, - FutureBuilder( - future: UserApiClent().getRoles(), - builder: (context, snapshot) { - if (snapshot.hasData) { - List dropList = []; - snapshot.data?.data?.forEach((element) { - dropList.add(new DropValue(element.id ?? 0, EasyLocalization.of(context)?.currentLocale?.countryCode == "SA" ? element.roleNameN ?? "" : element.roleName ?? "", "")); - }); - return DropdownField((DropValue value) { - role = value.id; - }, list: dropList, hint: LocaleKeys.selectRole.tr()); - } else { - return CircularProgressIndicator(); - } - }, + padding: EdgeInsets.all(20), + child: SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height, + child: Column( + children: [ + 12.height, + LocaleKeys.signUp.tr().toText20(), + 20.height, + LocaleKeys.enterPhoneNumber.tr().toText14( + color: MyColors.lightTextColor, + textAlign: TextAlign.center, + ), + 30.height, + FutureBuilder( + future: UserApiClent().getRoles(), + builder: (context, snapshot) { + if (snapshot.hasData) { + List dropList = []; + snapshot.data?.data?.forEach((element) { + dropList.add(new DropValue(element.id ?? 0, EasyLocalization.of(context)?.currentLocale?.countryCode == "SA" ? element.roleNameN ?? "" : element.roleName ?? "", "")); + }); + return DropdownField((DropValue value) { + role = value.id; + }, list: dropList, hint: LocaleKeys.selectRole.tr()); + } else { + return CircularProgressIndicator(); + } + }, + ), + 18.height, + FutureBuilder( + future: UserApiClent().getAllCountries(), + builder: (context, snapshot) { + if (snapshot.hasData) { + List dropList = []; + snapshot.data?.data?.forEach((element) { + dropList.add(new DropValue( + element.id ?? 0, + EasyLocalization.of(context)?.currentLocale?.countryCode == "SA" + ? (element.countryNameN ?? "") + " " + (element.countryCode ?? "") + : (element.countryName ?? "") + " " + (element.countryCode ?? ""), + element.countryCode ?? "")); + }); + return Column( + children: [ + LocaleKeys.selectYourCountry.tr().toText14( + color: MyColors.lightTextColor, + textAlign: TextAlign.center, + ), + 10.height, + DropdownField((DropValue value) { + countryCode = value.subValue; + countryId = value.id; + }, list: dropList, hint: LocaleKeys.chooseCountry.tr()), + ], + ); + } else { + return CircularProgressIndicator(); + } + }, + ), + 18.height, + LocaleKeys.enterPhoneForVerfication.tr().toText14( + color: MyColors.lightTextColor, + textAlign: TextAlign.center, + ), + 10.height, + TxtField( + hint: "5********", + value: phoneNum, + onChanged: (v) { + phoneNum = v; + }, + ), + 40.height, + ShowFillButton( + title: LocaleKeys.continu.tr(), + maxWidth: double.infinity, + onPressed: () { + if (validation()) performBasicOtp(context); + }, + ), + ], ), - 12.height, - FutureBuilder( - future: UserApiClent().getAllCountries(), - builder: (context, snapshot) { - if (snapshot.hasData) { - List dropList = []; - snapshot.data?.data?.forEach((element) { - dropList.add(new DropValue( - element.id ?? 0, - EasyLocalization.of(context)?.currentLocale?.countryCode == "SA" - ? (element.countryNameN ?? "") + " " + (element.countryCode ?? "") - : (element.countryName ?? "") + " " + (element.countryCode ?? ""), - element.countryCode ?? "")); - }); - return DropdownField((DropValue value) { - countryCode = value.subValue; - countryId = value.id; - }, list: dropList, hint: LocaleKeys.chooseCountry.tr()); - } else { - return CircularProgressIndicator(); - } - }, - ), - TxtField( - hint: "5********", - onChanged: (v) { - phoneNum = v; - }, - ), - 50.height, - ShowFillButton( - title: LocaleKeys.continu.tr(), - width: double.infinity, - onPressed: () { - if (validation()) performBasicOtp(context); - }, - ), - ], + ), ), ), ); diff --git a/lib/pages/user/register_selection_page.dart b/lib/pages/user/register_selection_page.dart index 81e5222..75682b5 100644 --- a/lib/pages/user/register_selection_page.dart +++ b/lib/pages/user/register_selection_page.dart @@ -1,61 +1,68 @@ +import 'package:car_provider_app/classes/colors.dart'; import 'package:car_provider_app/config/routes.dart'; import 'package:car_provider_app/generated/locale_keys.g.dart'; import 'package:car_provider_app/utils/navigator.dart'; import 'package:car_provider_app/utils/utils.dart'; import 'package:car_provider_app/widgets/app_bar.dart'; -import 'package:car_provider_app/widgets/show_fill_button.dart'; +import 'package:car_provider_app/widgets/button/show_fill_button.dart'; import 'package:car_provider_app/extensions/string_extensions.dart'; import 'package:car_provider_app/extensions/int_extensions.dart'; import 'package:car_provider_app/extensions/widget_extensions.dart'; import 'package:easy_localization/src/public_ext.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; class RegisterSelectionPage extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( - appBar: appBar(title: LocaleKeys.login.tr()), + // appBar: appBar(title: LocaleKeys.login.tr()), body: Container( width: double.infinity, height: double.infinity, - padding: EdgeInsets.all(40), child: Column( children: [ - LocaleKeys.welcomeMessage.tr().toText24(), - mFlex(1), + mFlex(2), + SvgPicture.asset("assets/images/logo.svg"), + mFlex(3), + LocaleKeys.welcomeMessage.tr().toText20(), + LocaleKeys.welcomeDes.tr().toText14(color: MyColors.lightTextColor), + mFlex(4), ShowFillButton( title: LocaleKeys.login.tr(), // title: "Log In With Password", - width: double.infinity, + maxWidth: double.infinity, + horizontalMargin: 20, onPressed: () { navigateWithName(context, AppRoutes.loginWithPassword); }, ), - // 20.height, - // ShowFillButton( - // title: "Log In", - // width: double.infinity, - // onPressed: () { - // navigateWithName(context, AppRoutes.loginVerifyAccount); - // }, - // ), 20.height, ShowFillButton( title: LocaleKeys.signUp.tr(), - width: double.infinity, + maxWidth: double.infinity, + isFlatButton: true, + txtColor: Colors.black, onPressed: () { navigateWithName(context, AppRoutes.register); }, ), - 20.height, + 10.height, ShowFillButton( title: LocaleKeys.forgetPassword.tr(), - width: double.infinity, + maxWidth: double.infinity, + isFlatButton: true, + isBold: false, + txtColor: MyColors.darkPrimaryColor, onPressed: () { navigateWithName(context, AppRoutes.forgetPassword); }, ), mFlex(2), + SvgPicture.asset( + "assets/images/bn_logo.svg", + fit: BoxFit.cover, + ) ], ), ), diff --git a/lib/pages/user/selection_page.dart b/lib/pages/user/selection_page.dart new file mode 100644 index 0000000..aed3e9e --- /dev/null +++ b/lib/pages/user/selection_page.dart @@ -0,0 +1,99 @@ +import 'dart:async'; +import 'dart:convert'; + +import 'package:car_provider_app/classes/colors.dart'; +import 'package:car_provider_app/config/routes.dart'; +import 'package:car_provider_app/extensions/int_extensions.dart'; +import 'package:car_provider_app/extensions/string_extensions.dart'; +import 'package:car_provider_app/generated/locale_keys.g.dart'; +import 'package:car_provider_app/utils/navigator.dart'; +import 'package:car_provider_app/utils/utils.dart'; +import 'package:car_provider_app/extensions/widget_extensions.dart'; +import 'package:easy_localization/easy_localization.dart'; +import 'package:easy_localization/src/public_ext.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; + +import '../../api/client/user_api_client.dart'; +import '../../api/shared_prefrence.dart'; +import '../../classes/app_state.dart'; +import '../../classes/utils.dart'; +import '../../models/user/refresh_token.dart'; +import '../../models/user/user.dart'; + +class SelectionPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Scaffold( + body: Container( + width: double.infinity, + height: double.infinity, + child: Column( + children: [ + mFlex(5), + SvgPicture.asset("assets/images/logo.svg"), + "Logo".toText(fontSize: 45, isBold: true), + mFlex(3), + LocaleKeys.firstTimeLogIn.tr().toText(fontSize: 18, isBold: true).onPress( + () { + navigateWithName(context, AppRoutes.registerSelection); + }, + ), + mFlex(1), + LocaleKeys.alreadySigned.tr().toText(fontSize: 18, isBold: true).onPress( + () async { + String token = await SharedPrefManager.getUserToken(); + String refreshToken = await SharedPrefManager.getRefreshToken(); + if (token.isNotEmpty) { + Utils.showLoading(context); + RefreshToken refresh = await UserApiClent().RefreshTokenAPI(token, refreshToken); + Utils.hideLoading(context); + if (refresh.messageStatus == 1) { + SharedPrefManager.setUserToken(refresh.data!.accessToken ?? ""); + SharedPrefManager.setRefreshToken(refresh.data!.refreshToken ?? ""); + String mdata = await SharedPrefManager.getData(); + print(mdata); + UserInfo info = UserInfo.fromJson(jsonDecode(mdata)); + User user = new User(); + user.data = new UserData(accessToken: refresh.data!.accessToken ?? "", refreshToken: refresh.data!.refreshToken ?? "", userInfo: info); + AppState().setUser = user; + print(AppState().getUser.data?.userInfo?.roleName); + navigateWithName(context, AppRoutes.dashboard); + } else { + String accessToken = await SharedPrefManager.getUserToken(); + String refreshToken = await SharedPrefManager.getRefreshToken(); + String mdata = await SharedPrefManager.getData(); + UserInfo info = UserInfo.fromJson(jsonDecode(mdata)); + User user = new User(); + user.data = new UserData(accessToken: accessToken, refreshToken: refreshToken, userInfo: info); + AppState().setUser = user; + print(AppState().getUser.data?.userInfo?.roleName); + navigateWithName(context, AppRoutes.dashboard); + } + } else { + Utils.showToast(LocaleKeys.login_once.tr()); + } + }, + ), + 35.height, + TextButton( + style: TextButton.styleFrom( + backgroundColor: Colors.white, + ), + onPressed: () { + if (EasyLocalization.of(context)?.currentLocale?.countryCode == "SA") + context.setLocale(const Locale("en", "US")); + else + context.setLocale(const Locale('ar', 'SA')); + }, + child: Text( + LocaleKeys.english.tr(), + ), + ), + mFlex(5), + ], + ), + ), + ); + } +} diff --git a/lib/pages/user/splash_page.dart b/lib/pages/user/splash_page.dart index 1aff79a..87e5ea1 100644 --- a/lib/pages/user/splash_page.dart +++ b/lib/pages/user/splash_page.dart @@ -1,96 +1,36 @@ -import 'dart:async'; -import 'dart:convert'; - -import 'package:car_provider_app/config/routes.dart'; -import 'package:car_provider_app/extensions/int_extensions.dart'; -import 'package:car_provider_app/extensions/string_extensions.dart'; -import 'package:car_provider_app/generated/locale_keys.g.dart'; +import 'package:car_provider_app/classes/colors.dart'; import 'package:car_provider_app/utils/navigator.dart'; import 'package:car_provider_app/utils/utils.dart'; -import 'package:car_provider_app/extensions/widget_extensions.dart'; -import 'package:easy_localization/easy_localization.dart'; -import 'package:easy_localization/src/public_ext.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; -import '../../api/client/user_api_client.dart'; -import '../../api/shared_prefrence.dart'; -import '../../classes/app_state.dart'; -import '../../classes/utils.dart'; -import '../../models/user/refresh_token.dart'; -import '../../models/user/user.dart'; +import '../../config/routes.dart'; class SplashPage extends StatelessWidget { @override Widget build(BuildContext context) { + performTimer(context); return Scaffold( body: Container( width: double.infinity, height: double.infinity, + decoration: MyColors.gradient, child: Column( children: [ - mFlex(5), - "Logo".toText(fontSize: 45, isBold: true), - mFlex(3), - LocaleKeys.firstTimeLogIn.tr().toText(fontSize: 18, isBold: true).onPress( - () { - navigateWithName(context, AppRoutes.registerSelection); - }, - ), - mFlex(1), - LocaleKeys.alreadySigned.tr().toText(fontSize: 18, isBold: true).onPress( - () async { - String token = await SharedPrefManager.getUserToken(); - String refreshToken = await SharedPrefManager.getRefreshToken(); - if(token.isNotEmpty){ - Utils.showLoading(context); - RefreshToken refresh = await UserApiClent().RefreshTokenAPI(token, refreshToken); - Utils.hideLoading(context); - if (refresh.messageStatus == 1) { - SharedPrefManager.setUserToken(refresh.data!.accessToken ?? ""); - SharedPrefManager.setRefreshToken(refresh.data!.refreshToken ?? ""); - String mdata = await SharedPrefManager.getData(); - print(mdata); - UserInfo info = UserInfo.fromJson(jsonDecode(mdata)); - User user = new User(); - user.data = new UserData(accessToken: refresh.data!.accessToken ?? "", refreshToken: refresh.data!.refreshToken ?? "", userInfo: info); - AppState().setUser = user; - print(AppState().getUser.data?.userInfo?.roleName); - navigateWithName(context, AppRoutes.dashboard); - } else { - String accessToken = await SharedPrefManager.getUserToken(); - String refreshToken = await SharedPrefManager.getRefreshToken(); - String mdata = await SharedPrefManager.getData(); - UserInfo info = UserInfo.fromJson(jsonDecode(mdata)); - User user = new User(); - user.data = new UserData(accessToken: accessToken, refreshToken: refreshToken, userInfo: info); - AppState().setUser = user; - print(AppState().getUser.data?.userInfo?.roleName); - navigateWithName(context, AppRoutes.dashboard); - } - }else{ - Utils.showToast(LocaleKeys.login_once.tr()); - } - }, - ), - 35.height, - TextButton( - style: TextButton.styleFrom( - backgroundColor: Colors.white, - ), - onPressed: () { - if (EasyLocalization.of(context)?.currentLocale?.countryCode == "SA") - context.setLocale(const Locale("en", "US")); - else - context.setLocale(const Locale('ar', 'SA')); - }, - child: Text( - LocaleKeys.english.tr(), - ), + mExp(1), + Expanded( + child: SvgPicture.asset("assets/images/splash_logo.svg"), ), - mFlex(5), + mExp(1), ], ), ), ); } + + performTimer(BuildContext context) { + delay(3).whenComplete(() { + navigateReplaceWithName(context, AppRoutes.registerSelection); + }); + } } diff --git a/lib/pages/user/vertify_password_page.dart b/lib/pages/user/vertify_password_page.dart index 9f72965..edd7b2a 100644 --- a/lib/pages/user/vertify_password_page.dart +++ b/lib/pages/user/vertify_password_page.dart @@ -33,7 +33,7 @@ class VerifyPasswordPage extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( - appBar: appBar(title: LocaleKeys.changePassword.tr()), + appBar: appBar(context,title: LocaleKeys.changePassword.tr()), body: Container( width: double.infinity, height: double.infinity, diff --git a/lib/theme/app_theme.dart b/lib/theme/app_theme.dart index cd246a3..f316a20 100644 --- a/lib/theme/app_theme.dart +++ b/lib/theme/app_theme.dart @@ -4,6 +4,7 @@ import 'colors.dart'; class AppTheme { static getTheme(isArabic) => ThemeData( + fontFamily: isArabic ? 'Cairo' : 'Poppins', // This is the theme of your application. // // Try running your application with "flutter run". You'll see the @@ -14,8 +15,9 @@ class AppTheme { // Notice that the counter didn't reset back to zero; the application // is not restarted. primaryColor: primaryColor, - primarySwatch: Colors.blue, + primarySwatch: Colors.orange, backgroundColor: Colors.white, + scaffoldBackgroundColor: Colors.white, primaryTextTheme: TextTheme( headline6: TextStyle(color: Colors.white), ), diff --git a/lib/utils/location/Location.dart b/lib/utils/location/Location.dart new file mode 100644 index 0000000..47e9ec6 --- /dev/null +++ b/lib/utils/location/Location.dart @@ -0,0 +1,249 @@ +import 'dart:async'; +import 'dart:math'; +import 'dart:ui'; + +import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; +import 'package:geolocator/geolocator.dart'; + +import 'package:google_maps_flutter/google_maps_flutter.dart'; + +import '../../classes/app_permissions.dart'; +import '../../classes/utils.dart'; + +// import 'package:geodesy/geodesy.dart' as geodesy; + +//Created By Mr.Zohaib +class Location { + static _Map map = _Map(); + + static void havePermission(Function(bool) callback) { + Geolocator.checkPermission().then((value) async { + if (value == LocationPermission.denied) { + value = await Geolocator.requestPermission(); + callback(![LocationPermission.denied, LocationPermission.deniedForever].contains(value)); + } else { + callback(true); + } + }); + } + + static void isEnabled(Function(bool) callback) { + Geolocator.isLocationServiceEnabled().then((value) => callback(value)); + } + + static bool _listeningSettingChange = true; + + static void listenGPS({bool change = true, Function(bool)? onChange}) async { + _listeningSettingChange = change; + if (change == false) return; + + Future.doWhile(() async { + await Utils.delay(1000); + var enable = await Geolocator.isLocationServiceEnabled(); + onChange!(enable); + return _listeningSettingChange; + }); + } + + static void getCurrentLocation(Function(LatLng?) callback) { + void done(Position position) { + //AppStorage.sp.saveLocation(position); + + LatLng? myCurrentLocation = LatLng(position.latitude, position.longitude); + callback(myCurrentLocation); + } + + AppPermissions.location((granted) { + if (granted) { + Geolocator.getLastKnownPosition(forceAndroidLocationManager: true).then((value) { + if (value == null) { + Geolocator.getCurrentPosition().then((value) { + done(value); + }); + } else { + done(value); + } + }); + } + }); + } + + // static LatLng locationAwayFrom( + // {required LatLng loc1, num distanceMeters = 200.0, num bearing = 270.0}) { + // geodesy.LatLng l1 = geodesy.LatLng(loc1.latitude, loc1.longitude); + // geodesy.LatLng destinationPoint = geodesy.Geodesy() + // .destinationPointByDistanceAndBearing(l1, distanceMeters, bearing); + // return LatLng(destinationPoint.latitude, destinationPoint.longitude); + // } + + static Future distanceTo(LatLng destination) async { + var myLoc = await Geolocator.getLastKnownPosition(); + var distance = 0.0; + if (myLoc != null) { + distance = Geolocator.distanceBetween(destination.latitude, destination.longitude, myLoc.latitude, myLoc.longitude); + } + return distance; + } +} + +class _Map { + Marker createMarker( + String id, { + required LatLng coordinates, + BitmapDescriptor? icon, + VoidCallback? onTap, + }) { + final MarkerId markerId = MarkerId(id); + return Marker( + icon: icon ?? BitmapDescriptor.defaultMarker, + markerId: markerId, + position: coordinates, + flat: false, + // infoWindow: InfoWindow(title: id, snippet: '*'), + onTap: onTap, + ); + } + + CameraPosition initialCamera({required Completer mapController, LatLng? position, double zoom = 12}) { + position = position ?? LatLng(24.7249303, 46.5416656); + CameraPosition riyadhEye = CameraPosition( + target: position, + zoom: zoom, + ); + mapController.future.then((controller) { + controller.animateCamera(CameraUpdate.newCameraPosition(riyadhEye)); + }); + return riyadhEye; + } + + CameraPosition moveTo(LatLng location, {double zoom = 12, double direction = 0.0, required Completer mapController, bool? animation}) { + var camera = CameraPosition(target: location, zoom: zoom, bearing: direction); + mapController.future.then((controller) { + animation ?? false ? controller.animateCamera(CameraUpdate.newCameraPosition(camera)) : controller.moveCamera(CameraUpdate.newCameraPosition(camera)); + }); + return camera; + } + + void moveCamera(CameraPosition camera, @required Completer mapController, bool animation) { + mapController.future.then((controller) { + animation ? controller.animateCamera(CameraUpdate.newCameraPosition(camera)) : controller.moveCamera(CameraUpdate.newCameraPosition(camera)); + }); + } + + void scrollBy({double x = 0, double y = 0, required Completer mapController, bool animation = true}) { + var camera = CameraUpdate.scrollBy(x, y); + mapController.future.then((controller) { + animation ? controller.animateCamera(camera) : controller.moveCamera(camera); + }); + } + + void goToCurrentLocation({Completer? mapController, double? direction = 0.0, bool? animation}) { + Location.getCurrentLocation((location) { + moveTo(location!, zoom: 17, mapController: mapController!, animation: animation, direction: direction!); + }); + } + + // var routes = Map(); + // + // void setRoutePolylines(LatLng? source, LatLng? destination, Set polylines, Completer mapController, Function(DirectionsRoute?) completion) { + // if (source == null || destination == null) { + // completion(null); + // return; + // } + // + // var origin = '${source.latitude},${source.longitude}'; + // var destin = '${destination.latitude},${destination.longitude}'; + // var routeId = '$origin->$destination'; + // + // void createPolyline(DirectionsRoute results) { + // List polylineCoordinates = results.overviewPath!.map((e) => LatLng(e.latitude, e.longitude)).toList(); + // PolylineId id = PolylineId("route"); + // Polyline polyline = Polyline( + // polylineId: id, + // color: accentColor, + // width: 5, + // jointType: JointType.round, + // startCap: Cap.roundCap, + // endCap: Cap.roundCap, + // points: polylineCoordinates, + // ); + // + // polylines.removeWhere((element) => true); + // polylines.add(polyline); + // + // LatLngBounds bound = getBounds(coordinates: polylineCoordinates); + // focusCameraToLatLngBounds(bound: bound, mapController: mapController, padding: 100); + // completion(routes[routeId]); + // } + // + // var availableRoute = routes[routeId]; + // if (availableRoute == null) { + // var request = DirectionsRequest(origin: origin, destination: destin); + // DirectionsService().route(request, (response, status) { + // if (status == DirectionsStatus.ok && response.routes!.isNotEmpty) { + // routes[routeId] = response.routes!.first; + // createPolyline(response.routes!.first); + // } + // }); + // } else { + // createPolyline(availableRoute); + // } + // } + + LatLngBounds getBounds({required List coordinates}) { + var lngs = coordinates.map((c) => c.longitude).toList(); + var lats = coordinates.map((c) => c.latitude).toList(); + + double bottomMost = lngs.reduce(min); + double topMost = lngs.reduce(max); + double leftMost = lats.reduce(min); + double rightMost = lats.reduce(max); + + LatLngBounds bounds = LatLngBounds( + northeast: LatLng(rightMost, topMost), + southwest: LatLng(leftMost, bottomMost), + ); + return bounds; + + double? x0, x1, y0, y1; + for (LatLng latLng in coordinates) { + if (x0 == null) { + x0 = x1 = latLng.latitude; + y0 = y1 = latLng.longitude; + } else { + if (latLng.latitude > x1!) x1 = latLng.latitude; + if (latLng.latitude < x0) x0 = latLng.latitude; + if (latLng.longitude > y1!) y1 = latLng.longitude; + if (latLng.longitude < y0!) y0 = latLng.longitude; + } + } + return LatLngBounds(northeast: LatLng(x1!, y1!), southwest: LatLng(x0!, y0!)); + } + + void focusCameraToLatLngBounds({LatLngBounds? bound, Completer? mapController, double? padding}) async { + if (bound == null) return; + + CameraUpdate camera = CameraUpdate.newLatLngBounds(bound, padding!); + final GoogleMapController controller = await mapController!.future; + controller.animateCamera(camera); + } + + void focusCameraTo2Points({LatLng? point1, LatLng? point2, Completer? mapController, double? padding}) async { + var source = point1; + var destination = point2; + if (source != null && destination != null) { + // 'package:google_maps_flutter_platform_interface/src/types/location.dart': Failed assertion: line 72 pos 16: 'southwest.latitude <= northeast.latitude': is not true. + LatLngBounds bound; + if (source.latitude <= destination.latitude) { + bound = LatLngBounds(southwest: source, northeast: destination); + } else { + bound = LatLngBounds(southwest: destination, northeast: source); + } + + if (bound == null) return; + + focusCameraToLatLngBounds(bound: bound, mapController: mapController, padding: padding); + } + } +} diff --git a/lib/utils/navigator.dart b/lib/utils/navigator.dart index d2f6f41..bac84ab 100644 --- a/lib/utils/navigator.dart +++ b/lib/utils/navigator.dart @@ -8,6 +8,11 @@ navigateReplaceWithName(BuildContext context, String routeName, {Object? argumen Navigator.pushReplacementNamed(context, routeName, arguments: arguments); } +navigateReplaceWithNameTillLast(BuildContext context, String routeName, {Object? arguments}) { + Navigator.of(context) + .pushNamedAndRemoveUntil(routeName, (Route route) => false,arguments: arguments); +} + pop(BuildContext context) { Navigator.of(context).pop(); } diff --git a/lib/utils/utils.dart b/lib/utils/utils.dart index 0f50532..1235dab 100644 --- a/lib/utils/utils.dart +++ b/lib/utils/utils.dart @@ -40,8 +40,8 @@ String checkFileExt(String path) { return parts[1]??"png"; // '.dart' } -Future delay(int millis) async { - return await Future.delayed(Duration(milliseconds: millis)); +Future delay(int seconds) async { + return await Future.delayed(Duration(seconds: seconds)); } inkWellCorner({double? r}) { diff --git a/lib/widgets/app_bar.dart b/lib/widgets/app_bar.dart index c588699..3074c1e 100644 --- a/lib/widgets/app_bar.dart +++ b/lib/widgets/app_bar.dart @@ -4,7 +4,8 @@ import 'package:car_provider_app/extensions/int_extensions.dart'; import 'package:flutter/material.dart'; import 'package:sizer/sizer.dart'; -AppBar appBar({ +AppBar appBar( + BuildContext context, { Color? backgroundColor, double? elevation, String? title, @@ -12,15 +13,22 @@ AppBar appBar({ bool? isTitleCenter, Color? backIconColor, List? actions, + bool isRemoveBackButton = false, }) { return AppBar( backgroundColor: backgroundColor ?? appBackgroundColor, elevation: elevation ?? 0, centerTitle: isTitleCenter ?? true, + leading: isRemoveBackButton + ? null + : IconButton( + icon: Icon(Icons.arrow_back_ios, color: Colors.black), + onPressed: () => Navigator.of(context).pop(), + ), iconTheme: IconThemeData( color: backIconColor ?? Colors.black, //change your color here ), actions: actions, - title: (title ?? "").toText(fontSize: 20,isBold: true), + title: (title ?? "").toText(fontSize: 20, isBold: true), ); } diff --git a/lib/widgets/button/show_fill_button.dart b/lib/widgets/button/show_fill_button.dart new file mode 100644 index 0000000..7ea5db2 --- /dev/null +++ b/lib/widgets/button/show_fill_button.dart @@ -0,0 +1,69 @@ +import 'package:car_provider_app/extensions/string_extensions.dart'; +import 'package:car_provider_app/theme/colors.dart'; +import 'package:flutter/material.dart'; + +import '../../classes/colors.dart'; + +class ShowFillButton extends StatelessWidget { + String title; + VoidCallback onPressed; + Color txtColor; + double elevation, radius, maxWidth, maxHeight, fontSize, horizontalPadding, horizontalMargin, verticalMargin; + bool isFlatButton, isBold; + + ShowFillButton({ + required this.title, + required this.onPressed, + this.txtColor = Colors.white, + this.elevation = 4, + this.radius = 8, + this.maxWidth = 88, + this.maxHeight = 45, + this.fontSize = 16, + this.horizontalPadding = 16, + this.isFlatButton = false, + this.isBold = true, + this.horizontalMargin = 0, + this.verticalMargin = 0, + }); + + @override + Widget build(BuildContext context) { + return isFlatButton + ? Container( + child: showButton(), + height: 30, + padding: const EdgeInsets.only( + left: 20, + right: 20, + ), + ) + : ConstrainedBox( + constraints: BoxConstraints( + minHeight: maxHeight, + minWidth: maxWidth, + maxHeight: maxHeight, + maxWidth: maxWidth, + ), + child: showButton(), + ); + } + + Widget showButton() { + return Container( + decoration: isFlatButton ? null : MyColors.gradientButton, + margin: EdgeInsets.symmetric(horizontal: horizontalMargin, vertical: verticalMargin), + child: MaterialButton( + onPressed: onPressed, + shape: new RoundedRectangleBorder( + borderRadius: new BorderRadius.circular(radius), + ), + child: title.toText( + fontSize: fontSize, + isBold: isBold, + color: txtColor, + ), + ), + ); + } +} diff --git a/lib/widgets/button/show_image_button.dart b/lib/widgets/button/show_image_button.dart index b283900..565292f 100644 --- a/lib/widgets/button/show_image_button.dart +++ b/lib/widgets/button/show_image_button.dart @@ -1,16 +1,16 @@ +import 'package:car_provider_app/classes/colors.dart'; import 'package:car_provider_app/theme/colors.dart'; import 'package:car_provider_app/utils/utils.dart'; import 'package:flutter/material.dart'; import 'package:car_provider_app/extensions/string_extensions.dart'; import 'package:car_provider_app/extensions/int_extensions.dart'; - +import 'package:flutter_svg/flutter_svg.dart'; class ShowImageButton extends StatelessWidget { String icon, title; VoidCallback onClick; - ShowImageButton( - {required this.icon, required this.title, required this.onClick}); + ShowImageButton({required this.icon, required this.title, required this.onClick}); @override Widget build(BuildContext context) { @@ -23,15 +23,23 @@ class ShowImageButton extends StatelessWidget { Container( width: double.infinity, height: 120, - color: accentColor, - padding: EdgeInsets.all(30), - child: Image.asset( - icon, - color: Colors.white, + child: Card( + color: MyColors.darkPrimaryColor, + shape: RoundedRectangleBorder( + side: BorderSide(color: Colors.transparent, width: 1), + borderRadius: BorderRadius.circular(8), + ), + child: Padding( + padding: EdgeInsets.all(26), + child: SvgPicture.asset( + icon, + color: Colors.white, + ), + ), ), ), - 12.height, - title.toText(color: Colors.blue,isBold: true,fontSize: 18), + 6.height, + title.toText(color: Colors.black, isBold: true, fontSize: 16), ], ), ), diff --git a/lib/widgets/dialog/message_dialog.dart b/lib/widgets/dialog/message_dialog.dart index 0bb6ff0..615464c 100644 --- a/lib/widgets/dialog/message_dialog.dart +++ b/lib/widgets/dialog/message_dialog.dart @@ -1,7 +1,7 @@ import 'package:car_provider_app/theme/colors.dart'; import 'package:car_provider_app/utils/navigator.dart'; import 'package:car_provider_app/utils/utils.dart'; -import 'package:car_provider_app/widgets/show_fill_button.dart'; +import 'package:car_provider_app/widgets/button/show_fill_button.dart'; import 'package:car_provider_app/extensions/int_extensions.dart'; import 'package:car_provider_app/extensions/string_extensions.dart'; import 'package:flutter/material.dart'; @@ -25,7 +25,7 @@ class MessageDialog extends StatelessWidget { 40.height, ShowFillButton( title: buttonTitle ?? "Continue", - width: double.infinity, + maxWidth: double.infinity, onPressed: () { onClick!(); }, diff --git a/lib/widgets/dialog/otp_dialog.dart b/lib/widgets/dialog/otp_dialog.dart index a5ccc63..d5c2f39 100644 --- a/lib/widgets/dialog/otp_dialog.dart +++ b/lib/widgets/dialog/otp_dialog.dart @@ -2,7 +2,7 @@ import 'package:car_provider_app/classes/colors.dart'; import 'package:car_provider_app/theme/colors.dart'; import 'package:car_provider_app/utils/navigator.dart'; import 'package:car_provider_app/utils/utils.dart'; -import 'package:car_provider_app/widgets/show_fill_button.dart'; +import 'package:car_provider_app/widgets/button/show_fill_button.dart'; import 'package:car_provider_app/extensions/string_extensions.dart'; import 'package:car_provider_app/extensions/int_extensions.dart'; import 'package:easy_localization/easy_localization.dart'; @@ -142,7 +142,7 @@ class _OtpDialogState extends State { 40.height, ShowFillButton( title: LocaleKeys.check_code.tr(), - width: double.infinity, + maxWidth: double.infinity, onPressed: () { widget.onClick(code); }, diff --git a/lib/widgets/dropdown/dropdow_field.dart b/lib/widgets/dropdown/dropdow_field.dart index 4ab9775..8d0c7fd 100644 --- a/lib/widgets/dropdown/dropdow_field.dart +++ b/lib/widgets/dropdown/dropdow_field.dart @@ -1,3 +1,4 @@ +import 'package:car_provider_app/classes/colors.dart'; import 'package:car_provider_app/theme/colors.dart'; import 'package:car_provider_app/utils/utils.dart'; import 'package:car_provider_app/widgets/extensions/string_extensions.dart'; @@ -42,22 +43,22 @@ class _DropdownFieldState extends State { Widget build(BuildContext context) { return Container( decoration: containerColorRadiusBorderWidth( - Colors.transparent, - 4, - borderColor, - 0.5, + MyColors.textFieldColor, + 8, + MyColors.textFieldColor, + 0, ), - margin: EdgeInsets.all(2), + margin: EdgeInsets.all(0), padding: EdgeInsets.only(left: 8, right: 8), child: DropdownButton( - value: dropdownValue, + value: dropdownValue??null, icon: const Icon(Icons.keyboard_arrow_down_sharp), elevation: 16, iconSize: 16, iconEnabledColor: borderColor, iconDisabledColor: borderColor, isExpanded: true, - style: const TextStyle(color: Colors.black), + style: const TextStyle(color: Colors.black, fontWeight: FontWeight.w600), hint: (widget.hint ?? "").toText12(color: borderColor), underline: Container( height: 0, diff --git a/lib/widgets/show_card_buttton.dart b/lib/widgets/show_card_buttton.dart index 6fd2255..b7b5bdc 100644 --- a/lib/widgets/show_card_buttton.dart +++ b/lib/widgets/show_card_buttton.dart @@ -1,5 +1,5 @@ import 'package:car_provider_app/theme/colors.dart'; -import 'package:car_provider_app/widgets/show_fill_button.dart'; +import 'package:car_provider_app/widgets/button/show_fill_button.dart'; import 'package:flutter/material.dart'; class ShowCardButton extends StatelessWidget { diff --git a/lib/widgets/show_fill_button.dart b/lib/widgets/show_fill_button.dart deleted file mode 100644 index 32908be..0000000 --- a/lib/widgets/show_fill_button.dart +++ /dev/null @@ -1,41 +0,0 @@ -import 'package:car_provider_app/extensions/string_extensions.dart'; -import 'package:car_provider_app/theme/colors.dart'; - -import 'package:flutter/material.dart'; - -class ShowFillButton extends StatelessWidget { - String title; - VoidCallback onPressed; - Color txtColor; - double elevation, radius, width,height, fontSize, horizontalPadding; - - ShowFillButton({ - required this.title, - required this.onPressed, - this.txtColor = Colors.white, - this.elevation = 4, - this.radius = 6, - this.width = 88, - this.height=45, - this.fontSize = 16, - this.horizontalPadding = 16, - }); - - @override - Widget build(BuildContext context) { - return ElevatedButton( - style: ElevatedButton.styleFrom( - onPrimary: Colors.black87, - primary: accentColor, - minimumSize: Size(width, height), - padding: EdgeInsets.symmetric(horizontal: horizontalPadding), - elevation: elevation, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.all(Radius.circular(radius)), - ), - ), - onPressed: onPressed, - child: title.toUpperCase().toText(fontSize: fontSize, isBold: true), - ); - } -} diff --git a/lib/widgets/tab/login_email_tab.dart b/lib/widgets/tab/login_email_tab.dart index b27c758..7b7c3aa 100644 --- a/lib/widgets/tab/login_email_tab.dart +++ b/lib/widgets/tab/login_email_tab.dart @@ -1,6 +1,7 @@ import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; +import '../../classes/colors.dart'; import '../../generated/locale_keys.g.dart'; enum ClassType { EMAIL, NUMBER } @@ -32,13 +33,16 @@ class _LoginEmailTabState extends State { child: Container( width: double.infinity, height: 45, - color: type == ClassType.NUMBER ? Colors.blue : Colors.transparent, + decoration: BoxDecoration( + color: Colors.transparent, + border: Border.all(color: type == ClassType.NUMBER ? MyColors.darkPrimaryColor : Colors.transparent, width: 2), + borderRadius: BorderRadius.all(Radius.circular(8)), + ), child: Center( child: Text( LocaleKeys.number.tr(), style: TextStyle( - color: type == ClassType.NUMBER ? Colors.white : Colors.black, - fontWeight: FontWeight.bold, + color: Colors.black, ), ), ), @@ -54,15 +58,19 @@ class _LoginEmailTabState extends State { child: Container( width: double.infinity, height: 45, - color: type == ClassType.EMAIL ? Colors.blue : Colors.transparent, + decoration: BoxDecoration( + color: Colors.transparent, + border: Border.all(color: type == ClassType.EMAIL ? MyColors.darkPrimaryColor : Colors.transparent, width: 2), + borderRadius: BorderRadius.all(Radius.circular(8)), + ), child: Center( - child: Text( - LocaleKeys.email.tr(), - style: TextStyle( - color: type == ClassType.EMAIL ? Colors.white : Colors.black, - fontWeight: FontWeight.bold, + child: Text( + LocaleKeys.email.tr(), + style: TextStyle( + color: Colors.black, + ), ), - )), + ), ), ), ), diff --git a/lib/widgets/txt_field.dart b/lib/widgets/txt_field.dart index 814103a..06df51a 100644 --- a/lib/widgets/txt_field.dart +++ b/lib/widgets/txt_field.dart @@ -5,6 +5,8 @@ import 'package:car_provider_app/extensions/string_extensions.dart'; import 'package:flutter/material.dart'; import 'package:sizer/sizer.dart'; +import '../classes/colors.dart'; + class TxtField extends StatelessWidget { TextEditingController controller = new TextEditingController(); String? value; @@ -25,7 +27,6 @@ class TxtField extends StatelessWidget { Function(String)? onChanged; TextInputType? keyboardType; - TxtField({ this.value, this.lable, @@ -39,8 +40,8 @@ class TxtField extends StatelessWidget { this.isButtonEnable = false, this.buttonTitle, this.maxLines, - this.isSidePaddingZero=false, - this.isNeedBorder=true, + this.isSidePaddingZero = false, + this.isNeedBorder = true, this.onChanged, this.isPasswordEnabled, this.keyboardType, @@ -60,9 +61,11 @@ class TxtField extends StatelessWidget { child: Row( children: [ Expanded( - child: Card( - elevation: elevation, - margin: isSidePaddingZero?EdgeInsets.zero:null, + child: Container( + decoration: BoxDecoration( + color: MyColors.textFieldColor, + borderRadius: BorderRadius.all(Radius.circular(8)), + ), child: TextField( keyboardType: keyboardType, autofocus: false, @@ -70,23 +73,23 @@ class TxtField extends StatelessWidget { enabled: isNeedClickAll == true ? false : true, maxLines: maxLines, onTap: () {}, - obscureText: isPasswordEnabled??false, + obscureText: isPasswordEnabled ?? false, onChanged: onChanged, decoration: InputDecoration( labelText: lable, alignLabelWithHint: true, fillColor: Colors.white, focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: accentColor, width:isNeedBorder? 1.0:0), - borderRadius: BorderRadius.circular(4.0), + borderSide: BorderSide(color: MyColors.darkPrimaryColor, width: isNeedBorder ? 1.0 : 0), + borderRadius: BorderRadius.circular(8.0), ), enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: borderColor, width:isNeedBorder? 1.0:0), - borderRadius: BorderRadius.circular(4.0), + borderSide: BorderSide(color: MyColors.textFieldColor, width: isNeedBorder ? 1.0 : 0), + borderRadius: BorderRadius.circular(8.0), ), disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: borderColor, width:isNeedBorder? 1.0:0), - borderRadius: BorderRadius.circular(4.0), + borderSide: BorderSide(color: MyColors.textFieldColor, width: isNeedBorder ? 1.0 : 0), + borderRadius: BorderRadius.circular(8.0), ), prefixIcon: prefixData != null ? Icon( diff --git a/pubspec.lock b/pubspec.lock deleted file mode 100644 index c2b3b93..0000000 --- a/pubspec.lock +++ /dev/null @@ -1,626 +0,0 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: - args: - dependency: transitive - description: - name: args - url: "https://pub.dartlang.org" - source: hosted - version: "2.3.0" - async: - dependency: transitive - description: - name: async - url: "https://pub.dartlang.org" - source: hosted - version: "2.8.2" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - characters: - dependency: transitive - description: - name: characters - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.1" - clock: - dependency: transitive - description: - name: clock - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - collection: - dependency: transitive - description: - name: collection - url: "https://pub.dartlang.org" - source: hosted - version: "1.15.0" - cross_file: - dependency: transitive - description: - name: cross_file - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.2" - crypto: - dependency: transitive - description: - name: crypto - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.1" - cupertino_icons: - dependency: "direct main" - description: - name: cupertino_icons - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.4" - easy_localization: - dependency: "direct main" - description: - name: easy_localization - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.0" - easy_logger: - dependency: transitive - description: - name: easy_logger - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.2" - fake_async: - dependency: transitive - description: - name: fake_async - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - ffi: - dependency: transitive - description: - name: ffi - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.2" - file: - dependency: transitive - description: - name: file - url: "https://pub.dartlang.org" - source: hosted - version: "6.1.2" - file_picker: - dependency: "direct main" - description: - name: file_picker - url: "https://pub.dartlang.org" - source: hosted - version: "4.4.0" - flutter: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_lints: - dependency: "direct dev" - description: - name: flutter_lints - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.4" - flutter_localizations: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" - flutter_plugin_android_lifecycle: - dependency: transitive - description: - name: flutter_plugin_android_lifecycle - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.5" - flutter_svg: - dependency: "direct main" - description: - name: flutter_svg - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.3" - flutter_test: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" - flutter_web_plugins: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" - fluttertoast: - dependency: "direct main" - description: - name: fluttertoast - url: "https://pub.dartlang.org" - source: hosted - version: "8.0.8" - geocoding: - dependency: "direct main" - description: - name: geocoding - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.2" - geocoding_platform_interface: - dependency: transitive - description: - name: geocoding_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" - geolocator: - dependency: "direct main" - description: - name: geolocator - url: "https://pub.dartlang.org" - source: hosted - version: "8.2.0" - geolocator_android: - dependency: transitive - description: - name: geolocator_android - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.0" - geolocator_apple: - dependency: transitive - description: - name: geolocator_apple - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.1+1" - geolocator_platform_interface: - dependency: transitive - description: - name: geolocator_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "4.0.3" - geolocator_web: - dependency: transitive - description: - name: geolocator_web - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.4" - geolocator_windows: - dependency: transitive - description: - name: geolocator_windows - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.0" - google_maps_flutter: - dependency: "direct main" - description: - name: google_maps_flutter - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.1" - google_maps_flutter_platform_interface: - dependency: transitive - description: - name: google_maps_flutter_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.3" - http: - dependency: "direct main" - description: - name: http - url: "https://pub.dartlang.org" - source: hosted - version: "0.13.4" - http_parser: - dependency: transitive - description: - name: http_parser - url: "https://pub.dartlang.org" - source: hosted - version: "4.0.0" - image_picker: - dependency: "direct main" - description: - name: image_picker - url: "https://pub.dartlang.org" - source: hosted - version: "0.8.4+11" - image_picker_for_web: - dependency: transitive - description: - name: image_picker_for_web - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.6" - image_picker_platform_interface: - dependency: transitive - description: - name: image_picker_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.4.4" - injector: - dependency: "direct main" - description: - name: injector - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - intl: - dependency: transitive - description: - name: intl - url: "https://pub.dartlang.org" - source: hosted - version: "0.17.0" - js: - dependency: transitive - description: - name: js - url: "https://pub.dartlang.org" - source: hosted - version: "0.6.3" - lints: - dependency: transitive - description: - name: lints - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.1" - matcher: - dependency: transitive - description: - name: matcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.11" - material_color_utilities: - dependency: transitive - description: - name: material_color_utilities - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.3" - meta: - dependency: transitive - description: - name: meta - url: "https://pub.dartlang.org" - source: hosted - version: "1.7.0" - nested: - dependency: transitive - description: - name: nested - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0" - path: - dependency: transitive - description: - name: path - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.0" - path_drawing: - dependency: transitive - description: - name: path_drawing - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0" - path_parsing: - dependency: transitive - description: - name: path_parsing - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0" - path_provider: - dependency: "direct main" - description: - name: path_provider - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.7" - path_provider_android: - dependency: transitive - description: - name: path_provider_android - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.9" - path_provider_ios: - dependency: transitive - description: - name: path_provider_ios - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.7" - path_provider_linux: - dependency: transitive - description: - name: path_provider_linux - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.2" - path_provider_macos: - dependency: transitive - description: - name: path_provider_macos - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.4" - path_provider_platform_interface: - dependency: transitive - description: - name: path_provider_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" - path_provider_windows: - dependency: transitive - description: - name: path_provider_windows - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.4" - permission_handler: - dependency: "direct main" - description: - name: permission_handler - url: "https://pub.dartlang.org" - source: hosted - version: "9.2.0" - permission_handler_android: - dependency: transitive - description: - name: permission_handler_android - url: "https://pub.dartlang.org" - source: hosted - version: "9.0.2" - permission_handler_apple: - dependency: transitive - description: - name: permission_handler_apple - url: "https://pub.dartlang.org" - source: hosted - version: "9.0.2" - permission_handler_platform_interface: - dependency: transitive - description: - name: permission_handler_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "3.7.0" - permission_handler_windows: - dependency: transitive - description: - name: permission_handler_windows - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.0" - petitparser: - dependency: transitive - description: - name: petitparser - url: "https://pub.dartlang.org" - source: hosted - version: "4.4.0" - platform: - dependency: transitive - description: - name: platform - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.0" - plugin_platform_interface: - dependency: transitive - description: - name: plugin_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.2" - process: - dependency: transitive - description: - name: process - url: "https://pub.dartlang.org" - source: hosted - version: "4.2.4" - provider: - dependency: "direct main" - description: - name: provider - url: "https://pub.dartlang.org" - source: hosted - version: "6.0.1" - shared_preferences: - dependency: "direct main" - description: - name: shared_preferences - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.9" - shared_preferences_android: - dependency: transitive - description: - name: shared_preferences_android - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.9" - shared_preferences_ios: - dependency: transitive - description: - name: shared_preferences_ios - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.8" - shared_preferences_linux: - dependency: transitive - description: - name: shared_preferences_linux - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.3" - shared_preferences_macos: - dependency: transitive - description: - name: shared_preferences_macos - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.2" - shared_preferences_platform_interface: - dependency: transitive - description: - name: shared_preferences_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - shared_preferences_web: - dependency: transitive - description: - name: shared_preferences_web - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.2" - shared_preferences_windows: - dependency: transitive - description: - name: shared_preferences_windows - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.3" - sizer: - dependency: "direct main" - description: - name: sizer - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.15" - sky_engine: - dependency: transitive - description: flutter - source: sdk - version: "0.0.99" - source_span: - dependency: transitive - description: - name: source_span - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.1" - stack_trace: - dependency: transitive - description: - name: stack_trace - url: "https://pub.dartlang.org" - source: hosted - version: "1.10.0" - stream_channel: - dependency: transitive - description: - name: stream_channel - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - stream_transform: - dependency: transitive - description: - name: stream_transform - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - string_scanner: - dependency: transitive - description: - name: string_scanner - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - term_glyph: - dependency: transitive - description: - name: term_glyph - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - test_api: - dependency: transitive - description: - name: test_api - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.8" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" - universal_io: - dependency: transitive - description: - name: universal_io - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.4" - vector_math: - dependency: transitive - description: - name: vector_math - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.1" - win32: - dependency: transitive - description: - name: win32 - url: "https://pub.dartlang.org" - source: hosted - version: "2.3.1" - xdg_directories: - dependency: transitive - description: - name: xdg_directories - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0" - xml: - dependency: transitive - description: - name: xml - url: "https://pub.dartlang.org" - source: hosted - version: "5.3.1" -sdks: - dart: ">=2.15.0 <3.0.0" - flutter: ">=2.8.0" diff --git a/pubspec.yaml b/pubspec.yaml index 36194f0..917c86f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -39,20 +39,21 @@ dependencies: provider: ^6.0.0 easy_localization: ^3.0.0 http: ^0.13.3 - permission_handler: ^9.2.0 + permission_handler: any flutter_svg: ^1.0.3 sizer: ^2.0.15 fluttertoast: ^8.0.8 shared_preferences: ^2.0.6 file_picker: ^4.4.0 image_picker: ^0.8.4+4 + equatable: ^2.0.3 # google google_maps_flutter: ^2.1.1 geolocator: any - geocoding: ^2.0.2 + geocoding: any @@ -85,23 +86,21 @@ flutter: - assets/ - assets/icons/ - assets/images/ - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/assets-and-images/#resolution-aware. - - # For details regarding adding assets from package dependencies, see - # https://flutter.dev/assets-and-images/#from-packages - - # To add custom fonts to your application, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/assets-and-images/#resolution-aware. + + # For details regarding adding assets from package dependencies, see + # https://flutter.dev/assets-and-images/#from-packages + + # To add custom fonts to your application, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + fonts: + - family: Poppins + fonts: + - asset: assets/fonts/Poppins-Medium.ttf # - family: Trajan Pro # fonts: # - asset: fonts/TrajanPro.ttf diff --git a/resources/langs/ar-SA.json b/resources/langs/ar-SA.json index 589e7fa..06c0c75 100644 --- a/resources/langs/ar-SA.json +++ b/resources/langs/ar-SA.json @@ -7,7 +7,7 @@ "defineLicences": "تحديد الرخص", "dealershipSettings": "اعدادات البيع", "changePassword": "تغيير كلمة المرور", - "retrievePassword" : "استرجاع كلمة المرور", + "retrievePassword": "استرجاع كلمة المرور", "changeEmail": "تغيير الايميل", "verify": "تحقق", "verified": "تم التحقق", @@ -33,73 +33,84 @@ "editAccount": "تعديل الحساب", "change": "تغيير", "verifyAccount": "التحقق من الحساب", - "login" : "تسجيل دخول", - "welcomeMessage" : "مرحبا", + "login": "تسجيل دخول", + "log_in": "Log In", + "welcomeMessage": "مرحبا", + "welcomeDes": "You one stop place all your car needs", "forgetPass": "نسيت كلمة المرور ؟", "enterPhoneNumber": "رقم جوال ", "phoneNumberVerified": "تم التحقق من الجوال", "verifyNewPassword": "التحقق من كلمة المرور", "EnterPass": "ادخل كلمة المرور", + "send": "Send", + "retrivePassword": "Retrive password by one of following method", + "retriveOnPhone": "We will send the opt to your registered mobile number", + "retriveOnEmail": "We will send the opt to your registered email address", + "enterPhoneForVerfication": "Please enter your phone number We will send you the verification code", + "selectYourCountry": "Select Your Country", + "welcomeBack": "Welcome Back!!!", "alreadySigned": " تم تسجيل الدخول", "emailChangedSuccessfully": "تم تغيير الايميل بنجاح", - "passwordIsUpdated" : "تم تحجيث كلمة المرور", - "passwordShouldContains" : "كلمة المرور يجب ان تحتوي على رمز رقم حرف كبير حرف صغير", + "passwordIsUpdated": "تم تحجيث كلمة المرور", + "passwordShouldContains": "كلمة المرور يجب ان تحتوي على رمز رقم حرف كبير حرف صغير", " successfullyRegistered": "تم التسجيل بنجاح", - "pleaseEnterSamePassword" : "ادخل كلمة مرور مطابقه", - "firstNameMandatory" : "ادخل الأسم الأول ", - "surnameNameMandatory" : "ادخل اسم العائله", - "passwordNameMandatory" : "ادخل كلمة المرور", - "enterValidEmail" : "ادخل ايميل صحيح", - "pleaseAcceptTerms" : "يجب الموافقه على الشروط", - "emailVerified" : "تم التحقق من الايميل بنجاح", - "selectMethod" : "اختر", - "emailAddress" : "ايميل", - "loginSelection" : "اختر", - "selectCountryCode" : "اختر رمز الدوله", - "selectProviderRole" : "اختر نوع الخدمه", - "addPhoneNo" : "اضف الهاتف", + "pleaseEnterSamePassword": "ادخل كلمة مرور مطابقه", + "firstNameMandatory": "ادخل الأسم الأول ", + "surnameNameMandatory": "ادخل اسم العائله", + "passwordNameMandatory": "ادخل كلمة المرور", + "enterValidEmail": "ادخل ايميل صحيح", + "pleaseAcceptTerms": "يجب الموافقه على الشروط", + "emailVerified": "تم التحقق من الايميل بنجاح", + "selectMethod": "اختر", + "emailAddress": "ايميل", + "loginSelection": "اختر", + "selectCountryCode": "اختر رمز الدوله", + "selectProviderRole": "اختر نوع الخدمه", + "addPhoneNo": "اضف الهاتف", "onlyProviderApp": "نأسف هذا التطبيق فقط لمقدمي الخدمات", - "imageUploaded" : "تم تحميل الصوره", - "fileLarger" : "1KB حجم الملف اكبر من", - "account" : "الحساب", - "edit" : "تعديل", - "imageDeleted" : "تم حذف الصوره", - "dashboard" : "الصفحه الرئيسيه", - "pickAddress" : "اختر العنوان", - "pickLocation" : "اختر الموقع", - "save" : "حفظ", - "defineServices" : "تحديد الخدمات", - "selectBranch " : "اختر الفرع", - "selectServiceCategory" : "اختر فئة الخدمة", - "defineBranches" : "تحديد الفروع", - "defineProviders":"تحديد الموفرين", + "imageUploaded": "تم تحميل الصوره", + "fileLarger": "1KB حجم الملف اكبر من", + "account": "الحساب", + "edit": "تعديل", + "imageDeleted": "تم حذف الصوره", + "dashboard": "الصفحه الرئيسيه", + "pickAddress": "اختر العنوان", + "pickLocation": "اختر الموقع", + "save": "حفظ", + "defineServices": "تحديد الخدمات", + "selectBranch ": "اختر الفرع", + "selectServiceCategory": "اختر فئة الخدمة", + "defineBranches": "تحديد الفروع", + "defineProviders": "تحديد الموفرين", "closeAccount": "اغلاق الحساب", - "createBranch" : "انشاء فرع", - "updateBranch" : "فرع التحديث", + "createBranch": "انشاء فرع", + "updateBranch": "فرع التحديث", "address": "العنوان", "branchDescription": "وصف الفرع", "branchName": "اسم الفرع", "chooseCity": "اختر المدينه", "chooseCountry": "اختر الدوله", - "selectAttachment":"اختيار مرفق", - "somethingWrong" : "هناك خطأ ما", - "documentsUploaded" : "تم ارفاق الملف بنجاح", + "selectAttachment": "اختيار مرفق", + "somethingWrong": "هناك خطأ ما", + "documentsUploaded": "تم ارفاق الملف بنجاح", "update": "تحديث", - "termsOfService":"من خلال إنشاء حساب فإنك توافق على شروط الخدمة و\n سياسة الخصوصية", + "termsOfService": "من خلال إنشاء حساب فإنك توافق على", + "terms": "بنود الخدمة وخصوصية السياسة", + "profileMsg": "أدخل التفاصيل أدناه وأكمل معلومات الملف الشخصي", "branchInfo": "معلومات الفرع و الخدمات", "profileCompleted": "الملف الشخصي مكتمل", "selectLocationMap": "اختر الموقع", - "licensesAndCertifications" : "الرخص و الشهادات", - "completeProfile1" : "اكمل الملف الشخصي 1/3", - "completeProfile2" : "اكمل الملف الشخصي 2/3", - "completeProfile3" : "اكمل الملف الشخصي 3/3", + "licensesAndCertifications": "الرخص و الشهادات", + "completeProfile1": "اكمل الملف الشخصي 1/3", + "completeProfile2": "اكمل الملف الشخصي 2/3", + "completeProfile3": "اكمل الملف الشخصي 3/3", "userInformation": "معلومات المتسخدم", "faceRecognition": "تحقق مع بصمة الوجه", - "fingerPrint" : "تحقق مع بصمة الاصبع", + "fingerPrint": "تحقق مع بصمة الاصبع", "whatsapp": "تحقق مع Whatsapp", "SMS": "رسائل قصيره", - "selectRole" : "حدد الدور", - "userRoleOrTitle" : "عنوان المستخدم", + "selectRole": "حدد الدور", + "userRoleOrTitle": "عنوان المستخدم", "codeSentToEmail": "تم ارسال الرمز للايميل", "number": "موبايل", "english": "English", @@ -140,17 +151,23 @@ } }, "reset_locale": "Reset Language", - "insert_otp_code" : "الرجاء إدخال رمز OTP", - "resend_code" : "أعد إرسال الرمز", - "check_code" : "التحقق من الشفرة", - "time_will_expire" : "سينتهي الوقت في", - "no_city_available" : "لا توجد مدينة متاحة لهذا البلد", - "branch_created" : "تم إنشاء الفرع بنجاح", - "branch_updated" : "تم تحديث الفرع بنجاح", - "branch_deleted" : "تم حذف الفرع بنجاح", - "dashboard_main" : "لوحة القيادة / الصفحة الرئيسية", - "logo_brand" : "الشعار / العلامة التجارية", + "insert_otp_code": "الرجاء إدخال رمز OTP", + "resend_code": "أعد إرسال الرمز", + "check_code": "التحقق من الشفرة", + "time_will_expire": "سينتهي الوقت في", + "no_city_available": "لا توجد مدينة متاحة لهذا البلد", + "branch_created": "تم إنشاء الفرع بنجاح", + "branch_updated": "تم تحديث الفرع بنجاح", + "branch_deleted": "تم حذف الفرع بنجاح", + "dashboard_main": "لوحة القيادة / الصفحة الرئيسية", + "logo_brand": "الشعار / العلامة التجارية", "remove": "إزالة", "no_branch": "لم يتم إضافة فرع حتى الآن", - "login_once": "الرجاء تسجيل الدخول مرة واحدة" + "login_once": "الرجاء تسجيل الدخول مرة واحدة", + "defineLicenese": "Upload Licenses and Certificates", + "description": "Description", + "attachFile": "Attach File", + "branchLocation": "Branch info and Location", + "tapToEdit": "Tap to edit", + "myServiceBranches": "My Service Branches" } diff --git a/resources/langs/en-US.json b/resources/langs/en-US.json index 4512be7..7434e10 100644 --- a/resources/langs/en-US.json +++ b/resources/langs/en-US.json @@ -1,5 +1,5 @@ { - "firstTimeLogIn" : "First Time Log In", + "firstTimeLogIn": "First Time Log In", "signUp": "Sign Up", "changeMobile": "Change Mobile", "notifications": "Notifications", @@ -7,12 +7,12 @@ "defineLicences": "Define Licences", "dealershipSettings": "Dealership Settings", "changePassword": "Change Password", - "retrievePassword" : "Retrieve Password", + "retrievePassword": "Retrieve Password", "changeEmail": "Change Email", "verify": "Verify", "verified": "Verified", "signOut": "Sign Out", - "enterEmail": "Enter Email", + "enterEmail": "Enter Email and Password", "enterNewEmail": "Enter New Email", "enterNewPassword": "Enter New Password", "enterCurrentPassword": "Enter Current Password", @@ -34,73 +34,84 @@ "editAccount": "Edit Account", "change": "Change", "verifyAccount": "Verify Account", - "login" : "Log In", - "welcomeMessage" : "Welcome Message", + "login": "Login", + "log_in": "Log In", + "welcomeMessage": "Welcome To Mowater", + "welcomeDes": "You one stop place all your car needs", "forgetPass": "Forget Password ?", "phoneNumberVerified": "Phone Number Verified", "verifyNewPassword": "Verify New Password", + "send": "Send", "EnterPass": "Enter Password ?", + "retrivePassword": "Retrive password by one of following method", + "retriveOnPhone": "We will send the opt to your registered mobile number", + "retriveOnEmail": "We will send the opt to your registered email address", + "enterPhoneForVerfication": "Please enter your phone number We will send you the verification code", + "selectYourCountry": "Select Your Country", + "welcomeBack": "Welcome Back!!!", "alreadySigned": " Already Signed Up and Logged In", "emailChangedSuccessfully": "Email is Changed Successfully", - "passwordIsUpdated" : "Password is Updated", - "passwordShouldContains" : "Password Should contains Character, Number, Capital and small letters,", + "passwordIsUpdated": "Password is Updated", + "passwordShouldContains": "Password Should contains Character, Number, Capital and small letters,", " successfullyRegistered": " Successfully Registered, Please login once,", - "pleaseEnterSamePassword" : "Please enter same password", - "firstNameMandatory" : "First name is mandatory", - "surnameNameMandatory" : "Surname is mandatory", - "passwordNameMandatory" : "Password is mandatory", - "enterValidEmail" : "Enter Valid Email", - "pleaseAcceptTerms" : "Please accept terms", - "emailVerified" : "Email is verified successfully", - "selectMethod" : "Select Method", - "emailAddress" : "Email Address", - "loginSelection" : "Login Selection", - "selectCountryCode" : "Please select Country Code", - "selectProviderRole" : "Please select Provider Role", - "addPhoneNo" : "Please add Phone No", + "pleaseEnterSamePassword": "Please enter same password", + "firstNameMandatory": "First name is mandatory", + "surnameNameMandatory": "Surname is mandatory", + "passwordNameMandatory": "Password is mandatory", + "enterValidEmail": "Enter Valid Email", + "pleaseAcceptTerms": "Please accept terms", + "emailVerified": "Email is verified successfully", + "selectMethod": "Select Method", + "emailAddress": "Email Address", + "loginSelection": "Login Selection", + "selectCountryCode": "Please select Country Code", + "selectProviderRole": "Please select Provider Role", + "addPhoneNo": "Please add Phone No", "onlyCustomerApp": "Sorry, Only Customer's can log in this app", - "imageUploaded" : "Image is uploaded", - "fileLarger" : "File is larger then 1KB", - "account" : "Account", - "edit" : "EDIT", - "imageDeleted" : "Image is Deleted", - "dashboard" : "Dashboard/Main Page", - "pickAddress" : "Pick Address", - "pickLocation" : "Pick Location", - "save" : "Save", - "defineServices" : "Define Services", - "selectBranch " : "Select Branch ", - "selectServiceCategory" : "Select Service Category", - "defineBranches" : "Define Branches", - "defineProviders":"Define Providers", + "imageUploaded": "Image is uploaded", + "fileLarger": "File is larger then 1KB", + "account": "Account", + "edit": "EDIT", + "imageDeleted": "Image is Deleted", + "dashboard": "Dashboard/Main Page", + "pickAddress": "Pick Address", + "pickLocation": "Pick Location", + "save": "Save", + "defineServices": "Define Services", + "selectBranch ": "Select Branch ", + "selectServiceCategory": "Select Service Category", + "defineBranches": "Define Branches", + "defineProviders": "Define Providers", "closeAccount": "Close Account", - "createBranch" : "Create Branch", - "updateBranch" : "Update Branch", + "createBranch": "Create Branch", + "updateBranch": "Update Branch", "address": "Address", "branchDescription": "Branch Description", "branchName": "Branch Name", "chooseCity": "Select City", - "chooseCountry": "Select Country", - "selectAttachment":"Select Attachment", - "somethingWrong" : "Something went wrong", - "documentsUploaded" : "Documents uploaded successfully", + "chooseCountry": "Choose Country", + "selectAttachment": "Select Attachment", + "somethingWrong": "Something went wrong", + "documentsUploaded": "Documents uploaded successfully", "update": "Update", - "termsOfService":"By creating an account you agree to our Terms of Service and\n Privacy Policy", + "termsOfService": "By creating an account you agree to our", + "terms": "Terms of Service and Privacy Policy", + "profileMsg": "Enter the details below and complete the profile info", "branchInfo": "Branch Info and Services", "profileCompleted": "Profile is Completed", "selectLocationMap": "Select Location Map", - "licensesAndCertifications" : "licenses & certifications", - "completeProfile1" : "Complete Profile 1/3", - "completeProfile2" : "Complete Profile 2/3", - "completeProfile3" : "Complete Profile 3/3", + "licensesAndCertifications": "licenses & certifications", + "completeProfile1": "Complete Profile 1/3", + "completeProfile2": "Complete Profile 2/3", + "completeProfile3": "Complete Profile 3/3", "userInformation": "User Information", "provider": "Provider", "faceRecognition": "Face Recognition", - "fingerPrint" : "Finger Print", + "fingerPrint": "Finger Print", "whatsapp": "With Whatsapp", "SMS": "With SMS", - "selectRole" : "Select Role", - "userRoleOrTitle" : "User role or title", + "selectRole": "Choose Role", + "userRoleOrTitle": "User role or title", "codeSentToEmail": "Code is sent to email", "number": "Number", "english": "عربي", @@ -140,17 +151,23 @@ } }, "reset_locale": "Reset Language", - "insert_otp_code" : "Please insert OTP Code", - "resend_code" : "Resend Code", - "check_code" : "Check Code", - "time_will_expire" : "Time will Expire in", - "no_city_available" : "No City Available for this country", - "branch_created" : "Branch is successfully created", - "branch_updated" : "Branch is successfully Updated", - "branch_deleted" : "Branch is successfully Deleted", - "dashboard_main" : "Dashboard/Main Page", - "logo_brand" : "Logo/Brand", + "insert_otp_code": "Please insert OTP Code", + "resend_code": "Resend Code", + "check_code": "Check Code", + "time_will_expire": "Time will Expire in", + "no_city_available": "No City Available for this country", + "branch_created": "Branch is successfully created", + "branch_updated": "Branch is successfully Updated", + "branch_deleted": "Branch is successfully Deleted", + "dashboard_main": "Dashboard/Main Page", + "logo_brand": "Logo/Brand", "remove": "Remove", "no_branch": "No Branch Added Yet", - "login_once": "Please login once" + "login_once": "Please login once", + "defineLicenese": "Upload Licenses and Certificates", + "description": "Description", + "attachFile": "Attach File", + "branchLocation": "Branch info and Location", + "tapToEdit": "Tap to edit", + "myServiceBranches": "My Service Branches" }