fakhravari
پنج شنبه 08 آبان 1399, 19:37 عصر
با سلام
https://vatanbgs.com/Api/GetListProductHomePageSelect?IdCustomer=00000000-0000-0000-0000-000000000000
با post خروجی ببنید
من چطوری این در فلاتر بتونم map کنم
این مپ من کار نمیکند
class HomePageViewMobileModel {
List<HomePageViewModel> Type1 = new List<HomePageViewModel>();
List<HomePageViewModel> Type2 = new List<HomePageViewModel>();
List<HomePageViewModel> Type3 = new List<HomePageViewModel>();
List<HomePageViewModel> Type4 = new List<HomePageViewModel>();
List<HomePageViewModel> Type5 = new List<HomePageViewModel>();
List<SlideShowViewModel> SlideShow = new List<SlideShowViewModel>();
HomePageViewMobileModel({
this.Type1 ,
this.Type2 ,
this.Type3 ,
this.Type4 ,
this.Type5 ,
this.SlideShow ,
});
factory HomePageViewMobileModel.fromJson(Map<String, dynamic> parsedJson){
return HomePageViewMobileModel(
Type1: parsedJson['Type1'],
Type2: parsedJson['Type2'],
Type3: parsedJson['Type3'],
Type4: parsedJson['Type4'],
Type5: parsedJson['Type5'],
SlideShow: parsedJson['SlideShow'],
);
}
}
class SlideShowViewModel
{
int Id ;
String Title ;
String TitleBtnCick ;
String AddressUrl ;
String Image ;
DateTime CreateDate ;
bool IsActive ;
String SlideTypeName ;
int IdTypeSlider ;
SlideShowViewModel({
this.Id ,
this.Title ,
this.TitleBtnCick ,
this.AddressUrl ,
this.Image,
this.CreateDate ,
this.IsActive,
this.SlideTypeName ,
this.IdTypeSlider
});
factory SlideShowViewModel.fromJson(Map<String, dynamic> parsedJson){
return SlideShowViewModel(
Id: parsedJson['Id'],
Title: parsedJson['Title'],
TitleBtnCick: parsedJson['TitleBtnCick'],
AddressUrl: parsedJson['AddressUrl'],
Image: parsedJson['Image'],
CreateDate: parsedJson['CreateDate'],
IsActive: parsedJson['IsActive'],
SlideTypeName: parsedJson['SlideTypeName'],
IdTypeSlider: parsedJson['IdTypeSlider'],
);
}
}
class HomePageViewModel
{
int Inventory;
int MaxSelect;
String NameFa;
String NameEn;
String NameEnSlug;
String ImageName;
String Title;
String Alt;
int TotalPrice;
int IdTypeDisplay;
int ValueDisplay;
int TotalPriceDisplay;
int Rating;
int IdProductHomePageType;
bool IsNewProduct;
bool IsAuction;
bool IsSpecial;
int IdProduct;
int IdProductInventory;
int TedadDarBag;
String HomePageType;
HomePageViewModel({
this.Inventory,
this.MaxSelect,
this.NameFa,
this.NameEn,
this.NameEnSlug,
this.ImageName,
this.Title,
this.Alt,
this.TotalPrice,
this.IdTypeDisplay,
this.ValueDisplay,
this.TotalPriceDisplay,
this.Rating,
this.IdProductHomePageType,
this.IsNewProduct,
this.IsAuction,
this.IsSpecial,
this.IdProduct,
this.IdProductInventory,
this.TedadDarBag,
this.HomePageType,
});
factory HomePageViewModel.fromJson(Map<String, dynamic> parsedJson){
return HomePageViewModel(
Inventory: parsedJson['Inventory'],
MaxSelect: parsedJson['MaxSelect'],
NameFa: parsedJson['NameFa'],
NameEn: parsedJson['NameEn'],
NameEnSlug: parsedJson['NameEnSlug'],
ImageName: parsedJson['ImageName'],
Title: parsedJson['Title'],
Alt: parsedJson['Alt'],
TotalPrice: parsedJson['TotalPrice'],
IdTypeDisplay: parsedJson['IdTypeDisplay'],
ValueDisplay: parsedJson['ValueDisplay'],
TotalPriceDisplay: parsedJson['TotalPriceDisplay'],
Rating: parsedJson['Rating'],
IdProductHomePageType: parsedJson['IdProductHomePageType'],
IsNewProduct: parsedJson['IsNewProduct'],
IsAuction: parsedJson['IsAuction'],
IsSpecial: parsedJson['IsSpecial'],
IdProduct: parsedJson['IdProduct'],
IdProductInventory: parsedJson['IdProductInventory'],
TedadDarBag: parsedJson['TedadDarBag'],
HomePageType: parsedJson['HomePageType']
);
}
}
https://vatanbgs.com/Api/GetListProductHomePageSelect?IdCustomer=00000000-0000-0000-0000-000000000000
با post خروجی ببنید
من چطوری این در فلاتر بتونم map کنم
این مپ من کار نمیکند
class HomePageViewMobileModel {
List<HomePageViewModel> Type1 = new List<HomePageViewModel>();
List<HomePageViewModel> Type2 = new List<HomePageViewModel>();
List<HomePageViewModel> Type3 = new List<HomePageViewModel>();
List<HomePageViewModel> Type4 = new List<HomePageViewModel>();
List<HomePageViewModel> Type5 = new List<HomePageViewModel>();
List<SlideShowViewModel> SlideShow = new List<SlideShowViewModel>();
HomePageViewMobileModel({
this.Type1 ,
this.Type2 ,
this.Type3 ,
this.Type4 ,
this.Type5 ,
this.SlideShow ,
});
factory HomePageViewMobileModel.fromJson(Map<String, dynamic> parsedJson){
return HomePageViewMobileModel(
Type1: parsedJson['Type1'],
Type2: parsedJson['Type2'],
Type3: parsedJson['Type3'],
Type4: parsedJson['Type4'],
Type5: parsedJson['Type5'],
SlideShow: parsedJson['SlideShow'],
);
}
}
class SlideShowViewModel
{
int Id ;
String Title ;
String TitleBtnCick ;
String AddressUrl ;
String Image ;
DateTime CreateDate ;
bool IsActive ;
String SlideTypeName ;
int IdTypeSlider ;
SlideShowViewModel({
this.Id ,
this.Title ,
this.TitleBtnCick ,
this.AddressUrl ,
this.Image,
this.CreateDate ,
this.IsActive,
this.SlideTypeName ,
this.IdTypeSlider
});
factory SlideShowViewModel.fromJson(Map<String, dynamic> parsedJson){
return SlideShowViewModel(
Id: parsedJson['Id'],
Title: parsedJson['Title'],
TitleBtnCick: parsedJson['TitleBtnCick'],
AddressUrl: parsedJson['AddressUrl'],
Image: parsedJson['Image'],
CreateDate: parsedJson['CreateDate'],
IsActive: parsedJson['IsActive'],
SlideTypeName: parsedJson['SlideTypeName'],
IdTypeSlider: parsedJson['IdTypeSlider'],
);
}
}
class HomePageViewModel
{
int Inventory;
int MaxSelect;
String NameFa;
String NameEn;
String NameEnSlug;
String ImageName;
String Title;
String Alt;
int TotalPrice;
int IdTypeDisplay;
int ValueDisplay;
int TotalPriceDisplay;
int Rating;
int IdProductHomePageType;
bool IsNewProduct;
bool IsAuction;
bool IsSpecial;
int IdProduct;
int IdProductInventory;
int TedadDarBag;
String HomePageType;
HomePageViewModel({
this.Inventory,
this.MaxSelect,
this.NameFa,
this.NameEn,
this.NameEnSlug,
this.ImageName,
this.Title,
this.Alt,
this.TotalPrice,
this.IdTypeDisplay,
this.ValueDisplay,
this.TotalPriceDisplay,
this.Rating,
this.IdProductHomePageType,
this.IsNewProduct,
this.IsAuction,
this.IsSpecial,
this.IdProduct,
this.IdProductInventory,
this.TedadDarBag,
this.HomePageType,
});
factory HomePageViewModel.fromJson(Map<String, dynamic> parsedJson){
return HomePageViewModel(
Inventory: parsedJson['Inventory'],
MaxSelect: parsedJson['MaxSelect'],
NameFa: parsedJson['NameFa'],
NameEn: parsedJson['NameEn'],
NameEnSlug: parsedJson['NameEnSlug'],
ImageName: parsedJson['ImageName'],
Title: parsedJson['Title'],
Alt: parsedJson['Alt'],
TotalPrice: parsedJson['TotalPrice'],
IdTypeDisplay: parsedJson['IdTypeDisplay'],
ValueDisplay: parsedJson['ValueDisplay'],
TotalPriceDisplay: parsedJson['TotalPriceDisplay'],
Rating: parsedJson['Rating'],
IdProductHomePageType: parsedJson['IdProductHomePageType'],
IsNewProduct: parsedJson['IsNewProduct'],
IsAuction: parsedJson['IsAuction'],
IsSpecial: parsedJson['IsSpecial'],
IdProduct: parsedJson['IdProduct'],
IdProductInventory: parsedJson['IdProductInventory'],
TedadDarBag: parsedJson['TedadDarBag'],
HomePageType: parsedJson['HomePageType']
);
}
}