Browse Source

fixed setstate() called after dispose error

ashilkn 2 years ago
parent
commit
91fa181647
1 changed files with 3 additions and 1 deletions
  1. 3 1
      lib/ui/payment/subscription_page.dart

+ 3 - 1
lib/ui/payment/subscription_page.dart

@@ -172,7 +172,9 @@ class _SubscriptionPageState extends State<SubscriptionPage> {
       }).toList();
       _freePlan = billingPlans.freePlan;
       _hasLoadedData = true;
-      setState(() {});
+      if (mounted) {
+        setState(() {});
+      }
     });
   }