fix price cast
parent
9d10e06104
commit
9e9e9053bc
|
|
@ -17,8 +17,8 @@ class GoodResponse {
|
||||||
String name = '';
|
String name = '';
|
||||||
String? ean;
|
String? ean;
|
||||||
int? articul;
|
int? articul;
|
||||||
int? price;
|
double? price;
|
||||||
int? optPrice;
|
double? optPrice;
|
||||||
double? basePrice;
|
double? basePrice;
|
||||||
int? divisible;
|
int? divisible;
|
||||||
String? updatedAt;
|
String? updatedAt;
|
||||||
|
|
@ -30,9 +30,9 @@ class GoodResponse {
|
||||||
goodResponseBean.name = map['name'] as String;
|
goodResponseBean.name = map['name'] as String;
|
||||||
goodResponseBean.ean = map['ean'] as String;
|
goodResponseBean.ean = map['ean'] as String;
|
||||||
goodResponseBean.articul = map['articul'] as int;
|
goodResponseBean.articul = map['articul'] as int;
|
||||||
goodResponseBean.price = map['price'] as int;
|
goodResponseBean.price = (cast<num>(map['price']) ?? 0).toDouble() ;
|
||||||
goodResponseBean.optPrice = map['opt_price'] as int;
|
goodResponseBean.optPrice = (cast<num>(map['opt_price']) ?? 0).toDouble();
|
||||||
goodResponseBean.basePrice = cast<double>(map['base_price']);
|
goodResponseBean.basePrice = (cast<num>(map['base_price']) ?? 0).toDouble();
|
||||||
goodResponseBean.divisible = map['divisible'] as int;
|
goodResponseBean.divisible = map['divisible'] as int;
|
||||||
goodResponseBean.updatedAt = map['updated_at'] as String;
|
goodResponseBean.updatedAt = map['updated_at'] as String;
|
||||||
return goodResponseBean;
|
return goodResponseBean;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue