When using AppinioSwiper with a AppinioSwiperController, if parent widget is rebuilt (for instance with a StreamBuilder & a ValueKey), then using the controller will throw :
======== Exception caught by foundation library =================
The following assertion was thrown while dispatching notifications for AppinioSwiperController:
**This widget has been unmounted, so the State no longer has a context (and should be considered defunct).**
Consider canceling any active work during "dispose" or using the "mounted" getter to determine if the State is still active.
When the exception was thrown, this was the stack:
#0 State.context.<anonymous closure> (package:flutter/src/widgets/framework.dart:951:9)
#1 State.context (package:flutter/src/widgets/framework.dart:957:6)
#2 _AppinioSwiperState.initState.<anonymous closure> (package:appinio_swiper/appinio_swiper.dart:193:32)
#3 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart:403:24)
#4 AppinioSwiperController.swipeRight (package:appinio_swiper/controllers.dart:24:5)
#5 _InkResponseState.handleTap (package:flutter/src/material/ink_well.dart:1154:21)
...
The AppinioSwiperController sending notification was: Instance of 'AppinioSwiperController'
=============================================================
I don't know if it's related to this, but in any case you should implement didUpdateWidget and/or didChangeDependencies to update the controller.
Hey @Nico04 , All the issues you have created will be resolved in the next version which will be available next week. Thank you so much for creating github issues.
When using
AppinioSwiper
with aAppinioSwiperController
, if parent widget is rebuilt (for instance with aStreamBuilder
& aValueKey
), then using the controller will throw :I don't know if it's related to this, but in any case you should implement
didUpdateWidget
and/ordidChangeDependencies
to update the controller.