Formatting

master_new_changes
Faiz Hashmi 2 years ago
parent c1eef03f82
commit b8c890f15e

@ -192,6 +192,7 @@ class GlobalConsts {
static String adDurationPhoneNumberError = "Phone number cannot be empty"; static String adDurationPhoneNumberError = "Phone number cannot be empty";
static String adReservablePriceErrorConst = "Ad Reservable price cannot be empty"; static String adReservablePriceErrorConst = "Ad Reservable price cannot be empty";
static String homeLocationEmptyError = "Home location cannot be empty"; static String homeLocationEmptyError = "Home location cannot be empty";
static String fillAllFields = "Please fill out all the fields.";
static String reserveAdPriceInfo = "Some dummy description to explain the following concept. This price will be for 24 hours and if a user cancels the reservations before 24 hours then the amount will be automatically refunded to the buyer."; static String reserveAdPriceInfo = "Some dummy description to explain the following concept. This price will be for 24 hours and if a user cancels the reservations before 24 hours then the amount will be automatically refunded to the buyer.";
} }

@ -128,72 +128,32 @@ class AppRoutes {
forgetPassword: (context) => const ForgetPasswordPage(), forgetPassword: (context) => const ForgetPasswordPage(),
loginVerification: (context) => const LoginVerificationPage(), loginVerification: (context) => const LoginVerificationPage(),
loginWithPassword: (context) => const LoginWithPassword(), loginWithPassword: (context) => const LoginWithPassword(),
loginMethodSelection: (context) => loginMethodSelection: (context) => LoginMethodSelectionPage(ModalRoute.of(context)!.settings.arguments as String),
LoginMethodSelectionPage(ModalRoute completeProfile: (context) => CompleteProfilePage(ModalRoute.of(context)!.settings.arguments as RegisterUserRespModel),
.of(context)!
.settings
.arguments as String),
completeProfile: (context) =>
CompleteProfilePage(ModalRoute
.of(context)!
.settings
.arguments as RegisterUserRespModel),
verifyPassword: (context) => VerifyPasswordPage(), verifyPassword: (context) => VerifyPasswordPage(),
confirmNewPasswordPage: (context) => confirmNewPasswordPage: (context) => ConfirmNewPasswordPage(ModalRoute.of(context)!.settings.arguments as String),
ConfirmNewPasswordPage(ModalRoute
.of(context)!
.settings
.arguments as String),
changePassword: (context) => const ChangePasswordPage(), changePassword: (context) => const ChangePasswordPage(),
forgetPasswordMethodPage: (context) => forgetPasswordMethodPage: (context) => ForgetPasswordMethodPage(ModalRoute.of(context)!.settings.arguments as String),
ForgetPasswordMethodPage(ModalRoute
.of(context)!
.settings
.arguments as String),
changeMobilePage: (context) => ChangeMobilePage(), changeMobilePage: (context) => ChangeMobilePage(),
changeEmailPage: (context) => const ChangeEmailPage(), changeEmailPage: (context) => const ChangeEmailPage(),
editAccountPage: (context) => const EditAccountPage(), editAccountPage: (context) => const EditAccountPage(),
profileView: (context) => const ProfileScreen(), profileView: (context) => const ProfileScreen(),
settingOptionsLanguages: (context) => const SettingOptionsLanguage(), settingOptionsLanguages: (context) => const SettingOptionsLanguage(),
settingOptionsHelp: (context) => const SettingOptionsHelp(), settingOptionsHelp: (context) => const SettingOptionsHelp(),
providerLicensePage: (context) => ProviderLicensePage(), providerLicensePage: (context) => const ProviderLicensePage(),
// common pages // common pages
AppRoutes.adsDetailView: (context) => AppRoutes.adsDetailView: (context) => AdsDetailView(adDetails: ModalRoute.of(context)!.settings.arguments as AdDetailsModel),
AdsDetailView(adDetails: ModalRoute
.of(context)!
.settings
.arguments as AdDetailsModel),
AppRoutes.createAdView: (context) => const CreateAdView(), AppRoutes.createAdView: (context) => const CreateAdView(),
AppRoutes.adsFilterView: (context) => const AdsFilterView(), AppRoutes.adsFilterView: (context) => const AdsFilterView(),
AppRoutes.selectAdTypeView: (context) => AppRoutes.selectAdTypeView: (context) => SelectAdTypeView(arguments: ModalRoute.of(context)!.settings.arguments as List<bool>),
SelectAdTypeView(arguments: ModalRoute AppRoutes.chatView: (context) => ChatView(chatViewArguments: ModalRoute.of(context)!.settings.arguments as ChatViewArguments),
.of(context)! AppRoutes.offersListPage: (context) => OfferListPage(offerListPageArguments: ModalRoute.of(context)!.settings.arguments as OfferListPageArguments),
.settings AppRoutes.adsBuyerChatsListView: (context) => AdsBuyerChatsView(buyersListViewArguments: ModalRoute.of(context)!.settings.arguments as List<BuyersChatForAdsModel>),
.arguments as List<bool>),
AppRoutes.chatView: (context) =>
ChatView(chatViewArguments: ModalRoute
.of(context)!
.settings
.arguments as ChatViewArguments),
AppRoutes.offersListPage: (context) =>
OfferListPage(offerListPageArguments: ModalRoute
.of(context)!
.settings
.arguments as OfferListPageArguments),
AppRoutes.adsBuyerChatsListView: (context) =>
AdsBuyerChatsView(buyersListViewArguments: ModalRoute
.of(context)!
.settings
.arguments as List<BuyersChatForAdsModel>),
AppRoutes.createRequestPage: (context) => const CreateRequestPage(), AppRoutes.createRequestPage: (context) => const CreateRequestPage(),
AppRoutes.settingOptionsFaqs: (context) => const SettingOptionsFAQs(), AppRoutes.settingOptionsFaqs: (context) => const SettingOptionsFAQs(),
AppRoutes.settingOptionsInviteFriends: (context) => const SettingOptionsInviteFriends(), AppRoutes.settingOptionsInviteFriends: (context) => const SettingOptionsInviteFriends(),
AppRoutes.paymentMethodsView: (context) => AppRoutes.paymentMethodsView: (context) => PaymentMethodsView(paymentType: ModalRoute.of(context)!.settings.arguments as PaymentTypes),
PaymentMethodsView(paymentType: ModalRoute
.of(context)!
.settings
.arguments as PaymentTypes),
}; };
} }

