flutter_showcaseview icon indicating copy to clipboard operation
flutter_showcaseview copied to clipboard

please provide ShowCaseView context

Open sadhanDev opened this issue 3 years ago • 4 comments

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:

  1. 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

  1. when trying to show ShowCaseView after onPressed event FloatingActionButton( onPressed: (){

       ShowCaseWidget.of(context).startShowCase([_one,]);
    
     },
    

    ),

  2. 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,
                                                     ),
                                                   ),                            
                                                 ],
                                               ),
                                             ),
    
  3. 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

sadhanDev avatar Aug 17 '22 06:08 sadhanDev

I have the same issue!

Strampt avatar Aug 18 '22 15:08 Strampt

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.

vatsaltanna avatar Aug 20 '22 16:08 vatsaltanna

same issue

[ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: Exception: Please provide ShowCaseView context

gauchok avatar Sep 06 '22 20:09 gauchok

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.

vatsaltanna avatar Oct 01 '22 16:10 vatsaltanna