From 72a4cf5f2e9744e3b6a8c3e7bd8afc4583cd4064 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rulong=20Chen=EF=BC=88=E9=99=88=E6=B1=9D=E9=BE=99=EF=BC=89?= Date: Wed, 19 Oct 2022 10:22:51 +0800 Subject: [PATCH] Fixes exception in platform_channels --- platform_channels/lib/src/pet_list_screen.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform_channels/lib/src/pet_list_screen.dart b/platform_channels/lib/src/pet_list_screen.dart index c3b7b0056d1..b36a2b8509b 100644 --- a/platform_channels/lib/src/pet_list_screen.dart +++ b/platform_channels/lib/src/pet_list_screen.dart @@ -20,8 +20,8 @@ class _PetListScreenState extends State { final scaffoldKey = GlobalKey(); @override - void initState() { - super.initState(); + void didChangeDependencies() { + super.didChangeDependencies(); // Receives a string of json object from the platform and converts it // to PetModel. final scaffoldMessenger = ScaffoldMessenger.of(context);