Merge branch 'master' into fatima
# Conflicts: # lib/api/user_api_client.dart # lib/classes/consts.dart # lib/config/routes.dart # lib/models/user/change_email.dart # lib/models/user/change_mobile.dart # lib/models/user/change_password.dart # lib/models/user/confirm_email.dart # lib/models/user/confirm_mobile.dart # lib/pages/dashboard/dashboard_page.dart # lib/pages/user/change_email_page.dart # lib/pages/user/change_mobile_page.dart # lib/pages/user/change_password_page.dart # lib/pages/user/complete_profile_page.dart # lib/pages/user/confirm_new_password.dart # lib/pages/user/edit_account_page.dart # lib/pages/user/forget_password_method_page.dart # lib/pages/user/forget_password_page.dart # lib/pages/user/login_with_password_page.dart # pubspec.lockfatima
|
After Width: | Height: | Size: 43 KiB |
@ -0,0 +1,11 @@
|
||||
<svg id="Group_761" data-name="Group 761" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="21.545" height="22.965" viewBox="0 0 21.545 22.965">
|
||||
<defs>
|
||||
<clipPath id="clip-path">
|
||||
<rect id="Rectangle_1484" data-name="Rectangle 1484" width="21.545" height="22.965" fill="#2699fb"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
<g id="Group_761-2" data-name="Group 761" clip-path="url(#clip-path)">
|
||||
<path id="Path_663" data-name="Path 663" d="M21.3,136.849l-1.91-.49-.881.734c0-.049-1.812-4.7-1.714-4.407a1.879,1.879,0,0,0-1.567-1.175,53.565,53.565,0,0,0-8.863,0A1.857,1.857,0,0,0,4.8,132.687c0,.049-1.812,4.7-1.714,4.407l-.881-.734-1.91.49a.42.42,0,0,0-.294.343v.441a.573.573,0,0,0,.392.539l1.861.783-.245.343a2.372,2.372,0,0,0-.343,1.273v5.876a1.547,1.547,0,0,0,1.567,1.567H4.456a1.547,1.547,0,0,0,1.567-1.567v-.832h9.646v.832a1.578,1.578,0,0,0,1.567,1.567H18.46a1.547,1.547,0,0,0,1.567-1.567V140.57a2.908,2.908,0,0,0-.343-1.273l-.294-.343,1.763-.734a.573.573,0,0,0,.392-.539v-.441A.388.388,0,0,0,21.3,136.849Zm-15.718,4.6-.734,1.518a.3.3,0,0,1-.294.2H2.938a.335.335,0,0,1-.343-.343V141.3a.335.335,0,0,1,.343-.343h2.3a.345.345,0,0,1,.343.49m-1.763-3.428,1.273-3.33c.588-.049,1.567-.147,3.183-.2a61.5,61.5,0,0,1,8.226.2l1.273,3.33h-.686a2.88,2.88,0,0,0-5.68,0Zm8.667,0a1.9,1.9,0,0,1,1.861-1.42,1.939,1.939,0,0,1,1.861,1.42ZM14,143.557H7.737a.579.579,0,0,1-.539-.832l.783-1.812a.6.6,0,0,1,.539-.343h4.75a.6.6,0,0,1,.539.343l.783,1.812a.623.623,0,0,1-.588.832m5.043-.734a.335.335,0,0,1-.343.343H17.138a.331.331,0,0,1-.294-.2l-.734-1.518a.337.337,0,0,1,.294-.49h2.3a.335.335,0,0,1,.343.343Z" transform="translate(0 -125.048)" fill="#2699fb"/>
|
||||
<path id="Path_664" data-name="Path 664" d="M123.925,3.085a1.986,1.986,0,0,1,2.008,2.008h3.134V4.7a.477.477,0,0,0-.392-.49l-.93-.147a5.837,5.837,0,0,0-.392-.979l.539-.734a.4.4,0,0,0-.049-.588l-.539-.588a.519.519,0,0,0-.637-.049l-.734.539a2.428,2.428,0,0,0-.979-.392l-.147-.881a.477.477,0,0,0-.49-.392h-.783a.527.527,0,0,0-.49.392l-.147.881a5.836,5.836,0,0,0-.979.392l-.734-.539a.518.518,0,0,0-.637.049l-.539.588a.513.513,0,0,0-.049.637l.539.686a2.428,2.428,0,0,0-.392.979l-.93.147a.477.477,0,0,0-.392.49v.392h3.134A2.017,2.017,0,0,1,123.925,3.085Z" transform="translate(-113.104)" fill="#2699fb"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 480 B |
@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="13.412" height="17.882" viewBox="0 0 13.412 17.882">
|
||||
<path id="Path_665" data-name="Path 665" d="M11.735,7.265V5.029a5.029,5.029,0,0,0-10.059,0V7.265A1.647,1.647,0,0,0,0,8.941v7.265a1.681,1.681,0,0,0,1.676,1.676H11.735a1.681,1.681,0,0,0,1.676-1.676V8.941a1.646,1.646,0,0,0-1.676-1.676M2.794,5.029a3.912,3.912,0,0,1,7.823,0V7.265H2.794ZM7.265,13.3v1.229a.559.559,0,1,1-1.118,0V13.3a1.628,1.628,0,0,1-1.118-1.565,1.676,1.676,0,0,1,3.353,0A1.628,1.628,0,0,1,7.265,13.3" fill="#2699fb"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 540 B |
@ -0,0 +1,11 @@
|
||||
<svg id="Group_773" data-name="Group 773" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="19.6" height="16" viewBox="0 0 19.6 16">
|
||||
<defs>
|
||||
<clipPath id="clip-path">
|
||||
<rect id="Rectangle_1471" data-name="Rectangle 1471" width="19.6" height="16" fill="#2699fb"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
<g id="Group_18" data-name="Group 18" clip-path="url(#clip-path)">
|
||||
<path id="Path_649" data-name="Path 649" d="M8,14.8a.325.325,0,0,1-.025-.169c.008-.046-.021-.083-.087-.112s-.1-.052-.1-.069-.048-.029-.144-.037L7.5,14.4H3.6a1.925,1.925,0,0,1-1.413-.588A1.926,1.926,0,0,1,1.6,12.4V3.6a1.926,1.926,0,0,1,.587-1.412A1.926,1.926,0,0,1,3.6,1.6h4a.378.378,0,0,0,.256-.081.415.415,0,0,0,.125-.244A2.1,2.1,0,0,0,8.019.981,3.11,3.11,0,0,0,8.012.65Q8,.45,8,.4A.385.385,0,0,0,7.881.119.385.385,0,0,0,7.6,0h-4A3.468,3.468,0,0,0,1.056,1.056,3.467,3.467,0,0,0,0,3.6v8.8a3.467,3.467,0,0,0,1.056,2.544A3.467,3.467,0,0,0,3.6,16h4a.379.379,0,0,0,.256-.081.415.415,0,0,0,.125-.244,2.108,2.108,0,0,0,.038-.294,3.107,3.107,0,0,0-.006-.331Q8,14.85,8,14.8" fill="#2699fb"/>
|
||||
<path id="Path_650" data-name="Path 650" d="M124.2,16.169l-6.8-6.8a.8.8,0,0,0-1.363.563v3.6h-5.6a.811.811,0,0,0-.8.8v4.8a.811.811,0,0,0,.8.8h5.6v3.6a.8.8,0,0,0,1.363.562l6.8-6.8a.785.785,0,0,0,0-1.125" transform="translate(-104.833 -8.731)" fill="#2699fb"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
@ -0,0 +1,10 @@
|
||||
<svg id="Group_775" data-name="Group 775" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="13" height="23.853" viewBox="0 0 13 23.853">
|
||||
<defs>
|
||||
<clipPath id="clip-path">
|
||||
<rect id="Rectangle_1493" data-name="Rectangle 1493" width="13" height="23.853" fill="#2699fb"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
<g id="Group_774" data-name="Group 774" clip-path="url(#clip-path)">
|
||||
<path id="Path_689" data-name="Path 689" d="M11.306,0H1.67A1.675,1.675,0,0,0,0,1.67V22.183a1.675,1.675,0,0,0,1.67,1.67H11.33A1.675,1.675,0,0,0,13,22.183V1.67A1.7,1.7,0,0,0,11.306,0M6.488,1.312a.477.477,0,1,1-.477.477.479.479,0,0,1,.477-.477M7.919,22.541H5.057v-.954H7.919Zm4.1-2.29H.93V3.6H12.022Z" fill="#2699fb"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 745 B |
@ -0,0 +1,12 @@
|
||||
<svg id="Group_766" data-name="Group 766" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="15" height="16.406" viewBox="0 0 15 16.406">
|
||||
<defs>
|
||||
<clipPath id="clip-path">
|
||||
<rect id="Rectangle_1486" data-name="Rectangle 1486" width="15" height="16.406" fill="#2699fb"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
<g id="Group_765" data-name="Group 765" clip-path="url(#clip-path)">
|
||||
<path id="Path_666" data-name="Path 666" d="M2.813,6.094H13.125V.937A.938.938,0,0,0,12.187,0H.937A.937.937,0,0,0,0,.937V15a.937.937,0,0,0,.937.937H8.906V12.656H2.813a.469.469,0,0,1,0-.938H8.325a3.924,3.924,0,0,1-.356-1.641V9.844H2.813a.469.469,0,0,1,0-.938h5.33A4.013,4.013,0,0,1,9.375,7.031H2.813a.469.469,0,1,1,0-.938m0-3.75H6.094a.469.469,0,0,1,0,.937H2.813a.469.469,0,1,1,0-.937" fill="#2699fb"/>
|
||||
<path id="Path_667" data-name="Path 667" d="M205.714,160a3.047,3.047,0,1,1-3.047,3.047A3.047,3.047,0,0,1,205.714,160" transform="translate(-193.761 -152.969)" fill="#2699fb"/>
|
||||
<path id="Path_668" data-name="Path 668" d="M228.219,306.24a3.98,3.98,0,0,1-4.219,0v2.948l2.109-.937,2.109.938Z" transform="translate(-214.156 -292.782)" fill="#2699fb"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
@ -0,0 +1,4 @@
|
||||
<svg id="Notifications" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
||||
<rect id="Rectangle_479" data-name="Rectangle 479" width="16" height="16" fill="none"/>
|
||||
<path id="Path_1" data-name="Path 1" d="M15,14H10a2,2,0,0,1-4,0H1a.961.961,0,0,1-.9-.7,1.068,1.068,0,0,1,.3-1.1A4.026,4.026,0,0,0,2,9V6A6,6,0,0,1,14,6V9a4.026,4.026,0,0,0,1.6,3.2.947.947,0,0,1,.3,1.1A.961.961,0,0,1,15,14Z" transform="translate(-0.063)" fill="#2699fb"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 472 B |
|
After Width: | Height: | Size: 675 B |
@ -0,0 +1,69 @@
|
||||
import 'dart:async';
|
||||
import 'package:car_customer_app/classes/app_state.dart';
|
||||
import 'package:car_customer_app/models/m_response.dart';
|
||||
import 'package:car_customer_app/models/profile/branch.dart';
|
||||
import 'package:car_customer_app/models/profile/categroy.dart';
|
||||
import 'package:car_customer_app/models/profile/document.dart';
|
||||
import 'package:car_customer_app/models/profile/services.dart';
|
||||
import 'package:car_customer_app/models/user/country.dart';
|
||||
import 'package:car_customer_app/models/user/role.dart';
|
||||
import 'package:http/http.dart';
|
||||
import 'package:car_customer_app/classes/consts.dart';
|
||||
import 'package:car_customer_app/models/content_info_model.dart';
|
||||
import 'package:car_customer_app/models/member_model.dart';
|
||||
import 'package:car_customer_app/models/surah_model.dart';
|
||||
import 'package:car_customer_app/models/user/basic_otp.dart';
|
||||
import 'package:car_customer_app/models/user/register_user.dart';
|
||||
|
||||
import '../api_client.dart';
|
||||
|
||||
class BranchApiClent {
|
||||
static final BranchApiClent _instance = BranchApiClent._internal();
|
||||
|
||||
BranchApiClent._internal();
|
||||
|
||||
factory BranchApiClent() => _instance;
|
||||
|
||||
Future<MResponse> createBranch(String branchName, String branchDescription, String cityId, String address, String latitude, String longitude) async {
|
||||
var postParams = {
|
||||
// "id": 0,
|
||||
"serviceProviderID": AppState().getUser.data?.userInfo?.providerId ?? "",
|
||||
"branchName": branchName,
|
||||
"branchDescription": branchDescription,
|
||||
"cityID": cityId,
|
||||
"address": address,
|
||||
"latitude": latitude,
|
||||
"longitude": longitude,
|
||||
"isActive": true
|
||||
};
|
||||
String t = AppState().getUser.data!.accessToken ?? "";
|
||||
print("tokeen " + t);
|
||||
return await ApiClient().postJsonForObject((json) => MResponse.fromJson(json), ApiConsts.createProviderBranch, postParams, token: t);
|
||||
}
|
||||
|
||||
Future<Branch> fetchAllBranches() async {
|
||||
var postParams = {"ServiceProviderID": AppState().getUser.data?.userInfo?.providerId.toString() ?? ""};
|
||||
String t = AppState().getUser.data!.accessToken ?? "";
|
||||
print("tokeen " + t);
|
||||
return await ApiClient().getJsonForObject((json) => Branch.fromJson(json), ApiConsts.ServiceProviderBranchGet, queryParameters: postParams, token: t);
|
||||
}
|
||||
|
||||
Future<Category> fetchBranchCategory() async {
|
||||
var postParams = {"ServiceProviderID": AppState().getUser.data?.userInfo?.providerId.toString() ?? ""};
|
||||
String t = AppState().getUser.data!.accessToken ?? "";
|
||||
print("tokeen " + t);
|
||||
return await ApiClient().getJsonForObject((json) => Category.fromJson(json), ApiConsts.ServiceCategory_Get, queryParameters: postParams, token: t);
|
||||
}
|
||||
|
||||
Future<Services> fetchServices(String serviceCategoryId) async {
|
||||
var postParams = {"ServiceCategoryID": serviceCategoryId};
|
||||
String t = AppState().getUser.data!.accessToken ?? "";
|
||||
print("tokeen " + t);
|
||||
return await ApiClient().getJsonForObject((json) => Services.fromJson(json), ApiConsts.Services_Get, queryParameters: postParams, token: t);
|
||||
}
|
||||
|
||||
Future<MResponse> createService(List<Map<String, dynamic>> map) async {
|
||||
String t = AppState().getUser.data!.accessToken ?? "";
|
||||
return await ApiClient().postJsonForObject((json) => MResponse.fromJson(json), ApiConsts.ServiceProviderService_Create, map, token: t);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,52 @@
|
||||
import 'dart:async';
|
||||
import 'package:car_customer_app/classes/app_state.dart';
|
||||
import 'package:car_customer_app/models/m_response.dart';
|
||||
import 'package:car_customer_app/models/profile/document.dart';
|
||||
import 'package:car_customer_app/models/user/country.dart';
|
||||
import 'package:car_customer_app/models/user/role.dart';
|
||||
import 'package:http/http.dart';
|
||||
import 'package:car_customer_app/classes/consts.dart';
|
||||
import 'package:car_customer_app/models/content_info_model.dart';
|
||||
import 'package:car_customer_app/models/member_model.dart';
|
||||
import 'package:car_customer_app/models/surah_model.dart';
|
||||
import 'package:car_customer_app/models/user/basic_otp.dart';
|
||||
import 'package:car_customer_app/models/user/register_user.dart';
|
||||
|
||||
import '../api_client.dart';
|
||||
|
||||
class ProfileApiClent {
|
||||
static final ProfileApiClent _instance = ProfileApiClent._internal();
|
||||
|
||||
ProfileApiClent._internal();
|
||||
|
||||
factory ProfileApiClent() => _instance;
|
||||
|
||||
Future<Document> getServiceProviderDocument(dynamic userId) async {
|
||||
var queryParameters = {
|
||||
"ServiceProviderID": userId.toString(),
|
||||
};
|
||||
String? token = AppState().getUser.data?.accessToken;
|
||||
print(token);
|
||||
return await ApiClient().getJsonForObject((json) => Document.fromJson(json), ApiConsts.GetProviderDocument, queryParameters: queryParameters, token: AppState().getUser.data!.accessToken ?? "");
|
||||
}
|
||||
|
||||
Future<MResponse> serviceProviderDocumentsUpdate(List<DocumentData>? documents) async {
|
||||
List<Map<String, dynamic>> map = [];
|
||||
for (int i = 0; i < documents!.length; i++) {
|
||||
if (documents[i].document != null) {
|
||||
var postParams = {
|
||||
"id": documents[i].id,
|
||||
"serviceProviderID": documents[i].serviceProviderId,
|
||||
"documentID": documents[i].documentId,
|
||||
"documentExt": documents[i].fileExt,
|
||||
"documentImage": documents[i].document,
|
||||
"isActive": true
|
||||
};
|
||||
map.add(postParams);
|
||||
}
|
||||
}
|
||||
String t = AppState().getUser.data!.accessToken ?? "";
|
||||
print("tokeen " + t);
|
||||
return await ApiClient().postJsonForObject((json) => MResponse.fromJson(json), ApiConsts.ServiceProviderDocument_Update, map, token: t);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final mResponse = mResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
MResponse mResponseFromJson(String str) => MResponse.fromJson(json.decode(str));
|
||||
|
||||
String mResponseToJson(MResponse data) => json.encode(data.toJson());
|
||||
|
||||
class MResponse {
|
||||
MResponse({
|
||||
this.totalItemsCount,
|
||||
this.messageStatus,
|
||||
this.message,
|
||||
});
|
||||
|
||||
int? totalItemsCount;
|
||||
int? messageStatus;
|
||||
String? message;
|
||||
|
||||
factory MResponse.fromJson(Map<String, dynamic> json) => MResponse(
|
||||
totalItemsCount: json["totalItemsCount"] == null ? null : json["totalItemsCount"],
|
||||
messageStatus: json["messageStatus"] == null ? null : json["messageStatus"],
|
||||
message: json["message"] == null ? null : json["message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"totalItemsCount": totalItemsCount == null ? null : totalItemsCount,
|
||||
"messageStatus": messageStatus == null ? null : messageStatus,
|
||||
"message": message == null ? null : message,
|
||||
};
|
||||
}
|
||||
@ -0,0 +1,85 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final branch = branchFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
Branch branchFromJson(String str) => Branch.fromJson(json.decode(str));
|
||||
|
||||
String branchToJson(Branch data) => json.encode(data.toJson());
|
||||
|
||||
class Branch {
|
||||
Branch({
|
||||
this.totalItemsCount,
|
||||
this.data,
|
||||
this.messageStatus,
|
||||
this.message,
|
||||
});
|
||||
|
||||
int? totalItemsCount;
|
||||
List<BranchData>? data;
|
||||
int? messageStatus;
|
||||
String? message;
|
||||
|
||||
factory Branch.fromJson(Map<String, dynamic> json) => Branch(
|
||||
totalItemsCount: json["totalItemsCount"] == null ? null : json["totalItemsCount"],
|
||||
data: json["data"] == null ? null : List<BranchData>.from(json["data"].map((x) => BranchData.fromJson(x))),
|
||||
messageStatus: json["messageStatus"] == null ? null : json["messageStatus"],
|
||||
message: json["message"] == null ? null : json["message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"totalItemsCount": totalItemsCount == null ? null : totalItemsCount,
|
||||
"data": data == null ? null : List<dynamic>.from(data!.map((x) => x.toJson())),
|
||||
"messageStatus": messageStatus == null ? null : messageStatus,
|
||||
"message": message == null ? null : message,
|
||||
};
|
||||
}
|
||||
|
||||
class BranchData {
|
||||
BranchData({
|
||||
this.id,
|
||||
this.serviceProviderId,
|
||||
this.branchName,
|
||||
this.branchDescription,
|
||||
this.cityId,
|
||||
this.address,
|
||||
this.latitude,
|
||||
this.longitude,
|
||||
this.status,
|
||||
});
|
||||
|
||||
int? id;
|
||||
int? serviceProviderId;
|
||||
String? branchName;
|
||||
String? branchDescription;
|
||||
int? cityId;
|
||||
String? address;
|
||||
String? latitude;
|
||||
String? longitude;
|
||||
int? status;
|
||||
|
||||
factory BranchData.fromJson(Map<String, dynamic> json) => BranchData(
|
||||
id: json["id"] == null ? null : json["id"],
|
||||
serviceProviderId: json["serviceProviderID"] == null ? null : json["serviceProviderID"],
|
||||
branchName: json["branchName"] == null ? null : json["branchName"],
|
||||
branchDescription: json["branchDescription"] == null ? null : json["branchDescription"],
|
||||
cityId: json["cityID"] == null ? null : json["cityID"],
|
||||
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"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id == null ? null : id,
|
||||
"serviceProviderID": serviceProviderId == null ? null : serviceProviderId,
|
||||
"branchName": branchName == null ? null : branchName,
|
||||
"branchDescription": branchDescription == null ? null : branchDescription,
|
||||
"cityID": cityId == null ? null : cityId,
|
||||
"address": address == null ? null : address,
|
||||
"latitude": latitude == null ? null : latitude,
|
||||
"longitude": longitude == null ? null : longitude,
|
||||
"status": status == null ? null : status,
|
||||
};
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final category = categoryFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
Category categoryFromJson(String str) => Category.fromJson(json.decode(str));
|
||||
|
||||
String categoryToJson(Category data) => json.encode(data.toJson());
|
||||
|
||||
class Category {
|
||||
Category({
|
||||
this.totalItemsCount,
|
||||
this.data,
|
||||
this.messageStatus,
|
||||
this.message,
|
||||
});
|
||||
|
||||
int? totalItemsCount;
|
||||
List<CategoryData>? data;
|
||||
int? messageStatus;
|
||||
String? message;
|
||||
|
||||
factory Category.fromJson(Map<String, dynamic> json) => Category(
|
||||
totalItemsCount: json["totalItemsCount"] == null ? null : json["totalItemsCount"],
|
||||
data: json["data"] == null ? null : List<CategoryData>.from(json["data"].map((x) => CategoryData.fromJson(x))),
|
||||
messageStatus: json["messageStatus"] == null ? null : json["messageStatus"],
|
||||
message: json["message"] == null ? null : json["message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"totalItemsCount": totalItemsCount == null ? null : totalItemsCount,
|
||||
"data": data == null ? null : List<dynamic>.from(data!.map((x) => x.toJson())),
|
||||
"messageStatus": messageStatus == null ? null : messageStatus,
|
||||
"message": message == null ? null : message,
|
||||
};
|
||||
}
|
||||
|
||||
class CategoryData {
|
||||
CategoryData({
|
||||
this.id,
|
||||
this.categoryName,
|
||||
this.categoryNameN,
|
||||
this.serviceCategoryIconUrl,
|
||||
this.serviceCategoryImageUrl,
|
||||
});
|
||||
|
||||
int? id;
|
||||
String? categoryName;
|
||||
String? categoryNameN;
|
||||
dynamic? serviceCategoryIconUrl;
|
||||
dynamic? serviceCategoryImageUrl;
|
||||
|
||||
factory CategoryData.fromJson(Map<String, dynamic> 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"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id == null ? null : id,
|
||||
"categoryName": categoryName == null ? null : categoryName,
|
||||
"categoryNameN": categoryNameN == null ? null : categoryNameN,
|
||||
"serviceCategoryIconUrl": serviceCategoryIconUrl,
|
||||
"serviceCategoryImageUrl": serviceCategoryImageUrl,
|
||||
};
|
||||
}
|
||||
@ -0,0 +1,83 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final document = documentFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
Document documentFromJson(String str) => Document.fromJson(json.decode(str));
|
||||
|
||||
String documentToJson(Document data) => json.encode(data.toJson());
|
||||
|
||||
class Document {
|
||||
Document({
|
||||
this.totalItemsCount,
|
||||
this.data,
|
||||
this.messageStatus,
|
||||
this.message,
|
||||
});
|
||||
|
||||
int? totalItemsCount;
|
||||
List<DocumentData>? data;
|
||||
int? messageStatus;
|
||||
String? message;
|
||||
|
||||
factory Document.fromJson(Map<String, dynamic> json) => Document(
|
||||
totalItemsCount: json["totalItemsCount"] == null ? null : json["totalItemsCount"],
|
||||
data: json["data"] == null ? null : List<DocumentData>.from(json["data"].map((x) => DocumentData.fromJson(x))),
|
||||
messageStatus: json["messageStatus"] == null ? null : json["messageStatus"],
|
||||
message: json["message"] == null ? null : json["message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"totalItemsCount": totalItemsCount == null ? null : totalItemsCount,
|
||||
"data": data == null ? null : List<dynamic>.from(data!.map((x) => x.toJson())),
|
||||
"messageStatus": messageStatus == null ? null : messageStatus,
|
||||
"message": message == null ? null : message,
|
||||
};
|
||||
}
|
||||
|
||||
class DocumentData {
|
||||
DocumentData({
|
||||
this.id,
|
||||
this.serviceProviderId,
|
||||
this.documentId,
|
||||
this.documentUrl,
|
||||
this.status,
|
||||
this.comment,
|
||||
this.isActive,
|
||||
this.document,
|
||||
this.fileExt,
|
||||
});
|
||||
|
||||
int? id;
|
||||
int? serviceProviderId;
|
||||
int? documentId;
|
||||
dynamic? documentUrl;
|
||||
int? status;
|
||||
dynamic? comment;
|
||||
bool? isActive;
|
||||
String? document;
|
||||
String? fileExt;
|
||||
|
||||
factory DocumentData.fromJson(Map<String, dynamic> json) => DocumentData(
|
||||
id: json["id"] == null ? null : json["id"],
|
||||
serviceProviderId: json["serviceProviderID"] == null ? null : json["serviceProviderID"],
|
||||
documentId: json["documentID"] == null ? null : json["documentID"],
|
||||
documentUrl: json["documentURL"],
|
||||
status: json["status"] == null ? null : json["status"],
|
||||
comment: json["comment"],
|
||||
isActive: json["isActive"] == null ? null : json["isActive"],
|
||||
document: null,
|
||||
fileExt: null,
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id == null ? null : id,
|
||||
"serviceProviderID": serviceProviderId == null ? null : serviceProviderId,
|
||||
"documentID": documentId == null ? null : documentId,
|
||||
"documentURL": documentUrl,
|
||||
"status": status == null ? null : status,
|
||||
"comment": comment,
|
||||
"isActive": isActive == null ? null : isActive,
|
||||
};
|
||||
}
|
||||
@ -0,0 +1,80 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final services = servicesFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
Services servicesFromJson(String str) => Services.fromJson(json.decode(str));
|
||||
|
||||
String servicesToJson(Services data) => json.encode(data.toJson());
|
||||
|
||||
class Services {
|
||||
Services({
|
||||
this.totalItemsCount,
|
||||
this.data,
|
||||
this.messageStatus,
|
||||
this.message,
|
||||
});
|
||||
|
||||
int? totalItemsCount;
|
||||
List<ServicesData>? data;
|
||||
int? messageStatus;
|
||||
String? message;
|
||||
|
||||
factory Services.fromJson(Map<String, dynamic> json) => Services(
|
||||
totalItemsCount: json["totalItemsCount"] == null ? null : json["totalItemsCount"],
|
||||
data: json["data"] == null ? null : List<ServicesData>.from(json["data"].map((x) => ServicesData.fromJson(x))),
|
||||
messageStatus: json["messageStatus"] == null ? null : json["messageStatus"],
|
||||
message: json["message"] == null ? null : json["message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"totalItemsCount": totalItemsCount == null ? null : totalItemsCount,
|
||||
"data": data == null ? null : List<dynamic>.from(data!.map((x) => x.toJson())),
|
||||
"messageStatus": messageStatus == null ? null : messageStatus,
|
||||
"message": message == null ? null : message,
|
||||
};
|
||||
}
|
||||
|
||||
class ServicesData {
|
||||
ServicesData({
|
||||
this.id,
|
||||
this.description,
|
||||
this.descriptionN,
|
||||
this.serviceIconUrl,
|
||||
this.serviceImageUrl,
|
||||
this.serviceCategoryId,
|
||||
this.categoryName,
|
||||
this.isSelected,
|
||||
});
|
||||
|
||||
int? id;
|
||||
String? description;
|
||||
String? descriptionN;
|
||||
dynamic? serviceIconUrl;
|
||||
dynamic? serviceImageUrl;
|
||||
int? serviceCategoryId;
|
||||
dynamic? categoryName;
|
||||
bool? isSelected;
|
||||
|
||||
factory ServicesData.fromJson(Map<String, dynamic> json) => ServicesData(
|
||||
id: json["id"] == null ? null : json["id"],
|
||||
description: json["description"] == null ? null : json["description"],
|
||||
descriptionN: json["descriptionN"] == null ? null : json["descriptionN"],
|
||||
serviceIconUrl: json["serviceIconUrl"],
|
||||
serviceImageUrl: json["serviceImageUrl"],
|
||||
serviceCategoryId: json["serviceCategoryID"] == null ? null : json["serviceCategoryID"],
|
||||
categoryName: json["categoryName"],
|
||||
isSelected: false,
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id == null ? null : id,
|
||||
"description": description == null ? null : description,
|
||||
"descriptionN": descriptionN == null ? null : descriptionN,
|
||||
"serviceIconUrl": serviceIconUrl,
|
||||
"serviceImageUrl": serviceImageUrl,
|
||||
"serviceCategoryID": serviceCategoryId == null ? null : serviceCategoryId,
|
||||
"categoryName": categoryName,
|
||||
};
|
||||
}
|
||||
@ -1,30 +1,34 @@
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
MResponse mResponseFromJson(String str) => MResponse.fromJson(json.decode(str));
|
||||
|
||||
String mResponseToJson(MResponse data) => json.encode(data.toJson());
|
||||
import 'dart:convert';
|
||||
|
||||
ChangePassword changePasswordFromJson(String str) => ChangePassword.fromJson(json.decode(str));
|
||||
|
||||
class MResponse {
|
||||
MResponse({
|
||||
this.totalItemsCount,
|
||||
this.messageStatus,
|
||||
this.message,
|
||||
});
|
||||
String changePasswordToJson(ChangePassword data) => json.encode(data.toJson());
|
||||
|
||||
int? totalItemsCount;
|
||||
class ChangePassword {
|
||||
int? messageStatus;
|
||||
Null? totalItemsCount;
|
||||
bool? data;
|
||||
String? message;
|
||||
|
||||
factory MResponse.fromJson(Map<String, dynamic> json) => MResponse(
|
||||
totalItemsCount: json["totalItemsCount"] == null ? null : json["totalItemsCount"],
|
||||
messageStatus: json["messageStatus"] == null ? null : json["messageStatus"],
|
||||
message: json["message"] == null ? null : json["message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"totalItemsCount": totalItemsCount == null ? null : totalItemsCount,
|
||||
"messageStatus": messageStatus == null ? null : messageStatus,
|
||||
"message": message == null ? null : message,
|
||||
};
|
||||
}
|
||||
ChangePassword(
|
||||
{this.messageStatus, this.totalItemsCount, this.data, this.message});
|
||||
|
||||
ChangePassword.fromJson(Map<String, dynamic> json) {
|
||||
messageStatus = json['messageStatus'];
|
||||
totalItemsCount = json['totalItemsCount'];
|
||||
data = json['data'];
|
||||
message = json['message'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['messageStatus'] = this.messageStatus;
|
||||
data['totalItemsCount'] = this.totalItemsCount;
|
||||
data['data'] = this.data;
|
||||
data['message'] = this.message;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,65 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final cities = citiesFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
Cities citiesFromJson(String str) => Cities.fromJson(json.decode(str));
|
||||
|
||||
String citiesToJson(Cities data) => json.encode(data.toJson());
|
||||
|
||||
class Cities {
|
||||
Cities({
|
||||
this.totalItemsCount,
|
||||
this.data,
|
||||
this.messageStatus,
|
||||
this.message,
|
||||
});
|
||||
|
||||
int? totalItemsCount;
|
||||
List<CityData>? data;
|
||||
int? messageStatus;
|
||||
String? message;
|
||||
|
||||
factory Cities.fromJson(Map<String, dynamic> json) => Cities(
|
||||
totalItemsCount: json["totalItemsCount"] == null ? null : json["totalItemsCount"],
|
||||
data: json["data"] == null ? null : List<CityData>.from(json["data"].map((x) => CityData.fromJson(x))),
|
||||
messageStatus: json["messageStatus"] == null ? null : json["messageStatus"],
|
||||
message: json["message"] == null ? null : json["message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"totalItemsCount": totalItemsCount == null ? null : totalItemsCount,
|
||||
"data": data == null ? null : List<dynamic>.from(data!.map((x) => x.toJson())),
|
||||
"messageStatus": messageStatus == null ? null : messageStatus,
|
||||
"message": message == null ? null : message,
|
||||
};
|
||||
}
|
||||
|
||||
class CityData {
|
||||
CityData({
|
||||
this.id,
|
||||
this.cityName,
|
||||
this.cityNameN,
|
||||
this.countryId,
|
||||
});
|
||||
|
||||
int? id;
|
||||
String? cityName;
|
||||
String? cityNameN;
|
||||
int? countryId;
|
||||
|
||||
factory CityData.fromJson(Map<String, dynamic> json) => CityData(
|
||||
id: json["id"] == null ? null : json["id"],
|
||||
cityName: json["cityName"] == null ? null : json["cityName"],
|
||||
cityNameN: json["cityNameN"] == null ? null : json["cityNameN"],
|
||||
countryId: json["countryID"] == null ? null : json["countryID"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id == null ? null : id,
|
||||
"cityName": cityName == null ? null : cityName,
|
||||
"cityNameN": cityNameN == null ? null : cityNameN,
|
||||
"countryID": countryId == null ? null : countryId,
|
||||
};
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final imageResponse = imageResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
ImageResponse imageResponseFromJson(String str) => ImageResponse.fromJson(json.decode(str));
|
||||
|
||||
String imageResponseToJson(ImageResponse data) => json.encode(data.toJson());
|
||||
|
||||
class ImageResponse {
|
||||
ImageResponse({
|
||||
this.totalItemsCount,
|
||||
this.data,
|
||||
this.messageStatus,
|
||||
this.message,
|
||||
});
|
||||
|
||||
dynamic? totalItemsCount;
|
||||
String? data;
|
||||
int? messageStatus;
|
||||
String? message;
|
||||
|
||||
factory ImageResponse.fromJson(Map<String, dynamic> json) => ImageResponse(
|
||||
totalItemsCount: json["totalItemsCount"],
|
||||
data: json["data"] == null ? null : json["data"],
|
||||
messageStatus: json["messageStatus"] == null ? null : json["messageStatus"],
|
||||
message: json["message"] == null ? null : json["message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"totalItemsCount": totalItemsCount,
|
||||
"data": data == null ? null : data,
|
||||
"messageStatus": messageStatus == null ? null : messageStatus,
|
||||
"message": message == null ? null : message,
|
||||
};
|
||||
}
|
||||
@ -0,0 +1,65 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final role = roleFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
Role roleFromJson(String str) => Role.fromJson(json.decode(str));
|
||||
|
||||
String roleToJson(Role data) => json.encode(data.toJson());
|
||||
|
||||
class Role {
|
||||
Role({
|
||||
this.totalItemsCount,
|
||||
this.data,
|
||||
this.messageStatus,
|
||||
this.message,
|
||||
});
|
||||
|
||||
int? totalItemsCount;
|
||||
List<RoleData>? data;
|
||||
int? messageStatus;
|
||||
String? message;
|
||||
|
||||
factory Role.fromJson(Map<String, dynamic> json) => Role(
|
||||
totalItemsCount: json["totalItemsCount"] == null ? null : json["totalItemsCount"],
|
||||
data: json["data"] == null ? null : List<RoleData>.from(json["data"].map((x) => RoleData.fromJson(x))),
|
||||
messageStatus: json["messageStatus"] == null ? null : json["messageStatus"],
|
||||
message: json["message"] == null ? null : json["message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"totalItemsCount": totalItemsCount == null ? null : totalItemsCount,
|
||||
"data": data == null ? null : List<dynamic>.from(data!.map((x) => x.toJson())),
|
||||
"messageStatus": messageStatus == null ? null : messageStatus,
|
||||
"message": message == null ? null : message,
|
||||
};
|
||||
}
|
||||
|
||||
class RoleData {
|
||||
RoleData({
|
||||
this.id,
|
||||
this.roleName,
|
||||
this.roleNameN,
|
||||
this.isActive,
|
||||
});
|
||||
|
||||
int? id;
|
||||
String? roleName;
|
||||
String? roleNameN;
|
||||
bool? isActive;
|
||||
|
||||
factory RoleData.fromJson(Map<String, dynamic> json) => RoleData(
|
||||
id: json["id"] == null ? null : json["id"],
|
||||
roleName: json["roleName"] == null ? null : json["roleName"],
|
||||
roleNameN: json["roleNameN"] == null ? null : json["roleNameN"],
|
||||
isActive: json["isActive"] == null ? null : json["isActive"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id == null ? null : id,
|
||||
"roleName": roleName == null ? null : roleName,
|
||||
"roleNameN": roleNameN == null ? null : roleNameN,
|
||||
"isActive": isActive == null ? null : isActive,
|
||||
};
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
|
||||
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
VerifyEmail verifyEmailFromJson(String str) => VerifyEmail.fromJson(json.decode(str));
|
||||
|
||||
String verifyEmailToJson(VerifyEmail data) => json.encode(data.toJson());
|
||||
|
||||
|
||||
class VerifyEmail {
|
||||
Null? totalItemsCount;
|
||||
Data? data;
|
||||
int? messageStatus;
|
||||
String? message;
|
||||
|
||||
VerifyEmail(
|
||||
{this.totalItemsCount, this.data, this.messageStatus, this.message});
|
||||
|
||||
VerifyEmail.fromJson(Map<String, dynamic> json) {
|
||||
totalItemsCount = json['totalItemsCount'];
|
||||
data = json['data'] != null ? new Data.fromJson(json['data']) : null;
|
||||
messageStatus = json['messageStatus'];
|
||||
message = json['message'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['totalItemsCount'] = this.totalItemsCount;
|
||||
if (this.data != null) {
|
||||
data['data'] = this.data!.toJson();
|
||||
}
|
||||
data['messageStatus'] = this.messageStatus;
|
||||
data['message'] = this.message;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Data {
|
||||
String? userToken;
|
||||
|
||||
Data({this.userToken});
|
||||
|
||||
Data.fromJson(Map<String, dynamic> json) {
|
||||
userToken = json['userToken'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['userToken'] = this.userToken;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
|
||||
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
VerifyEmailOTP verifyEmailOTPFromJson(String str) => VerifyEmailOTP.fromJson(json.decode(str));
|
||||
|
||||
String verifyEmailOTPToJson(VerifyEmailOTP data) => json.encode(data.toJson());
|
||||
|
||||
class VerifyEmailOTP {
|
||||
bool? success;
|
||||
Null? errors;
|
||||
|
||||
VerifyEmailOTP({this.success, this.errors});
|
||||
|
||||
VerifyEmailOTP.fromJson(Map<String, dynamic> json) {
|
||||
success = json['success'];
|
||||
errors = json['errors'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['success'] = this.success;
|
||||
data['errors'] = this.errors;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,119 @@
|
||||
import 'package:car_customer_app/api/client/user_api_client.dart';
|
||||
|
||||
import 'package:car_customer_app/classes/utils.dart';
|
||||
import 'package:car_customer_app/config/routes.dart';
|
||||
import 'package:car_customer_app/models/user/confirm_password.dart';
|
||||
import 'package:car_customer_app/utils/navigator.dart';
|
||||
import 'package:car_customer_app/utils/utils.dart';
|
||||
import 'package:car_customer_app/widgets/app_bar.dart';
|
||||
import 'package:car_customer_app/widgets/dialog/dialogs.dart';
|
||||
import 'package:car_customer_app/widgets/dialog/message_dialog.dart';
|
||||
import 'package:car_customer_app/widgets/show_fill_button.dart';
|
||||
import 'package:car_customer_app/extensions/string_extensions.dart';
|
||||
import 'package:car_customer_app/extensions/int_extensions.dart';
|
||||
import 'package:car_customer_app/widgets/txt_field.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'dart:convert';
|
||||
import 'package:http/http.dart';
|
||||
|
||||
class ConfirmNewPasswordPage extends StatefulWidget {
|
||||
String userToken;
|
||||
|
||||
ConfirmNewPasswordPage(this.userToken, {Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<ConfirmNewPasswordPage> createState() => _ConfirmNewPasswordPageState();
|
||||
}
|
||||
|
||||
class _ConfirmNewPasswordPageState extends State<ConfirmNewPasswordPage> {
|
||||
String newPassword = "";
|
||||
String confirmPassword = '';
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: appBar(title: "Forget Password"),
|
||||
body: SingleChildScrollView(
|
||||
child: Container(
|
||||
// width: double.infinity,
|
||||
// height: double.infinity,
|
||||
padding: EdgeInsets.all(40),
|
||||
child: Column(
|
||||
children: [
|
||||
"New Password".toText24(),
|
||||
12.height,
|
||||
TextFormField(
|
||||
decoration: InputDecoration(
|
||||
hintText: "Enter New Password",
|
||||
hintStyle: TextStyle(color: Colors.grey),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: const BorderRadius.all(
|
||||
const Radius.circular(5.0),
|
||||
),
|
||||
),
|
||||
),
|
||||
obscureText: true,
|
||||
onChanged: (v) => newPassword = v,
|
||||
),
|
||||
12.height,
|
||||
TextFormField(
|
||||
decoration: InputDecoration(
|
||||
hintText: "Confirm Password",
|
||||
hintStyle: TextStyle(color: Colors.grey),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: const BorderRadius.all(
|
||||
const Radius.circular(5.0),
|
||||
),
|
||||
),
|
||||
),
|
||||
obscureText: true,
|
||||
onChanged: (v) => confirmPassword = v,
|
||||
),
|
||||
40.height,
|
||||
ShowFillButton(
|
||||
title: "Confirm",
|
||||
width: double.infinity,
|
||||
onPressed: () {
|
||||
if (validation()) confirmPasswordOTP(context);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> confirmPasswordOTP(BuildContext context) async {
|
||||
if(validateStructure(newPassword??"")){
|
||||
Utils.showLoading(context);
|
||||
Response res = await UserApiClent().ForgetPassword(widget.userToken, newPassword);
|
||||
Utils.hideLoading(context);
|
||||
ConfirmPassword data = ConfirmPassword.fromJson(jsonDecode(res.body));
|
||||
if (data.messageStatus == 1) {
|
||||
Utils.showToast("Password is Updated");
|
||||
navigateWithName(context, AppRoutes.loginWithPassword);
|
||||
} else {
|
||||
Utils.showToast(data.message ?? "");
|
||||
}
|
||||
}else{
|
||||
Utils.showToast("Password Should contains Character, Number, Capital and small letters");
|
||||
}
|
||||
}
|
||||
|
||||
bool validation() {
|
||||
bool isValid = true;
|
||||
if (newPassword != confirmPassword) {
|
||||
Utils.showToast("Confirmation password does not match the entered password");
|
||||
isValid = false;
|
||||
}
|
||||
return isValid;
|
||||
}
|
||||
|
||||
bool validateStructure(String value){
|
||||
String pattern = r'^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[!@#\$&*~]).{6,}$';
|
||||
RegExp regExp = new RegExp(pattern);
|
||||
return regExp.hasMatch(value);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,162 @@
|
||||
|
||||
|
||||
import 'package:car_customer_app/classes/utils.dart';
|
||||
import 'package:car_customer_app/config/constants.dart';
|
||||
import 'package:car_customer_app/config/routes.dart';
|
||||
import 'package:car_customer_app/models/user/forget_password_otp_compare.dart';
|
||||
import 'package:car_customer_app/models/user/forget_password_otp_request.dart';
|
||||
import 'package:car_customer_app/utils/navigator.dart';
|
||||
import 'package:car_customer_app/utils/utils.dart';
|
||||
import 'package:car_customer_app/widgets/app_bar.dart';
|
||||
import 'package:car_customer_app/widgets/button/show_image_button.dart';
|
||||
import 'package:car_customer_app/extensions/int_extensions.dart';
|
||||
import 'package:car_customer_app/extensions/string_extensions.dart';
|
||||
import 'package:car_customer_app/extensions/widget_extensions.dart';
|
||||
import 'package:car_customer_app/widgets/dialog/dialogs.dart';
|
||||
import 'package:car_customer_app/widgets/dialog/message_dialog.dart';
|
||||
import 'package:car_customer_app/widgets/dialog/otp_dialog.dart';
|
||||
import 'package:car_customer_app/widgets/txt_field.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
|
||||
|
||||
class VerifyPasswordPage extends StatelessWidget {
|
||||
int otpType = 1;
|
||||
String phoneNum = "";
|
||||
String userName = "";
|
||||
String userToken = "";
|
||||
String otp = "";
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: appBar(title: "Change Password"),
|
||||
body: Container(
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
padding: EdgeInsets.all(40),
|
||||
child: Column(
|
||||
children: [
|
||||
"Verify New Password".toText24(),
|
||||
mFlex(1),
|
||||
TxtField(
|
||||
hint: "966500000000",
|
||||
value: phoneNum,
|
||||
onChanged: (v) {
|
||||
phoneNum = v;
|
||||
},
|
||||
),
|
||||
mFlex(2),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: ShowImageButton(
|
||||
onClick: () {
|
||||
otpType = 1;
|
||||
// sendPasswordOTP(context);
|
||||
showMDialog(context, child: OtpDialog(
|
||||
onClick: (String code) {
|
||||
pop(context);
|
||||
delay(300).then(
|
||||
(value) => showMDialog(
|
||||
context,
|
||||
child: MessageDialog(
|
||||
title: "Phone Number Verified",
|
||||
onClick: () {
|
||||
otpType=1;
|
||||
navigateWithName(context, AppRoutes.confirmNewPasswordPage);
|
||||
// ForgetPasswordOTP(context);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
));
|
||||
},
|
||||
title: 'With SMS',
|
||||
icon: icons + "ic_sms.png",
|
||||
),
|
||||
),
|
||||
20.width,
|
||||
Expanded(
|
||||
child: ShowImageButton(
|
||||
onClick: () {
|
||||
otpType = 1;
|
||||
// sendPasswordOTP(context);
|
||||
showMDialog(context, child: OtpDialog(
|
||||
onClick: (String code) {
|
||||
pop(context);
|
||||
delay(300).then(
|
||||
(value) => showMDialog(
|
||||
context,
|
||||
child: MessageDialog(
|
||||
title: "Phone Number Verified",
|
||||
onClick: () {
|
||||
otpType=2;
|
||||
navigateWithName(context, AppRoutes.confirmNewPasswordPage);
|
||||
// ForgetPasswordOTP(context);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
));
|
||||
},
|
||||
title: 'With Whatsapp',
|
||||
icon: icons + "ic_whatsapp.png",
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
mFlex(10),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// Future<void> sendPasswordOTP(BuildContext context) async {
|
||||
// Utils.showLoading(context);
|
||||
// PasswordOTPCompare otpCompare = await UserApiClent().ForgetPasswordOTPCompare(userToken, otp);
|
||||
// Utils.hideLoading(context);
|
||||
// if (otpCompare.messageStatus == 1) {
|
||||
// // navigateWithName(context, AppRoutes.confirmNewPasswordPage);
|
||||
// showMDialog(context, child: OtpDialog(
|
||||
// onClick: (String code) async {
|
||||
// pop(context);
|
||||
// Utils.showLoading(context);
|
||||
// // PasswordOTPCompare otpCompare = await UserApiClent().ForgetPasswordOTPCompare(userToken, otp);
|
||||
// Utils.hideLoading(context);
|
||||
// },
|
||||
// ));
|
||||
// } else {
|
||||
// Utils.showToast(otpCompare.message ?? "");
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
// User otpRequest = User.fromJson(jsonDecode(res.body));
|
||||
// SharedPrefManager.setUserToken(otpRequest.data!.accessToken ?? "");
|
||||
// SharedPrefManager.setUserId(otpRequest.data!.userInfo!.userId ?? "");
|
||||
// showMDialog(context, child: OtpDialog(
|
||||
// onClick: (String code) {
|
||||
// pop(context);
|
||||
// delay(300).then(
|
||||
// (value) => showMDialog(
|
||||
// context,
|
||||
// child: MessageDialog(
|
||||
// title: "Phone Number Verified",
|
||||
// onClick: () {
|
||||
// otpType=1;
|
||||
// navigateWithName(context, AppRoutes.confirmNewPasswordPage);
|
||||
// // ForgetPasswordOTP(context);
|
||||
// },
|
||||
// ),
|
||||
// ),
|
||||
// );
|
||||
// },
|
||||
// ));
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
enum ClassType { EMAIL, NUMBER }
|
||||
|
||||
class LoginEmailTab extends StatefulWidget {
|
||||
Function(ClassType) onSelection;
|
||||
|
||||
LoginEmailTab({required this.onSelection});
|
||||
|
||||
@override
|
||||
State<LoginEmailTab> createState() => _LoginEmailTabState();
|
||||
}
|
||||
|
||||
class _LoginEmailTabState extends State<LoginEmailTab> {
|
||||
ClassType type = ClassType.NUMBER;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
type = ClassType.NUMBER;
|
||||
widget.onSelection(ClassType.NUMBER);
|
||||
},
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
height: 45,
|
||||
color: type == ClassType.NUMBER ? Colors.blue : Colors.transparent,
|
||||
child: Center(
|
||||
child: Text(
|
||||
"Number",
|
||||
style: TextStyle(
|
||||
color: type == ClassType.NUMBER ? Colors.white : Colors.black,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
type = ClassType.EMAIL;
|
||||
widget.onSelection(ClassType.EMAIL);
|
||||
},
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
height: 45,
|
||||
color: type == ClassType.EMAIL ? Colors.blue : Colors.transparent,
|
||||
child: Center(
|
||||
child: Text(
|
||||
"Email",
|
||||
style: TextStyle(
|
||||
color: type == ClassType.EMAIL ? Colors.white : Colors.black,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
)),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||