added lazy loading

aamir_dev
Faiz Hashmi 11 months ago
parent 04bcf76083
commit 4901e8a0fb

@ -738,7 +738,6 @@
"blockedByAdmin": "Blocked by admin",
"active": "Active",
"paymentType": "Payment Type",
"searchByCreatedDate": "Search By Created Date",
"dealCompleted": "The Deal Completed",
"theDealNotCompleted": "The Deal Not Completed",
"cancelRequest": "I want to cancel the request.",
@ -759,7 +758,7 @@
"tapToSeeItems": "Tap to see items",
"noteCopyItemsExplanation": "Note: You will be able to copy items from one service to another in a selected category. You must create the services first and they should be approved. Then you will be able to get the available services from which you can copy all or selected items.",
"requestCreatedOn": "Request created on",
"online": "Online"
"online": "Online",
"searchByCreatedDate": "Search By Created Date",
"updateUserDetails": "Update User Details",
"enterNewFirstName": "Enter First Name",
@ -771,7 +770,7 @@
"userGender": "Gender",
"userMale": "Male",
"userFemale": "Female",
"maxFileSelection" :"You can select a maximum of 7 files",
"maxFileSelection": "You can select a maximum of 7 files",
"maxFileSize": "Each file size must be less than 2 MB",
"onlyJPGandPNG": "Only JPG and PNG files are allowed",
"expiryDate": "Expiry Date"

