From 22b32d9fc36a303f7d47000f5dcd10d77ed98d0a Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Tue, 14 Apr 2020 15:25:13 +0200 Subject: [PATCH] PurchaseScreen: Make it kinda work in the dev flavour At least it appears and we don't get an error. This makes working on the screen easier as I like to use the 'prod' flavour for my own notes / journals. --- lib/screens/purchase_screen.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/screens/purchase_screen.dart b/lib/screens/purchase_screen.dart index fd02d665..5171ec59 100644 --- a/lib/screens/purchase_screen.dart +++ b/lib/screens/purchase_screen.dart @@ -47,7 +47,7 @@ class _PurchaseScreenState extends State { return const PurchaseLoadingScreen(); } var offering = _offerings.current; - var monthly = offering.monthly; + var monthly = offering?.monthly; // FIXME: This screen needs to be made way way more beautiful // It's an extrememly important screen @@ -85,8 +85,10 @@ class PurchaseButton extends StatelessWidget { @override Widget build(BuildContext context) { + var price = package != null ? package.product.priceString : "Dev Mode"; + return RaisedButton( - child: Text('Subscribe for ${package.product.priceString} / month'), + child: Text('Subscribe for $price / month'), onPressed: () async { try { var purchaserInfo = await Purchases.purchasePackage(package);