please provide ShowCaseView context
Describe the bug When trying to start the showcase from initstate or else when trying to start the showcase on tap of floating action button getting an error of please provide ShowCaseView context
To Reproduce Steps to reproduce the behavior:
-
if trying to start the showCaseView from initstate
@override
void initState() { // TODO: implement initState
WidgetsBinding.instance.addPostFrameCallback((_) =>
ShowCaseWidget.of(context).startShowCase([_one,]),
);
super.initState();
}
OR
-
when trying to show ShowCaseView after onPressed event FloatingActionButton( onPressed: (){
ShowCaseWidget.of(context).startShowCase([_one,]); },),
-
Expected widget to highlight
Showcase( description: "xyz zyx yzdyjk uhr ", key: _one, child: Row( children: [ Text( "Balance", style: theme.headlineSmall?.copyWith( fontWeight: FontWeight.w500, fontSize: 21, ), ), ], ), ), -
We face an error
Exception: Please provide ShowCaseView context
Expected behavior Expected behavior was that the showCaseView would start and the widgets which where expected to be highlight would had been higlighted
I have the same issue!
Hi @sadhanDev @Strampt , It looks like ShowCaseWidget is wrapped in the same build method where you are trying to start the showcase. ShowCaseWidget needs to be in the parent of the widget where user is planning to start the showcase. so please transfer ShowCaseWidget to parent widget.
Also, please share the code snippet of ShowCaseWidget you used in the for further investigation of the issue.
same issue
[ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: Exception: Please provide ShowCaseView context
Hi @gauchok , Can you please provide code snippet in which you are facing this issue? I suspect that it happens because parent showcaseWidget is in same widget where it is being used.
Closing this issue for now, feel free to reopen this if the issue still you still face this issue in latest version of the package.