Closed NiiTyy closed 1 year ago
Hey @NiiTyy, If you want to show showcase inside a bottomsheet or a dialog, you will have to wrap you bottomsheet/dialog widget with ShowCaseWidget
because when show a bottomsheet, it builds widget on different BuildContext
.
So what you do is create a nullable BuildContext variable and set it inside the build method of new Builder which create for new ShowCaseWidget. And after calling of showBottomSheet add a postFrameCallback and start showcase inside it.
here what it would roughly look like,
BuildContext? buildContext;
showModalBottomSheet(
context: context,
builder: (_) => ShowCaseWidget(
builder: Builder(
builder: (showcaseContext) {
buildContext = showcaseContext;
return Center(
child: Showcase(
description: 'description',
key: key1,
child: Text('hello'),
),
);
},
),
),
);
WidgetsBinding.instance.addPostFrameCallback((_) {
if(buildContext != null) {
ShowCaseWidget.of(buildContext!).startShowCase([key1]);
}
});
This issue is being closed due to inactivity. Feel free to reopen this issue if the problem continues.
I want to showcase some elements inside the bottomsheet but I'm unable to do so for some reasons, can anyone share on how this is done? My code so far:
Custom Showcase.withWidget():
Trigger button: