浏览代码

fixed setstate() called after dispose error

ashilkn 2 年之前
父节点
当前提交
91fa181647
共有 1 个文件被更改,包括 3 次插入1 次删除
  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();
       }).toList();
       _freePlan = billingPlans.freePlan;
       _freePlan = billingPlans.freePlan;
       _hasLoadedData = true;
       _hasLoadedData = true;
-      setState(() {});
+      if (mounted) {
+        setState(() {});
+      }
     });
     });
   }
   }