@ -260,8 +260,8 @@ class GlobalConsts {
// Attachment Values
int maxFileCount = 7;
int maxFileSizeInBytes = 2 * 1024 * 1024;
static int maxFileCount = 7;
static int maxFileSizeInBytes = 2 * 1024 * 1024;
}
class MyAssets {

@ -1533,22 +1533,6 @@ static const Map<String,dynamic> en_US = {
"blockedByAdmin": "Blocked by admin",
"active": "Active",
"paymentType": "Payment Type",
"searchByCreatedDate": "Search By Created Date",
"updateUserDetails": "Update User Details",
"enterNewFirstName": "Enter First Name",
"enterNewLastName": "Enter Last Name",
"userDetailsUpdated": "User Details is Updated",
"cityNameMandatory": "City is mandatory",
"genderMandatory": "Gender is mandatory",
"updateCity": "Update City",
"userGender": "Gender",
"userMale": "Male",
"userFemale": "Female",
"maxFileSelection": "You can select a maximum of 7 files",
"maxFileSize": "Each file size must be less than 2 MB",
"onlyJPGandPNG": "Only JPG and PNG files are allowed",
"expiryDate": "Expiry Date"
"searchByCreatedDate": "Search By Created Date",
"dealCompleted": "The Deal Completed",
"theDealNotCompleted": "The Deal Not Completed",
"cancelRequest": "I want to cancel the request.",
@ -1569,7 +1553,22 @@ static const Map<String,dynamic> en_US = {
"tapToSeeItems": "Tap to see items",
"noteCopyItemsExplanation": "Note: You will be able to copy items from one service to another in a selected category. You must create the services first and they should be approved. Then you will be able to get the available services from which you can copy all or selected items.",
"requestCreatedOn": "Request created on",
"online": "Online"
"online": "Online",
"searchByCreatedDate": "Search By Created Date",
"updateUserDetails": "Update User Details",
"enterNewFirstName": "Enter First Name",
"enterNewLastName": "Enter Last Name",
"userDetailsUpdated": "User Details is Updated",
"cityNameMandatory": "City is mandatory",
"genderMandatory": "Gender is mandatory",
"updateCity": "Update City",
"userGender": "Gender",
"userMale": "Male",
"userFemale": "Female",
"maxFileSelection": "You can select a maximum of 7 files",
"maxFileSize": "Each file size must be less than 2 MB",
"onlyJPGandPNG": "Only JPG and PNG files are allowed",
"expiryDate": "Expiry Date"
};
static const Map<String, Map<String,dynamic>> mapLocales = {"ar_SA": ar_SA, "en_US": en_US};
}

@ -1264,8 +1264,8 @@ class AdVM extends BaseVM {
pickedPostingImages.addAll(imageModels);
// Added By Aamir
if (pickedPostingImages.length > GlobalConsts().maxFileCount) {
pickedPostingImages = pickedPostingImages.sublist(0, GlobalConsts().maxFileCount);
if (pickedPostingImages.length > GlobalConsts.maxFileCount) {
pickedPostingImages = pickedPostingImages.sublist(0, GlobalConsts.maxFileCount);
Utils.showToast(LocaleKeys.maxFileSelection);
}
@ -1312,8 +1312,8 @@ class AdVM extends BaseVM {
} else {
vehicleDamageCards[index].partImages!.addAll(imageModels);
// Added By Aamir
if (vehicleDamageCards[index].partImages!.length > GlobalConsts().maxFileCount) {
vehicleDamageCards[index].partImages = vehicleDamageCards[index].partImages!.sublist(0, GlobalConsts().maxFileCount);
if (vehicleDamageCards[index].partImages!.length > GlobalConsts.maxFileCount) {
vehicleDamageCards[index].partImages = vehicleDamageCards[index].partImages!.sublist(0, GlobalConsts.maxFileCount);
Utils.showToast(LocaleKeys.maxFileSelection);
}
}
@ -1368,8 +1368,8 @@ class AdVM extends BaseVM {
List<File> images = await commonServices.pickMultipleImages();
pickedDamageImages.addAll(images);
if (pickedDamageImages.length > GlobalConsts().maxFileCount) {
pickedDamageImages = pickedDamageImages.sublist(0, GlobalConsts().maxFileCount);
if (pickedDamageImages.length > GlobalConsts.maxFileCount) {
pickedDamageImages = pickedDamageImages.sublist(0, GlobalConsts.maxFileCount);
Utils.showToast(LocaleKeys.maxFileSelection);
}
if (pickedDamageImages.isNotEmpty) vehicleDamageImageError = "";

@ -443,8 +443,8 @@ class ChatVM extends BaseVM {
imageModels.add(ImageModel(filePath: element.path, isFromNetwork: false));
}
pickedImagesForMessage.addAll(imageModels);
if (pickedImagesForMessage.length > GlobalConsts().maxFileCount) {
pickedImagesForMessage = pickedImagesForMessage.sublist(0, GlobalConsts().maxFileCount);
if (pickedImagesForMessage.length > GlobalConsts.maxFileCount) {
pickedImagesForMessage = pickedImagesForMessage.sublist(0, GlobalConsts.maxFileCount);
Utils.showToast(LocaleKeys.maxFileSelection);
}

@ -269,8 +269,8 @@ class RequestsVM extends BaseVM {
imageModels.add(ImageModel(filePath: element.path, isFromNetwork: false));
}
pickedVehicleImages.addAll(imageModels);
if (pickedVehicleImages.length > GlobalConsts().maxFileCount) {
pickedVehicleImages = pickedVehicleImages.sublist(0, GlobalConsts().maxFileCount);
if (pickedVehicleImages.length > GlobalConsts.maxFileCount) {
pickedVehicleImages = pickedVehicleImages.sublist(0, GlobalConsts.maxFileCount);
Utils.showToast(LocaleKeys.maxFileSelection);
}

@ -140,8 +140,8 @@ class ServiceVM extends BaseVM {
imageModels.add(ImageModel(filePath: element.path, isFromNetwork: false));
}
pickedBranchImages.addAll(imageModels);
if (pickedBranchImages.length > GlobalConsts().maxFileCount) {
pickedBranchImages = pickedBranchImages.sublist(0, GlobalConsts().maxFileCount);
if (pickedBranchImages.length > GlobalConsts.maxFileCount) {
pickedBranchImages = pickedBranchImages.sublist(0, GlobalConsts.maxFileCount);
Utils.showToast(LocaleKeys.maxFileSelection);
}
if (pickedBranchImages.isNotEmpty) branchImageError = "";

@ -46,7 +46,6 @@ class _CompleteProfilePageState extends State<CompleteProfilePage> {
@override
Widget build(BuildContext context) {
return Consumer(builder: (BuildContext context, UserVM userVM, Widget? child) {
print("Country ID = " + AppState().getUserRegisterCountrySelection.id.toString());
userVM.getAllCitiesForUser(AppState().getUserRegisterCountrySelection.id);
return Scaffold(
appBar: CustomAppBar(

Loading…
Cancel
Save