@ -1,4 +1,3 @@
import 'dart:io';
import 'package:logger/logger.dart'; import 'package:logger/logger.dart';
Logger logger = Logger(printer: PrettyPrinter(printEmojis: false, colors: true, printTime: false)); Logger logger = Logger(printer: PrettyPrinter(printEmojis: false, colors: true, printTime: false));

@ -165,7 +165,7 @@ class Vehicle {
Condition? sellertype; Condition? sellertype;
Condition? transmission; Condition? transmission;
AdsDuration? duration; AdsDuration? duration;
List<AdImage>? image; List<GenericImageModel>? image;
List<DamageReport>? damagereport; List<DamageReport>? damagereport;
String? vehicleDescription; String? vehicleDescription;
String? vehicleTitle; String? vehicleTitle;
@ -220,9 +220,9 @@ class Vehicle {
transmission = json['transmission'] != null ? Condition.fromJson(json['transmission']) : null; transmission = json['transmission'] != null ? Condition.fromJson(json['transmission']) : null;
duration = json['duration'] != null ? AdsDuration.fromJson(json['duration']) : null; duration = json['duration'] != null ? AdsDuration.fromJson(json['duration']) : null;
if (json['image'] != null) { if (json['image'] != null) {
image = <AdImage>[]; image = <GenericImageModel>[];
json['image'].forEach((v) { json['image'].forEach((v) {
image!.add(AdImage.fromJson(v)); image!.add(GenericImageModel.fromJson(v));
}); });
} }
if (json['damagereport'] != null) { if (json['damagereport'] != null) {
@ -363,15 +363,15 @@ class AdsDuration {
} }
} }
class AdImage { class GenericImageModel {
int? id; int? id;
String? imageName; String? imageName;
String? imageUrl; String? imageUrl;
bool? isActive; bool? isActive;
AdImage({this.id, this.imageName, this.imageUrl, this.isActive}); GenericImageModel({this.id, this.imageName, this.imageUrl, this.isActive});
AdImage.fromJson(Map<String, dynamic> json) { GenericImageModel.fromJson(Map<String, dynamic> json) {
id = json['id']; id = json['id'];
imageName = json['imageName']; imageName = json['imageName'];
imageUrl = json['imageUrl']; imageUrl = json['imageUrl'];

@ -71,7 +71,11 @@ class ReqOffer {
int? offerStatus; int? offerStatus;
String? offerStatusText; String? offerStatusText;
String? comment; String? comment;
String? serviceItem;
String? itemManufacturer;
String? manufacturedDate;
double? price; double? price;
RequestsTypeEnum? requestsTypeEnum;
RequestOfferStatusEnum? requestOfferStatusEnum; RequestOfferStatusEnum? requestOfferStatusEnum;
ReqOffer({ ReqOffer({
@ -81,8 +85,12 @@ class ReqOffer {
this.offerStatus, this.offerStatus,
this.offerStatusText, this.offerStatusText,
this.comment, this.comment,
this.serviceItem,
this.itemManufacturer,
this.manufacturedDate,
this.price, this.price,
this.requestOfferStatusEnum, this.requestOfferStatusEnum,
this.requestsTypeEnum,
}); });
ReqOffer.fromJson(Map<String, dynamic> json) { ReqOffer.fromJson(Map<String, dynamic> json) {
@ -92,8 +100,12 @@ class ReqOffer {
offerStatus = json['offerStatus']; offerStatus = json['offerStatus'];
offerStatusText = json['offerStatusText']; offerStatusText = json['offerStatusText'];
comment = json['comment']; comment = json['comment'];
serviceItem = json['serviceItem'];
itemManufacturer = json['itemManufacturer'];
manufacturedDate = json['manufacturedDate'];
price = json['price']; price = json['price'];
requestOfferStatusEnum = ((json['offerStatus']) as int).toRequestOfferStatusEnum(); requestOfferStatusEnum = ((json['offerStatus']) as int).toRequestOfferStatusEnum();
requestsTypeEnum = RequestsTypeEnum.serviceRequest; // TODO: THIS SHOULD COME FROM API
} }
} }
@ -104,7 +116,3 @@ class OfferRequestCommentModel {
OfferRequestCommentModel({this.index, this.title, this.isSelected}); OfferRequestCommentModel({this.index, this.title, this.isSelected});
} }

@ -319,12 +319,11 @@ class VehiclePostingDamageParts {
return data; return data;
} }
@override @override
String toString() { String toString() {
return 'VehiclePostingDamageParts{id: $id, comment: $comment, vehicleImageBase64: $vehicleImageBase64, vehicleDamagePartID: $vehicleDamagePartID, vehiclePostingID: $vehiclePostingID, isActive: $isActive}'; return 'VehiclePostingDamageParts{id: $id, comment: $comment, vehicleImageBase64: $vehicleImageBase64, vehicleDamagePartID: $vehicleDamagePartID, vehiclePostingID: $vehiclePostingID, isActive: $isActive}';
}
} }
}
class BranchPostingImages { class BranchPostingImages {
int? id; int? id;
@ -332,8 +331,7 @@ class BranchPostingImages {
String? imageUrl; String? imageUrl;
String? imageStr; String? imageStr;
BranchPostingImages( BranchPostingImages({this.id, this.imageName, this.imageUrl, this.imageStr});
{this.id, this.imageName, this.imageUrl, this.imageStr});
BranchPostingImages.fromJson(Map<String, dynamic> json) { BranchPostingImages.fromJson(Map<String, dynamic> json) {
id = json['id']; id = json['id'];
@ -341,14 +339,4 @@ class BranchPostingImages {
imageUrl = json['imageUrl']; imageUrl = json['imageUrl'];
imageStr = json['imageStr']; imageStr = json['imageStr'];
} }
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['imageName'] = this.imageName;
data['imageUrl'] = this.imageUrl;
data['imageStr'] = this.imageStr;
return data;
}
} }

@ -20,7 +20,7 @@ class BranchDetailModel {
String? openTime; String? openTime;
String? closeTime; String? closeTime;
BranchStatusEnum? branchStatus; BranchStatusEnum? branchStatus;
List<AdImage>? branchImages; List<GenericImageModel>? branchImages;
int? statusId; int? statusId;
String? statusText; String? statusText;
String? branchStatusLabel; String? branchStatusLabel;
@ -32,22 +32,6 @@ class BranchDetailModel {
String? countryName; String? countryName;
bool isExpanded = false; bool isExpanded = false;
bool? isFavorite; bool? isFavorite;
//I/flutter (23146): "id": 1021,
// I/flutter (23146): "serviceProviderID": 10,
// I/flutter (23146): "serviceProviderName": "string",
// I/flutter (23146): "cityID": 1,
// I/flutter (23146): "cityName": "Riyadh",
// I/flutter (23146): "branchName": "Al Arouba Cars",
// I/flutter (23146): "branchDescription": "des",
// I/flutter (23146): "address": "3289 Hilal Bin Omayah St - حي العليا, حي العليا, الرياض, RHOD3289, Saudi Arabia",
// I/flutter (23146): "latitude": "24.708521303151027",
// I/flutter (23146): "longitude": "46.666924171149724",
// I/flutter (23146): "distanceKM": 0.0,
// I/flutter (23146): "openTime": "09:00",
// I/flutter (23146): "closeTime": "18:00",
// I/flutter (23146): "branchStatus": 3,
// I/flutter (23146): "branchStatusText": "ApprovedOrActive",
BranchDetailModel({ BranchDetailModel({
this.id, this.id,
this.serviceProviderId, this.serviceProviderId,
@ -78,18 +62,18 @@ class BranchDetailModel {
required this.isExpanded, required this.isExpanded,
}); });
List<AdImage> populateBranchImages(value) { List<GenericImageModel> populateBranchImages(value) {
List<AdImage> images = []; List<GenericImageModel> images = [];
if (value != null) { if (value != null) {
value.forEach((v) { value.forEach((v) {
images.add(AdImage.fromJson(v)); images.add(GenericImageModel.fromJson(v));
}); });
} }
return images; return images;
} }
BranchDetailModel.fromJson(Map<String, dynamic> json) { BranchDetailModel.fromJson(Map<String, dynamic> json) {
List<AdImage> images = populateBranchImages(json["serviceProviderBranchImage"]); List<GenericImageModel> images = populateBranchImages(json["serviceProviderBranchImage"]);
id = json["id"]; id = json["id"];
serviceProviderId = json["serviceProviderID"]; serviceProviderId = json["serviceProviderID"];
branchProfileImage = images.isNotEmpty ? images.first.imageUrl ?? "" : null; branchProfileImage = images.isNotEmpty ? images.first.imageUrl ?? "" : null;

@ -1,4 +1,5 @@
import 'package:mc_common_app/extensions/string_extensions.dart'; import 'package:mc_common_app/extensions/string_extensions.dart';
import 'package:mc_common_app/models/advertisment_models/ad_details_model.dart';
import 'package:mc_common_app/models/chat_models/chat_message_model.dart'; import 'package:mc_common_app/models/chat_models/chat_message_model.dart';
import 'package:mc_common_app/utils/enums.dart'; import 'package:mc_common_app/utils/enums.dart';
@ -24,7 +25,7 @@ class RequestModel {
int year; int year;
bool isNew; bool isNew;
String description; String description;
List<dynamic> requestImages; List<GenericImageModel>? requestImages;
int cityId; int cityId;
dynamic city; dynamic city;
double price; double price;
@ -35,8 +36,8 @@ class RequestModel {
bool isActive; bool isActive;
int createdBy; int createdBy;
String? createdOn; String? createdOn;
dynamic modifiedBy; int? modifiedBy;
dynamic modifiedOn; String? modifiedOn;
List<ChatMessageModel> chatMessages; List<ChatMessageModel> chatMessages;
RequestModel({ RequestModel({
@ -77,6 +78,16 @@ class RequestModel {
required this.chatMessages, required this.chatMessages,
}); });
List<GenericImageModel> populateRequestImages(value) {
List<GenericImageModel> images = [];
if (value != null) {
value.forEach((v) {
images.add(GenericImageModel.fromJson(v));
});
}
return images;
}
factory RequestModel.fromJson(Map<String, dynamic> json) { factory RequestModel.fromJson(Map<String, dynamic> json) {
return RequestModel( return RequestModel(
requestType: json["requestType"], requestType: json["requestType"],
@ -100,7 +111,7 @@ class RequestModel {
year: json["year"], year: json["year"],
isNew: json["isNew"], isNew: json["isNew"],
description: json["description"], description: json["description"],
requestImages: List<dynamic>.from(json["requestImages"].map((x) => x)), requestImages: List<GenericImageModel>.from(json["requestImages"].map((x) => GenericImageModel.fromJson(x))),
cityId: json["cityID"], cityId: json["cityID"],
city: json["city"], city: json["city"],
price: json["price"], price: json["price"],

@ -22,6 +22,8 @@ abstract class BranchRepo {
required String branchDescription, required String branchDescription,
required int cityId, required int cityId,
required String address, required String address,
required String openTime,
required String closeTime,
required double latitude, required double latitude,
required double longitude, required double longitude,
required List<BranchPostingImages> imagesList, required List<BranchPostingImages> imagesList,
@ -31,6 +33,8 @@ abstract class BranchRepo {
required int branchId, required int branchId,
required String branchName, required String branchName,
required String branchDescription, required String branchDescription,
required String openTime,
required String closeTime,
required int cityId, required int cityId,
required String address, required String address,
required String latitude, required String latitude,
@ -39,6 +43,8 @@ abstract class BranchRepo {
bool isNeedToDelete = true, bool isNeedToDelete = true,
}); });
Future<GenericRespModel> deleteBranch({required int branchId});
Future<Branch> fetchAllBranches(); Future<Branch> fetchAllBranches();
Future<Category> fetchBranchCategory(); Future<Category> fetchBranchCategory();
@ -114,6 +120,8 @@ class BranchRepoImp implements BranchRepo {
required String branchDescription, required String branchDescription,
required int cityId, required int cityId,
required String address, required String address,
required String openTime,
required String closeTime,
required double latitude, required double latitude,
required double longitude, required double longitude,
required List<BranchPostingImages> imagesList, required List<BranchPostingImages> imagesList,
@ -135,6 +143,8 @@ class BranchRepoImp implements BranchRepo {
"branchDescription": branchDescription, "branchDescription": branchDescription,
"cityID": cityId.toString(), "cityID": cityId.toString(),
"address": address, "address": address,
"openTime": openTime,
"closeTime": closeTime,
"latitude": latitude, "latitude": latitude,
"longitude": longitude, "longitude": longitude,
"isActive": true, "isActive": true,
@ -219,6 +229,8 @@ class BranchRepoImp implements BranchRepo {
required int branchId, required int branchId,
required String branchName, required String branchName,
required String branchDescription, required String branchDescription,
required String openTime,
required String closeTime,
required int cityId, required int cityId,
required String address, required String address,
required String latitude, required String latitude,
@ -226,6 +238,17 @@ class BranchRepoImp implements BranchRepo {
required List<BranchPostingImages> imagesList, required List<BranchPostingImages> imagesList,
bool isNeedToDelete = true, bool isNeedToDelete = true,
}) async { }) async {
List serviceProviderBranchImages = [];
for (var element in imagesList) {
var imageMap = {
"id": element.id ?? 0,
"imageName": element.imageName,
"imageUrl": element.imageUrl,
"imageStr": element.imageStr,
};
serviceProviderBranchImages.add(imageMap);
}
String lat = "0", long = "0"; String lat = "0", long = "0";
try { try {
lat = latitude.toString().substring(0, 9); lat = latitude.toString().substring(0, 9);
@ -236,16 +259,29 @@ class BranchRepoImp implements BranchRepo {
"serviceProviderID": AppState().getUser.data?.userInfo?.providerId ?? "", "serviceProviderID": AppState().getUser.data?.userInfo?.providerId ?? "",
"branchName": branchName, "branchName": branchName,
"branchDescription": branchDescription, "branchDescription": branchDescription,
"openTime": openTime,
"closeTime": closeTime,
"cityID": cityId, "cityID": cityId,
"address": address, "address": address,
"latitude": lat, "latitude": lat,
"longitude": long, "longitude": long,
"serviceProviderBranchImages": serviceProviderBranchImages,
"isActive": isNeedToDelete "isActive": isNeedToDelete
}; };
String t = AppState().getUser.data!.accessToken ?? ""; String t = AppState().getUser.data!.accessToken ?? "";
return await apiClient.postJsonForObject((json) => GenericRespModel.fromJson(json), ApiConsts.updateProviderBranch, postParams, token: t); return await apiClient.postJsonForObject((json) => GenericRespModel.fromJson(json), ApiConsts.updateProviderBranch, postParams, token: t);
} }
@override
Future<GenericRespModel> deleteBranch({required int branchId}) async {
var postParams = {
"id": branchId,
"isActive": false,
};
String t = AppState().getUser.data!.accessToken ?? "";
return await apiClient.postJsonForObject((json) => GenericRespModel.fromJson(json), ApiConsts.updateProviderBranch, postParams, token: t);
}
@override @override
Future<GenericRespModel> createService(List<Map<String, dynamic>> map) async { Future<GenericRespModel> createService(List<Map<String, dynamic>> map) async {
String t = AppState().getUser.data!.accessToken ?? ""; String t = AppState().getUser.data!.accessToken ?? "";
@ -306,7 +342,6 @@ class BranchRepoImp implements BranchRepo {
"ProviderBranchID": branchID, "ProviderBranchID": branchID,
}; };
String t = AppState().getUser.data!.accessToken ?? ""; String t = AppState().getUser.data!.accessToken ?? "";
debugPrint("token " + t);
return await apiClient.getJsonForObject((json) => Services.fromJson(json), ApiConsts.getProviderServices, queryParameters: postParams, token: t); return await apiClient.getJsonForObject((json) => Services.fromJson(json), ApiConsts.getProviderServices, queryParameters: postParams, token: t);
} }
@ -318,7 +353,16 @@ class BranchRepoImp implements BranchRepo {
@override @override
Future<List<BranchDetailModel>> getAllNearBranchAndServices() async { Future<List<BranchDetailModel>> getAllNearBranchAndServices() async {
GenericRespModel adsGenericModel = await apiClient.getJsonForObject((json) => GenericRespModel.fromJson(json), ApiConsts.getAllNearBranches, token: appState.getUser.data!.accessToken); var queryParameters = {
"isActive": "true",
"Status": "3",
};
GenericRespModel adsGenericModel = await apiClient.getJsonForObject(
(json) => GenericRespModel.fromJson(json),
ApiConsts.getAllNearBranches,
token: appState.getUser.data!.accessToken,
queryParameters: queryParameters,
);
List<BranchDetailModel> nearBranches = List.generate(adsGenericModel.data.length, (index) => BranchDetailModel.fromJson(adsGenericModel.data[index])); List<BranchDetailModel> nearBranches = List.generate(adsGenericModel.data.length, (index) => BranchDetailModel.fromJson(adsGenericModel.data[index]));
return nearBranches; return nearBranches;
} }
@ -390,6 +434,8 @@ class BranchRepoImp implements BranchRepo {
"Rating": "${rating ?? 0}", "Rating": "${rating ?? 0}",
"Latitude": latitude.toString(), "Latitude": latitude.toString(),
"Longitude": longitude.toString(), "Longitude": longitude.toString(),
"Status": "3",
}; };
GenericRespModel adsGenericModel = await apiClient.getJsonForObject( GenericRespModel adsGenericModel = await apiClient.getJsonForObject(

@ -10,7 +10,19 @@ import 'package:mc_common_app/models/requests_models/request_model.dart';
import 'package:mc_common_app/utils/enums.dart'; import 'package:mc_common_app/utils/enums.dart';
abstract class RequestRepo { abstract class RequestRepo {
Future<GenericRespModel> createRequest(Map<String, dynamic> map); Future<GenericRespModel> createRequest({
required int requestTypeId,
required int vehicleTypeId,
required String brand,
required String model,
required String year,
required int countryID,
required int cityID,
required String price,
required String description,
required bool isSpecialServiceNeeded,
required List requestImages,
});
Future<List<OffersModel>> getOffersByRequest({required int requestId, int serviceProviderId = 0}); Future<List<OffersModel>> getOffersByRequest({required int requestId, int serviceProviderId = 0});
@ -28,7 +40,34 @@ class RequestRepoImp implements RequestRepo {
AppState appState = injector.get<AppState>(); AppState appState = injector.get<AppState>();
@override @override
Future<GenericRespModel> createRequest(Map<String, dynamic> postParams) async { Future<GenericRespModel> createRequest({
required int requestTypeId,
required int vehicleTypeId,
required String brand,
required String model,
required String year,
required int countryID,
required int cityID,
required String price,
required String description,
required bool isSpecialServiceNeeded,
required List requestImages,
}) async {
Map<String, dynamic> postParams = {
"customerID": AppState().getUser.data!.userInfo!.customerId ?? 0,
"requestType": requestTypeId,
"vehicleTypeID": vehicleTypeId,
"brand": brand,
"model": model,
"year": year,
"isNew": true,
"countryID": countryID,
"cityID": cityID,
"price": price,
"description": description,
"isSpecialServiceNeeded": false,
"requestImages": requestImages,
};
GenericRespModel enumGenericModel = await apiClient.postJsonForObject( GenericRespModel enumGenericModel = await apiClient.postJsonForObject(
(json) => GenericRespModel.fromJson(json), (json) => GenericRespModel.fromJson(json),
ApiConsts.createRequest, ApiConsts.createRequest,

@ -54,13 +54,14 @@ class ChatVM extends ChangeNotifier {
if (!isUserOnChatScreen) { if (!isUserOnChatScreen) {
return; return;
} }
if (scrollController.hasClients) {
scrollController.animateTo( scrollController.animateTo(
scrollController.position.maxScrollExtent + 200, // for the text field scrollController.position.maxScrollExtent + 200, // for the text field
duration: const Duration(seconds: 1), duration: const Duration(seconds: 1),
curve: Curves.fastOutSlowIn, curve: Curves.fastOutSlowIn,
); );
} }
}
List<OfferRequestCommentModel> offerRejectModelList = [ List<OfferRequestCommentModel> offerRejectModelList = [
OfferRequestCommentModel( OfferRequestCommentModel(

@ -160,7 +160,6 @@ class RequestsVM extends BaseVM {
SelectionModel vehicleTypeId = SelectionModel(selectedOption: "", selectedId: -1, errorValue: ""); SelectionModel vehicleTypeId = SelectionModel(selectedOption: "", selectedId: -1, errorValue: "");
Future<void> getVehicleTypes() async { Future<void> getVehicleTypes() async {
resetRequestCreationForm();
isFetchingVehicleType = true; isFetchingVehicleType = true;
vehicleTypes = await commonRepo.getVehicleTypes(); vehicleTypes = await commonRepo.getVehicleTypes();
isFetchingVehicleType = false; isFetchingVehicleType = false;
@ -168,12 +167,16 @@ class RequestsVM extends BaseVM {
} }
resetRequestCreationForm() { resetRequestCreationForm() {
vehicleTypeId.selectedId = -1; requestTypeId = SelectionModel(selectedOption: "", selectedId: -1, errorValue: "");
vehicleBrandId.selectedId = -1; vehicleTypeId = SelectionModel(selectedOption: "", selectedId: -1, errorValue: "");
vehicleModelId.selectedId = -1; vehicleBrandId = SelectionModel(selectedOption: "", selectedId: -1, errorValue: "");
vehicleModelYearId.selectedId = -1; vehicleModelId = SelectionModel(selectedOption: "", selectedId: -1, errorValue: "");
vehicleCountryId.selectedId = -1; vehicleModelYearId = SelectionModel(selectedOption: "", selectedId: -1, errorValue: "");
vehicleCityId.selectedId = -1; vehicleCountryId = SelectionModel(selectedOption: "", selectedId: -1, errorValue: "");
vehicleCityId = SelectionModel(selectedOption: "", selectedId: -1, errorValue: "");
pickedVehicleImages.clear();
price = '';
description = '';
} }
void updateSelectionVehicleTypeId(SelectionModel id) async { void updateSelectionVehicleTypeId(SelectionModel id) async {
@ -251,7 +254,8 @@ class RequestsVM extends BaseVM {
} }
//Request Management //Request Management
String price = "", description = ""; String price = "";
String description = "";
updatePrice(String v) { updatePrice(String v) {
price = v; price = v;
@ -289,27 +293,26 @@ class RequestsVM extends BaseVM {
vehicleImages.forEach((element) { vehicleImages.forEach((element) {
requestImages.add(element.toJson()); requestImages.add(element.toJson());
}); });
Map<String, dynamic> body = {
"customerID": AppState().getUser.data!.userInfo!.customerId ?? 0,
"requestType": requestTypeId.selectedId,
"vehicleTypeID": vehicleTypeId.selectedId,
"brand": vehicleBrandId.selectedOption,
"model": vehicleModelId.selectedOption,
"year": vehicleModelYearId.selectedOption,
"isNew": true,
"countryID": vehicleCountryId.selectedId,
"cityID": vehicleCityId.selectedId,
"price": price,
"description": description,
"isSpecialServiceNeeded": false,
"requestImages": requestImages,
};
try { try {
GenericRespModel respModel = await requestRepo.createRequest(body); GenericRespModel respModel = await requestRepo.createRequest(
requestTypeId: requestTypeId.selectedId,
vehicleTypeId: vehicleTypeId.selectedId,
brand: vehicleBrandId.selectedOption,
model: vehicleModelId.selectedOption,
year: vehicleModelYearId.selectedOption,
countryID: vehicleCountryId.selectedId,
cityID: vehicleCityId.selectedId,
price: price,
description: description,
isSpecialServiceNeeded: false,
requestImages: requestImages,
);
Utils.hideLoading(context); Utils.hideLoading(context);
if (respModel.messageStatus == 1) { if (respModel.messageStatus == 1) {
Utils.showToast(LocaleKeys.requestSuccessfullyCreated.tr()); Utils.showToast(LocaleKeys.requestSuccessfullyCreated.tr());
Navigator.pop(context); Navigator.pop(context);
resetRequestCreationForm();
await getRequests(appType: AppType.customer); await getRequests(appType: AppType.customer);
} else { } else {
Utils.showToast(respModel.message.toString()); Utils.showToast(respModel.message.toString());
@ -494,6 +497,7 @@ class RequestsVM extends BaseVM {
senderId: senderId ?? "", senderId: senderId ?? "",
requestIndex: requestIndex, requestIndex: requestIndex,
providerIndex: -1, providerIndex: -1,
requestModel: requestModel,
); );
ChatViewArguments chatViewArguments = ChatViewArguments(chatTypeEnum: ChatTypeEnum.requestOffer, chatViewArgumentsForRequest: chatViewArgumentsForRequest); ChatViewArguments chatViewArguments = ChatViewArguments(chatTypeEnum: ChatTypeEnum.requestOffer, chatViewArgumentsForRequest: chatViewArgumentsForRequest);

@ -2,6 +2,7 @@ import 'dart:convert';
import 'dart:io'; import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:mc_common_app/classes/app_state.dart'; import 'package:mc_common_app/classes/app_state.dart';
import 'package:mc_common_app/classes/consts.dart';
import 'package:mc_common_app/generated/locale_keys.g.dart'; import 'package:mc_common_app/generated/locale_keys.g.dart';
import 'package:mc_common_app/models/general_models/generic_resp_model.dart'; import 'package:mc_common_app/models/general_models/generic_resp_model.dart';
import 'package:mc_common_app/repositories/branch_repo.dart'; import 'package:mc_common_app/repositories/branch_repo.dart';
@ -60,6 +61,17 @@ class ServiceVM extends BaseVM {
String address = ""; String address = "";
String branchName = ""; String branchName = "";
String branchDescription = ""; String branchDescription = "";
String branchErrorScreen = "";
void updateSelectionOpenTime(String date) {
openTime = date;
notifyListeners();
}
void updateSelectionCloseTime(String date) {
closedTime = date;
notifyListeners();
}
double getDistanceFromMe({ double getDistanceFromMe({
required String destLatitude, required String destLatitude,
@ -213,6 +225,9 @@ class ServiceVM extends BaseVM {
address = ""; address = "";
branchName = ""; branchName = "";
branchDescription = ""; branchDescription = "";
openTime = "";
closedTime = "";
branchErrorScreen = "";
latitude = 0; latitude = 0;
longitude = 0; longitude = 0;
role = -1; role = -1;
@ -225,6 +240,7 @@ class ServiceVM extends BaseVM {
categoryDropList = []; categoryDropList = [];
servicesDropList = []; servicesDropList = [];
services = null; services = null;
pickedBranchImages.clear();
} }
// Create Services // Create Services
@ -402,7 +418,28 @@ class ServiceVM extends BaseVM {
return branchPostingImages; return branchPostingImages;
} }
Future<void> onCreateBranchPressed({required BuildContext context, required String branchName, required String branchDesc, required int cityID, required String address, required double latitude, required double longitude}) async { Future<void> onCreateBranchPressed({
required BuildContext context,
required String branchName,
required String branchDesc,
required int cityID,
required String address,
required String openTime,
required String closeTime,
required double latitude,
required double longitude,
}) async {
if (branchName.isEmpty || branchDesc.isEmpty || address.isEmpty) {
branchErrorScreen = GlobalConsts.fillAllFields;
notifyListeners();
return;
}
if (pickedBranchImages.length < 3) {
branchErrorScreen = GlobalConsts.attachImageError;
notifyListeners();
return;
}
try { try {
Utils.showLoading(context); Utils.showLoading(context);
@ -414,6 +451,8 @@ class ServiceVM extends BaseVM {
GenericRespModel res = await branchRepo.createBranch( GenericRespModel res = await branchRepo.createBranch(
branchName: branchName, branchName: branchName,
branchDescription: branchDesc, branchDescription: branchDesc,
openTime: branchDesc,
closeTime: branchDesc,
cityId: cityID, cityId: cityID,
address: address, address: address,
latitude: latitude, latitude: latitude,
@ -440,11 +479,24 @@ class ServiceVM extends BaseVM {
required int branchID, required int branchID,
required String branchName, required String branchName,
required String branchDesc, required String branchDesc,
required String openTime,
required String closedTime,
required int cityID, required int cityID,
required String address, required String address,
required String latitude, required String latitude,
required String longitude, required String longitude,
}) async { }) async {
if (branchName.isEmpty || branchDesc.isEmpty || address.isEmpty) {
branchErrorScreen = GlobalConsts.fillAllFields;
notifyListeners();
return;
}
if (pickedBranchImages.length < 3) {
branchErrorScreen = GlobalConsts.attachImageError;
notifyListeners();
return;
}
try { try {
Utils.showLoading(context); Utils.showLoading(context);
@ -458,6 +510,8 @@ class ServiceVM extends BaseVM {
branchId: branchID, branchId: branchID,
branchName: branchName, branchName: branchName,
branchDescription: branchDesc, branchDescription: branchDesc,
openTime: openTime,
closeTime: closedTime,
cityId: cityID, cityId: cityID,
address: address, address: address,
latitude: latitude, latitude: latitude,
@ -478,4 +532,24 @@ class ServiceVM extends BaseVM {
Utils.showToast(e.toString()); Utils.showToast(e.toString());
} }
} }
Future<void> onDeleteBranchPressed({required BuildContext context, required int branchID}) async {
try {
Utils.showLoading(context);
GenericRespModel res = await branchRepo.deleteBranch(branchId: branchID);
Utils.hideLoading(context);
if (res.messageStatus == 1) {
Utils.showToast(LocaleKeys.branch_deleted.tr());
pop(context);
pop(context);
getBranchAndServices();
} else {
Utils.showToast(res.message ?? "");
}
} catch (e) {
Utils.hideLoading(context);
Utils.showToast(e.toString());
}
}
} }

@ -1,11 +1,15 @@
import 'package:carousel_slider/carousel_slider.dart'; import 'package:carousel_slider/carousel_slider.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:mc_common_app/extensions/string_extensions.dart';
import 'package:mc_common_app/generated/locale_keys.g.dart';
import 'package:mc_common_app/models/advertisment_models/ad_details_model.dart'; import 'package:mc_common_app/models/advertisment_models/ad_details_model.dart';
import 'package:mc_common_app/theme/colors.dart'; import 'package:mc_common_app/theme/colors.dart';
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart'; import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
import 'package:sizer/sizer.dart';
class ImagesCorouselWidget extends StatefulWidget { class ImagesCorouselWidget extends StatefulWidget {
final List<AdImage> imagesList; final List<GenericImageModel> imagesList;
const ImagesCorouselWidget({super.key, required this.imagesList}); const ImagesCorouselWidget({super.key, required this.imagesList});
@ -19,17 +23,33 @@ class _CarouselWithIndicatorState extends State<ImagesCorouselWidget> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Column(children: [ if (widget.imagesList.isEmpty) {
return Center(
child: SizedBox(
height: 25.h,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
"No Images to Show".toText(
fontSize: 12,
color: MyColors.lightTextColor,
isBold: true,
),
],
),
),
);
}
return SizedBox(
height: 25.h,
child: Column(children: [
CarouselSlider( CarouselSlider(
items: widget.imagesList items: widget.imagesList
.map((item) => Container( .map((item) => Container(
margin: const EdgeInsets.all(5.0), margin: const EdgeInsets.all(5.0),
child: ClipRRect( child: ClipRRect(
borderRadius: const BorderRadius.all(Radius.circular(5.0)), borderRadius: const BorderRadius.all(Radius.circular(5.0)),
child: item.imageUrl.buildNetworkImage( child: item.imageUrl.buildNetworkImage(),
height: 80,
width: 80,
),
), ),
)) ))
.toList(), .toList(),
@ -61,6 +81,7 @@ class _CarouselWithIndicatorState extends State<ImagesCorouselWidget> {
); );
}).toList(), }).toList(),
), ),
]); ]),
);
} }
} }

@ -70,15 +70,7 @@ class AdCard extends StatelessWidget {
children: [ children: [
Row( Row(
children: [ children: [
Image.network( adDetails.vehicle!.image!.first.imageUrl.buildNetworkImage(
adDetails.vehicle!.image == null || adDetails.vehicle!.image!.isEmpty ? "" : adDetails.vehicle!.image!.first.imageUrl!,
errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
return const SizedBox(
width: 80,
height: 80,
child: Icon(Icons.error_outline),
);
},
width: 80, width: 80,
height: 80, height: 80,
fit: BoxFit.cover, fit: BoxFit.cover,

@ -6,6 +6,7 @@ import 'package:mc_common_app/config/routes.dart';
import 'package:mc_common_app/extensions/int_extensions.dart'; import 'package:mc_common_app/extensions/int_extensions.dart';
import 'package:mc_common_app/extensions/string_extensions.dart'; import 'package:mc_common_app/extensions/string_extensions.dart';
import 'package:mc_common_app/generated/locale_keys.g.dart'; import 'package:mc_common_app/generated/locale_keys.g.dart';
import 'package:mc_common_app/main.dart';
import 'package:mc_common_app/models/chat_models/chat_message_model.dart'; import 'package:mc_common_app/models/chat_models/chat_message_model.dart';
import 'package:mc_common_app/models/requests_models/request_model.dart'; import 'package:mc_common_app/models/requests_models/request_model.dart';
import 'package:mc_common_app/theme/colors.dart'; import 'package:mc_common_app/theme/colors.dart';
@ -14,6 +15,7 @@ import 'package:mc_common_app/utils/enums.dart';
import 'package:mc_common_app/utils/utils.dart'; import 'package:mc_common_app/utils/utils.dart';
import 'package:mc_common_app/view_models/chat_view_model.dart'; import 'package:mc_common_app/view_models/chat_view_model.dart';
import 'package:mc_common_app/view_models/requests_view_model.dart'; import 'package:mc_common_app/view_models/requests_view_model.dart';
import 'package:mc_common_app/views/requests/request_bottomsheets.dart';
import 'package:mc_common_app/widgets/button/show_fill_button.dart'; import 'package:mc_common_app/widgets/button/show_fill_button.dart';
import 'package:mc_common_app/widgets/checkbox_with_title_desc.dart'; import 'package:mc_common_app/widgets/checkbox_with_title_desc.dart';
import 'package:mc_common_app/widgets/common_widgets/app_bar.dart'; import 'package:mc_common_app/widgets/common_widgets/app_bar.dart';
@ -63,69 +65,69 @@ class _ChatViewState extends State<ChatView> {
super.dispose(); super.dispose();
} }
Future buildSendOfferBottomSheet(BuildContext context) { // Future buildSendOfferBottomSheet(BuildContext context) {
RequestModel requestDetail = chatViewArgumentsForRequest!.requestModel!; // RequestModel requestDetail = chatViewArgumentsForRequest!.requestModel!;
return showModalBottomSheet( // return showModalBottomSheet(
context: context, // context: context,
isScrollControlled: true, // isScrollControlled: true,
enableDrag: true, // enableDrag: true,
builder: (BuildContext context) { // builder: (BuildContext context) {
return Consumer(builder: (BuildContext context, RequestsVM requestsVM, Widget? child) { // return Consumer(builder: (BuildContext context, RequestsVM requestsVM, Widget? child) {
return InfoBottomSheet( // return InfoBottomSheet(
title: LocaleKeys.makeAnOffer.tr().toText(fontSize: 28, isBold: true, letterSpacing: -1.44), // title: LocaleKeys.makeAnOffer.tr().toText(fontSize: 28, isBold: true, letterSpacing: -1.44),
description: Padding( // description: Padding(
padding: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom), // padding: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
child: Column( // child: Column(
crossAxisAlignment: CrossAxisAlignment.start, // crossAxisAlignment: CrossAxisAlignment.start,
children: [ // children: [
Column( // Column(
crossAxisAlignment: CrossAxisAlignment.start, // crossAxisAlignment: CrossAxisAlignment.start,
children: [ // children: [
12.height, // 12.height,
TxtField( // TxtField(
value: requestsVM.offerPrice, // value: requestsVM.offerPrice,
errorValue: requestsVM.offerPriceError, // errorValue: requestsVM.offerPriceError,
keyboardType: TextInputType.number, // keyboardType: TextInputType.number,
hint: LocaleKeys.enterAmount.tr(), // hint: LocaleKeys.enterAmount.tr(),
numbersOnly: true, // numbersOnly: true,
onChanged: (v) => requestsVM.updateOfferPrice(v), // onChanged: (v) => requestsVM.updateOfferPrice(v),
), // ),
12.height, // 12.height,
TxtField( // TxtField(
maxLines: 5, // maxLines: 5,
value: requestsVM.offerDescription, // value: requestsVM.offerDescription,
errorValue: requestsVM.offerDescriptionError, // errorValue: requestsVM.offerDescriptionError,
keyboardType: TextInputType.text, // keyboardType: TextInputType.text,
hint: LocaleKeys.description.tr(), // hint: LocaleKeys.description.tr(),
onChanged: (v) => requestsVM.updateOfferDescription(v), // onChanged: (v) => requestsVM.updateOfferDescription(v),
), // ),
], // ],
), // ),
25.height, // 25.height,
ShowFillButton( // ShowFillButton(
title: LocaleKeys.submit.tr(), // title: LocaleKeys.submit.tr(),
onPressed: () { // onPressed: () {
requestsVM.onSendOfferPressed( // requestsVM.onSendOfferPressed(
context: context, // context: context,
receiverId: requestDetail.customerID, // receiverId: requestDetail.customerID,
message: requestsVM.offerDescription, // message: requestsVM.offerDescription,
requestId: requestDetail.id, // requestId: requestDetail.id,
offerPrice: requestsVM.offerPrice, // offerPrice: requestsVM.offerPrice,
requestModel: requestDetail, // requestModel: requestDetail,
requestIndex: chatViewArgumentsForRequest!.requestIndex, // requestIndex: chatViewArgumentsForRequest!.requestIndex,
isFromChatScreen: true, // isFromChatScreen: true,
); // );
}, // },
maxWidth: double.infinity, // maxWidth: double.infinity,
), // ),
19.height, // 19.height,
], // ],
), // ),
)); // ));
}); // });
}, // },
); // );
} // }
Future<bool> onTextMessageSend() async { Future<bool> onTextMessageSend() async {
bool status = false; bool status = false;
@ -202,8 +204,9 @@ class _ChatViewState extends State<ChatView> {
color: MyColors.darkPrimaryColor, color: MyColors.darkPrimaryColor,
size: 30, size: 30,
).onPress( ).onPress(
() async { () {
buildSendOfferBottomSheet(context); RequestDetailPageArguments requestDetailArguments = RequestDetailPageArguments(requestIndex: chatViewArgumentsForRequest!.requestIndex , requestModel: chatViewArgumentsForRequest!.requestModel!);
buildSendOfferBottomSheet(context, requestDetailArguments);
}, },
), ),
), ),

@ -33,7 +33,7 @@ class CreateRequestPage extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
LocaleKeys.vehicleDetails.tr().toText(fontSize: 18, isBold: true), LocaleKeys.requestType.tr().toText(fontSize: 18, isBold: true),
8.height, 8.height,
if (requestsVM.isFetchingRequestType) ...[ if (requestsVM.isFetchingRequestType) ...[
const Center( const Center(

@ -0,0 +1,110 @@
import 'package:flutter/material.dart';
import 'package:mc_common_app/config/routes.dart';
import 'package:mc_common_app/extensions/int_extensions.dart';
import 'package:mc_common_app/extensions/string_extensions.dart';
import 'package:mc_common_app/generated/locale_keys.g.dart';
import 'package:mc_common_app/theme/colors.dart';
import 'package:mc_common_app/utils/enums.dart';
import 'package:mc_common_app/utils/utils.dart';
import 'package:mc_common_app/view_models/requests_view_model.dart';
import 'package:mc_common_app/widgets/button/show_fill_button.dart';
import 'package:mc_common_app/widgets/common_widgets/info_bottom_sheet.dart';
import 'package:mc_common_app/widgets/txt_field.dart';
import 'package:provider/provider.dart';
import 'package:easy_localization/easy_localization.dart';
Future buildSendOfferBottomSheet(BuildContext context, RequestDetailPageArguments requestDetailPageArguments) {
final requestDetail = requestDetailPageArguments.requestModel;
return showModalBottomSheet(
context: context,
isScrollControlled: true,
enableDrag: true,
builder: (BuildContext context) {
return Consumer(builder: (BuildContext context, RequestsVM requestsVM, Widget? child) {
return InfoBottomSheet(
title: LocaleKeys.makeAnOffer.tr().toText(fontSize: 28, isBold: true, letterSpacing: -1.44),
description: Padding(
padding: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
12.height,
TxtField(
value: requestsVM.offerPrice,
errorValue: requestsVM.offerPriceError,
keyboardType: TextInputType.number,
hint: LocaleKeys.enterAmount.tr(),
numbersOnly: true,
onChanged: (v) => requestsVM.updateOfferPrice(v),
),
if (requestDetail.requestType == RequestsTypeEnum.serviceRequest.getIdFromRequestTypeStatusEnum()) ...[
12.height,
TxtField(
value: requestsVM.serviceItem,
errorValue: requestsVM.offerPriceError,
keyboardType: TextInputType.number,
hint: "Service Item",
onChanged: (v) => requestsVM.updateServiceItem(v),
),
12.height,
TxtField(
value: requestsVM.itemManufacturer,
errorValue: requestsVM.offerPriceError,
keyboardType: TextInputType.number,
hint: "Manufacturer",
onChanged: (v) => requestsVM.updateItemManufacturer(v),
),
12.height,
TxtField(
errorValue: "",
hint: "Manufactured On",
value: requestsVM.serviceItemCreatedOn,
isNeedClickAll: true,
postfixData: Icons.calendar_month_rounded,
postFixDataColor: MyColors.darkTextColor,
onTap: () async {
final formattedDate = await Utils.pickDateFromDatePicker(context, firstDate: DateTime(2020), lastDate: DateTime.now());
requestsVM.updateServiceItemCreatedOn(formattedDate);
},
),
],
12.height,
TxtField(
maxLines: 5,
value: requestsVM.offerDescription,
errorValue: requestsVM.offerDescriptionError,
keyboardType: TextInputType.text,
hint: LocaleKeys.description.tr(),
onChanged: (v) => requestsVM.updateOfferDescription(v),
),
],
),
25.height,
ShowFillButton(
title: LocaleKeys.submit.tr(),
maxHeight: 55,
onPressed: () {
requestsVM.onSendOfferPressed(
context: context,
receiverId: requestDetail.customerID,
message: requestsVM.offerDescription,
requestId: requestDetail.id,
offerPrice: requestsVM.offerPrice,
requestModel: requestDetail,
requestIndex: requestDetailPageArguments.requestIndex,
isFromChatScreen: false,
);
},
maxWidth: double.infinity,
),
19.height,
],
),
));
});
},
);
}

@ -2,6 +2,7 @@
import 'dart:developer'; import 'dart:developer';
import 'package:flutter/cupertino.dart';
import 'package:mc_common_app/generated/locale_keys.g.dart'; import 'package:mc_common_app/generated/locale_keys.g.dart';
import 'package:mc_common_app/utils/enums.dart'; import 'package:mc_common_app/utils/enums.dart';
import 'package:mc_common_app/view_models/chat_view_model.dart'; import 'package:mc_common_app/view_models/chat_view_model.dart';
@ -121,14 +122,11 @@ class RequestItem extends StatelessWidget {
Widget showItem(String title, String value) { Widget showItem(String title, String value) {
return Row( return Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
title.toText( title.toText(color: MyColors.lightTextColor),
color: MyColors.lightTextColor, 3.width,
), Flexible(child: value.toText(isBold: true, overflow: TextOverflow.ellipsis )),
2.width,
value.toText(
isBold: true,
),
], ],
); );
} }

@ -359,14 +359,18 @@ extension BuildSVG on String? {
errorBuilder: (BuildContext context, Object obj, StackTrace? s) { errorBuilder: (BuildContext context, Object obj, StackTrace? s) {
return SizedBox(height: height, width: width, child: const Icon(Icons.signal_wifi_connected_no_internet_4_outlined)); return SizedBox(height: height, width: width, child: const Icon(Icons.signal_wifi_connected_no_internet_4_outlined));
}, },
loadingBuilder: (BuildContext context, Widget? child, ImageChunkEvent? imageChunk) { // loadingBuilder: (BuildContext context, Widget? child, ImageChunkEvent? imageChunk) {
return const Center( // return SizedBox(
child: CircularProgressIndicator( // height: height,
strokeWidth: 0.5, // width: width,
color: MyColors.darkPrimaryColor, // child: const Center(
), // child: CircularProgressIndicator(
); // strokeWidth: 0.7,
}, // color: MyColors.darkPrimaryColor,
// ),
// ).paddingAll(10),
// );
// },
fit: fit, fit: fit,
color: color, color: color,
height: height, height: height,

@ -59,7 +59,6 @@ dependencies:
# Auth # Auth
local_auth: ^2.2.0 local_auth: ^2.2.0
huawei_fido: ^6.3.0+305 huawei_fido: ^6.3.0+305
device_info_plus: ^10.1.0 device_info_plus: ^10.1.0

Loading…
Cancel
Save