PurchaseSlider: Fix it

It was a bit wonky
This commit is contained in:
Vishesh Handa
2020-08-12 18:50:10 +02:00
parent 35985fb8d2
commit 21447a09e0

View File

@ -97,8 +97,15 @@ class _PurchaseWidgetState extends State<PurchaseWidget> {
Log.e("IAP queryProductDetails: ${response.error}");
}
var products = response.productDetails;
products.sort((a, b) => a.price.compareTo(b.price));
Log.i("Products: ${products.map((e) => '${e.id} ${e.price}')}");
products.sort((a, b) {
var pa = _fromProductDetail(a);
var pb = _fromProductDetail(b);
return pa.value.compareTo(pb.value);
});
Log.i("Products: ${products.length}");
for (var p in products) {
Log.i("Product ${p.id} -> ${p.price}");
}
// If the widget was removed from the tree while the asynchronous platform
// message was in flight, we want to discard the reply rather than calling