3

Am using the showcase_view package and following everything mentioned in the example but it is not working at all not showing the showcase and also not showing an error.

Here is my code :


  final _searchShowcase = GlobalKey();
  BuildContext myContext;

  void initState() {
    WidgetsBinding.instance.addPostFrameCallback((_) {
      ShowCaseWidget.of(myContext).startShowCase([_searchShowcase]);
    super.initState();
       }

  @override
  Widget build(BuildContext context) {
        return  ShowCaseWidget(
      builder: Builder(builder: (context){
        myContext =context;
        return Scaffold(
            body: SingleChildScrollView(
              controller: _scrollController,
              child: Container(
                  padding: EdgeInsets.only(bottom: 30, top: 30),
                  child: StickyHeader(
                    header: Showcase(
                        key: _searchShowcase,
                        title: '${translator.translate("search")}',
                        description: '${translator.translate("search")}',
                        child: SearchBarWidget()
                    ),
                    content:Column(....)
                    );
               );}




And the screen just opens normally without showing the showcase view or even doing any action.. where is the mistake here?

Ahmed Wagdi
  • 3,913
  • 10
  • 50
  • 116

1 Answers1

0
  1. Make sure ShowCaseWidget is as close to root(MaterialApp/CupertinoApp) as possible.

https://stackoverflow.com/a/70879957/18645340 [Check this for more info]

  1. Check the context.

Hope it helps!

Clevino Alrin
  • 204
  • 2
  • 9