From 7ee0f274778d75fc19e5e292ab2c82687a903403 Mon Sep 17 00:00:00 2001 From: Philipp Bauer Date: Sun, 22 Jan 2023 16:08:40 +0100 Subject: [PATCH] Product: Add missing currencyCode --- example/lib/product_listview.dart | 2 +- lib/src/utils/product.dart | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/example/lib/product_listview.dart b/example/lib/product_listview.dart index 62fd1ae..c54a294 100644 --- a/example/lib/product_listview.dart +++ b/example/lib/product_listview.dart @@ -47,7 +47,7 @@ class ProductListViewState extends State { color: Colors.black54, fontWeight: FontWeight.bold, fontSize: 18)), - subtitle: Text(listProducts[pos].price, + subtitle: Text(listProducts[pos].price + " (currencyCode: "+ listProducts[pos].currencyCode + ")", style: const TextStyle( fontWeight: FontWeight.normal, fontSize: 15)), diff --git a/lib/src/utils/product.dart b/lib/src/utils/product.dart index f5f4fc9..addc6fe 100644 --- a/lib/src/utils/product.dart +++ b/lib/src/utils/product.dart @@ -3,13 +3,15 @@ class Product { String id; String price; String title; - Product(this.id, this.price, this.title); + String currencyCode; + + Product(this.id, this.price, this.title, this.currencyCode); factory Product.fromJson(dynamic json) { print(json); return Product(json['productId'] as String, json['productPrice'] as String, - json['productTitle'] as String); + json['productTitle'] as String, json['currencyCode'] as String); } }