-
Notifications
You must be signed in to change notification settings - Fork 522
Open
Labels
Description
Describe the bug
With the new structure in v5 I get these kind of errors now and then
ββββββββ Exception caught by widgets library βββββββββββββββββββββββββββββββββββ
The following assertion was thrown building Expanded(flex: 1):
Please register [ShowcaseView] first by calling [ShowcaseView.register()]
Failed assertion: line 177 pos 7: 'controller != null'
This is probably because there seems to be no way to detect if the controller is loaded. So it happens that the guidedtour starts when the showcaseview does not have its controller ready.
Maybe the register function should be async or have a callback when ready so you know it is safe to start the tour.
To Reproduce
Steps to reproduce the behavior:
@override
void initState() {
super.initState();
ShowcaseView.register(
disableMovingAnimation: true,
onFinish: () {
guidedTourCompleter.complete();
},
);
WidgetsBinding.instance.addPostFrameCallback((_) {
startGuidedTour();
});
}