yuamob
New member
- Apr 21, 2021
- 4
- 0
- 1
i am using active ecommerce flutter app v 1.2 and apk made suscessfully but when going to add products in cart it shows nothing .
when i run it using android studio it shows above error . in cart_response.dart
here is part of code.
on line 3 it shows
E/flutter (12807): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: type 'int' is not a subtype of type 'String'.
E/flutter (12807): #0 new CartItem.fromJson (package:active_ecommerce_flutter/data_model/cart_response.dart:70:51)
code is here:::
factory CartItem.fromJson(Map<String, dynamic> json) => CartItem(
id: json["id"] == null ? null : json["id"],
owner_id: json["owner_id"] == null ? null : json["owner_id"],
user_id: json["user_id"] == null ? null : json["user_id"],
product_id: json["product_id"] == null ? null : json["product_id"],
product_name: json["product_name"] == null ? null : json["product_name"],
product_thumbnail_image: json["product_thumbnail_image"] == null ? null : json["product_thumbnail_image"],
variation: json["variation"] == null ? null : json["variation"],
price: json["price"] == null ? null : json["price"].toDouble(),
currency_symbol: json["currency_symbol"] == null ? null : json["currency_symbol"],
tax: json["tax"] == null ? null : json["tax"].toDouble(),
shipping_cost: json["shipping_cost"] == null ? null : json["shipping_cost"].toDouble(),
quantity: json["quantity"] == null ? null : json["quantity"],
lower_limit: json["lower_limit"] == null ? null : json["lower_limit"],
upper_limit: json["upper_limit"] == null ? null : json["upper_limit"],
);
when i run it using android studio it shows above error . in cart_response.dart
here is part of code.
on line 3 it shows
E/flutter (12807): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: type 'int' is not a subtype of type 'String'.
E/flutter (12807): #0 new CartItem.fromJson (package:active_ecommerce_flutter/data_model/cart_response.dart:70:51)
code is here:::
factory CartItem.fromJson(Map<String, dynamic> json) => CartItem(
id: json["id"] == null ? null : json["id"],
owner_id: json["owner_id"] == null ? null : json["owner_id"],
user_id: json["user_id"] == null ? null : json["user_id"],
product_id: json["product_id"] == null ? null : json["product_id"],
product_name: json["product_name"] == null ? null : json["product_name"],
product_thumbnail_image: json["product_thumbnail_image"] == null ? null : json["product_thumbnail_image"],
variation: json["variation"] == null ? null : json["variation"],
price: json["price"] == null ? null : json["price"].toDouble(),
currency_symbol: json["currency_symbol"] == null ? null : json["currency_symbol"],
tax: json["tax"] == null ? null : json["tax"].toDouble(),
shipping_cost: json["shipping_cost"] == null ? null : json["shipping_cost"].toDouble(),
quantity: json["quantity"] == null ? null : json["quantity"],
lower_limit: json["lower_limit"] == null ? null : json["lower_limit"],
upper_limit: json["upper_limit"] == null ? null : json["upper_limit"],
);
The android app code here which you are using to develop the app
Last edited: