diff --git a/platform_channels/lib/src/pet_list_screen.dart b/platform_channels/lib/src/pet_list_screen.dart index c3b7b0056..b36a2b850 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);