Giter Club home page Giter Club logo

simformsolutionspvtltd / flutter_showcaseview Goto Github PK

View Code? Open in Web Editor NEW
1.4K 16.0 384.0 10.67 MB

Flutter plugin that allows you to showcase your features on flutter application. ๐Ÿ‘Œ๐Ÿ”๐ŸŽ‰

Home Page: https://pub.dev/packages/showcaseview

License: MIT License

Swift 0.72% Objective-C 0.03% Dart 67.93% Shell 0.77% Kotlin 0.09% HTML 2.63% CMake 10.16% C++ 17.10% C 0.58%
flutter android ios showcaseview showcaseview-library dart flutter-plugin highlight spotlight package

flutter_showcaseview's Introduction

Showcaes View - Simform LLC.

ShowCaseView

Build showcaseview

A Flutter package allows you to Showcase/Highlight your widgets step by step.

Preview

The example app running in Android

Migration guide for release 2.0.0

Renamed properties/fields of widgets mentioned below in the table.

Before After
autoPlayLockEnable enableAutoPlayLock
shapeBorder targetShapeBorder
showcaseBackgroundColor tooltipBackgroundColor
contentPadding tooltipPadding
overlayPadding targetPadding
radius targetBorderRadius
tipBorderRadius tooltipBorderRadius
disableAnimation disableMovingAnimation
animationDuration movingAnimationDuration

Removed unused parameter of Showcase.withWidget() mentioned below:

  • title
  • titleAlignment
  • titleTextStyle
  • description
  • descriptionAlignment
  • descTextStyle
  • textColor
  • tooltipBackgroundColor
  • tooltipBorderRadius
  • tooltipPadding

Installing

  1. Add dependency to pubspec.yaml

    Get the latest version in the 'Installing' tab on pub.dev

dependencies:
    showcaseview: <latest-version>
  1. Import the package
import 'package:showcaseview/showcaseview.dart';
  1. Adding a ShowCaseWidget widget.
ShowCaseWidget(
  builder: Builder(
    builder : (context)=> Somewidget()
  ),
),
  1. Adding a Showcase widget.
GlobalKey _one = GlobalKey();
GlobalKey _two = GlobalKey();
GlobalKey _three = GlobalKey();

...

Showcase(
  key: _one,
  title: 'Menu',
  description: 'Click here to see menu options',
  child: Icon(
    Icons.menu,
    color: Colors.black45,
  ),
),

Showcase.withWidget(
  key: _three,
  height: 80,
  width: 140,
  targetShapeBorder: CircleBorder(),
  container: Column(
    crossAxisAlignment: CrossAxisAlignment.start,
    children: <Widget>[
      ...
    ],
  ),
  child: ...,
),
  1. Starting the ShowCase
someEvent(){
    ShowCaseWidget.of(context).startShowCase([_one, _two, _three]);
}

If you want to start the ShowCaseView as soon as your UI built up then use below code.

WidgetsBinding.instance.addPostFrameCallback((_) =>
  ShowCaseWidget.of(context).startShowCase([_one, _two, _three])
);

Functions of ShowCaseWidget.of(context):

Function Name Description
startShowCase(List widgetIds) Starting the showcase
next() Starts next showcase
previous() Starts previous showcase
dismiss() Dismisses all showcases

Properties of ShowCaseWidget:

Name Type Default Behaviour Description
builder Builder
blurValue double 0 Provides blur effect on overlay
autoPlay bool false Automatically display Next showcase
autoPlayDelay Duration Duration(milliseconds: 2000) Visibility time of showcase when autoplay is enabled
enableAutoPlayLock bool false Block the user interaction on overlay when autoPlay is enabled.
enableAutoScroll bool false Allows to auto scroll to next showcase so as to make the given target visible.
scrollDuration Duration Duration(milliseconds: 300) Time duration for auto scrolling
disableBarrierInteraction bool false Disable barrier interaction
disableScaleAnimation bool false Disable scale transition for all showcases
disableMovingAnimation bool false Disable bouncing/moving transition for all showcases
onStart Function(int?, GlobalKey)? Triggered on start of each showcase.
onComplete Function(int?, GlobalKey)? Triggered on completion of each showcase.
onFinish VoidCallback? Triggered when all the showcases are completed
enableShowcase bool true Enable or disable showcase globally.

Properties of Showcase and Showcase.withWidget:

Name Type Default Behaviour Description Showcase ShowCaseWidget
key GlobalKey Unique Global key for each showcase. โœ… โœ…
child Widget The Target widget that you want to be showcased โœ… โœ…
title String? Title of default tooltip โœ…
description String? Description of default tooltip โœ…
container Widget? Allows to create custom tooltip widget. โœ…
height double? Height of custom tooltip widget โœ…
width double? Width of custom tooltip widget โœ…
titleTextStyle TextStyle? Text Style of title โœ…
descTextStyle TextStyle? Text Style of description โœ…
titleAlignment TextAlign TextAlign.start Alignment of title โœ…
descriptionAlignment TextAlign TextAlign.start Alignment of description โœ…
targetShapeBorder ShapeBorder If targetBorderRadius param is not provided then it applies shape border to target widget โœ… โœ…
targetBorderRadius BorderRadius? Border radius of target widget โœ… โœ…
tooltipBorderRadius BorderRadius? BorderRadius.circular(8.0) Border radius of tooltip โœ…
blurValue double? ShowCaseWidget.blurValue Gaussian blur effect on overlay โœ… โœ…
tooltipPadding EdgeInsets EdgeInsets.symmetric(vertical: 8, horizontal: 8) Padding to tooltip content โœ…
targetPadding EdgeInsets EdgeInsets.zero Padding to target widget โœ… โœ…
overlayOpacity double 0.75 Opacity of overlay layer โœ… โœ…
overlayColor Color Colors.black45 Color of overlay layer โœ… โœ…
tooltipBackgroundColor Color Colors.white Background Color of default tooltip โœ…
textColor Color Colors.black Color of tooltip text โœ…
scrollLoadingWidget Widget Loading widget on overlay until active showcase is visible to viewport when autoScroll is enable โœ… โœ…
movingAnimationDuration Duration Duration(milliseconds: 2000) Duration of time this moving animation should last. โœ… โœ…
showArrow bool true Shows tooltip with arrow โœ…
disableDefaultTargetGestures bool false disable default gestures of target widget โœ… โœ…
disposeOnTap bool? false Dismiss all showcases on target/tooltip tap โœ… โœ…
disableMovingAnimation bool? ShowCaseWidget.disableMovingAnimation Disable bouncing/moving transition โœ… โœ…
disableScaleAnimation bool? ShowCaseWidget.disableScaleAnimation Disable initial scale transition when showcase is being started and completed โœ…
scaleAnimationDuration Duration Duration(milliseconds: 300) Duration of time scale animation should last. โœ…
scaleAnimationCurve Curve Curves.easeIn Curve to use in scale animation. โœ…
scaleAnimationAlignment Alignment? Origin of the coordinate in which the scale takes place, relative to the size of the box. โœ…
onToolTipClick VoidCallback? Triggers when tooltip is being clicked. โœ…
onTargetClick VoidCallback? Triggers when target widget is being clicked โœ… โœ…
onTargetDoubleTap VoidCallback? Triggers when target widget is being double clicked โœ… โœ…
onTargetLongPress VoidCallback? Triggers when target widget is being long pressed โœ… โœ…
onBarrierClick VoidCallback? Triggers when barrier is clicked โœ… โœ…
tooltipPosition TooltipPosition? Defines vertical position of tooltip respective to Target widget โœ… โœ…
titlePadding EdgeInsets? EdgeInsets.zero Padding to title โœ…
descriptionPadding EdgeInsets? EdgeInsets.zero Padding to description โœ…
titleTextDirection TextDirection? Give textDirection to title โœ…
descriptionTextDirection TextDirection? Give textDirection to description โœ…
descriptionTextDirection TextDirection? Give textDirection to description โœ…
disableBarrierInteraction bool false Disables barrier interaction for a particular showCase โœ… โœ…
toolTipSlideEndDistance double 7 Defines motion range for tooltip slide animation โœ… โœ…

How to use

Check out the example app in the example directory or the 'Example' tab on pub.dartlang.org for a more complete example.

Scrolling to active showcase

Auto Scrolling to active showcase feature will not work properly in scroll views that renders widgets on demand(ex, ListView, GridView).

In order to scroll to a widget it needs to be attached with widget tree. So, If you are using a scrollview that renders widgets on demand, it is possible that the widget on which showcase is applied is not attached in widget tree. So, flutter won't be able to scroll to that widget.

So, If you want to make a scroll view that contains less number of children widget then prefer to use SingleChildScrollView.

If using SingleChildScrollView is not an option, then you can assign a ScrollController to that scrollview and manually scroll to the position where showcase widget gets rendered. You can add that code in onStart method of ShowCaseWidget.

Example,

// This controller will be assigned to respected sctollview.
final _controller = ScrollController();

ShowCaseWidget(
  onStart: (index, key) {
    if(index == 0) {
      WidgetsBinding.instance.addPostFrameCallback((_) {
       // If showcase widget is at offset 1000 in the listview.
       // If you don't know the exact position of the showcase widget,
       // You can provide nearest possible location.
       // 
       // In this case providing 990 instead of 1000 will work as well.
        _controller.jumpTo(1000);
      });
    }
  },
);

Main Contributors


Birju Vachhani

Devarsh Ranpara

Ankit Panchal

Kashifa Laliwala

Vatsal Tanna

Sanket Kachhela

Parth Baraiya

Shweta Chauhan

Dhaval Kansara

Happy Makadiya

Ujas Majithiya

Aditya Chavda

Sahil Totala

License

MIT License

Copyright (c) 2021 Simform Solutions

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

flutter_showcaseview's People

Contributors

aditya-css avatar ankitpanchal10 avatar birjuvachhani avatar devarshranpara avatar devarshranpara-simformsolutions avatar dhaval-k-simformsolutions avatar dhavalrkansara avatar dhvanit-v-simformsolutions avatar faiyaz-shaikh avatar fynntimes avatar happymakadiyas avatar jaiminrana05 avatar kashifalaliwala avatar meetjanani avatar mehulkk avatar nilsreichardt avatar npvaddoriya avatar p-b1101 avatar pablojimpas avatar parthbaraiya avatar prbaraiya avatar robertheim avatar sahil-simform avatar sanket-simform avatar shwetachauhan18 avatar simform-solutions avatar ujas-m-simformsolutions avatar vatsaltanna avatar vatsaltanna-simformsolutions avatar vipulasri avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flutter_showcaseview's Issues

Size and position

Describe the bug
In BottomNavigationBar, 2nd item has large description box size, the third one becomes vertical.

Expected behaviour
All showcases should be of the same size.

Screenshots
In this, it's perfect!
Screenshot_20201211-075531

In this, the horizontal padding increases.
Screenshot_20201211-075533

In this, idk what happened to it!
Screenshot_20201211-075536

And in this, it becomes normal again.
Screenshot_20201211-075542

Desktop (please complete the following information):

  • OS: [e.g. UBUNTU]

Smartphone (please complete the following information):

  • Device: [e.g. OnePlus 7T]
  • OS: [e.g. Android 10]

Getting NoSuchMethodError

When I try to add a showcase widget in my app, I get the the NoSuchMethodError.
GlobalKey _swipeKey = GlobalKey();

@override void initState() { super.initState(); WidgetsBinding.instance.addPostFrameCallback((_) =>ShowCaseWidget.startShowCase(context, [_swipeKey]));}

NoSuchMethodError: The getter 'activeWidgetIds' was called on null.

Update README

First of all, thanks for great plugin.
But please update readme (and other docs if any) to reflect changes you've made in API.
Current code snippets don't work.

Also, I've lost half an hour fighting with MethodNotFound exception, even after reading docs and seeing issue #9
My mistake yes, but I was really close to removing plugin and leaving everything behind.

Since I'm obviously not only one, README should be more explicit and clear about need of ShowCaseWidget.

Once again, great plugin, thanks.

The getter 'activeWidgetIds' was called on null

Im getting this error when I tried use it:

The following NoSuchMethodError was thrown building MediaQuery(MediaQueryData(size: Size(411.4, 683.4), devicePixelRatio: 2.6, textScaleFactor: 1.0, platformBrightness: Brightness.light, padding: EdgeInsets.zero, viewPadding: EdgeInsets.zero, viewInsets: EdgeInsets.zero, alwaysUse24HourFormat: false, accessibleNavigation: false, disableAnimations: false, invertColors: false, boldText: false)):
The getter 'activeWidgetIds' was called on null.
Receiver: null
Tried calling: activeWidgetIds
When the exception was thrown, this was the stack: 
#0      Object.noSuchMethod (dart:core-patch/object_patch.dart:50:5)
#1      ShowCaseWidget.activeTargetWidget (package:showcaseview/showcase_widget.dart:14:10)
#2      _ShowcaseState.showOverlay (package:showcaseview/showcase.dart:143:43)
#3      _ShowcaseState.didChangeDependencies (package:showcaseview/showcase.dart:136:5)
#4      StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4051:12)

Doctor:

Doctor summary (to see all details, run flutter doctor -v):
[โœ“] Flutter (Channel stable, v1.7.8+hotfix.4, on Mac OS X 10.13.6 17G8030, locale pt-BR)
[โœ“] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[โœ“] Xcode - develop for iOS and macOS (Xcode 10.1)
[โœ“] iOS tools - develop for iOS devices
[โœ“] Android Studio (version 3.5)
[โœ“] VS Code (version 1.38.0)
[โœ“] Connected device (1 available)

Exception: Please provide ShowCaseView context

@OverRide
void initState() {
bloc = BlocProvider.of(context);
homeBloc = HomeFeedBloc(authenticationBloc: bloc.authenticationBloc);
profileBloc = ProfileBloc();
controller = PageController(initialPage: 0, keepPage: true);
trendBloc = TrendBloc();
affiliatedProductMenuBloc = AffiliatedProductMenuBloc();
super.initState();
WidgetsBinding.instance
.addPostFrameCallback((
) => ShowCaseWidget.of(context).startShowCase([
_one,
]));
}
@OverRide
Widget build(BuildContext context) {
return ShowCaseWidget(
builder: Builder(
builder: (context) => Scaffold(
backgroundColor: ColorResource.BLACKF9,
bottomNavigationBar: FABBottomAppBar(
color: ColorResource.BLACKB7,
selectedColor: Colors.black,
notchedShape: CircularNotchedRectangle(),
onTabSelected: (page) {
setState(() {
selectedIndex = page;
});
if (page == 0) {
if (!(homeBloc.state is HomeFeedDataLoadingState))
this.homeBloc.add(HomeFeedRefreshEvent());
}
bloc.add(HomeUserConatinerPageChangeEvent(page));
},
items: [
FABBottomAppBarItem(
iconData: Icons.home,
text: '',
color: selectedIndex == 0
? Colors.black
: ColorResource.BLACKB7),
FABBottomAppBarItem(
iconData: Icons.trending_up,
text: '',
color: selectedIndex == 1
? Colors.black
: ColorResource.BLACKB7),
FABBottomAppBarItem(
iconData: Icons.shopping_basket,
text: '',
color: selectedIndex == 2
? Colors.black
: ColorResource.BLACKB7),
FABBottomAppBarItem(
iconData: Icons.more_horiz,
text: '',
color: selectedIndex == 3
? Colors.black
: ColorResource.BLACKB7),
],
),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerDocked,
floatingActionButton: _buildFabImage(
context), // This trailing comma makes auto-formatting nicer for build methods.
appBar: AppBar(
automaticallyImplyLeading: false,
backgroundColor: Colors.white,
elevation: 0.0,
centerTitle: true,
title: ToolbarTitle(
StringResource.APP_NAME,
font: Font.Yesteryear,
fontSize: 29,
),
actions: [
Image.asset(
ImageConstant.NOTIFICATION,
height: 18,
width: 18,
),
SizedBox(
width: 16,
),
InkWell(
onTap: () {
Navigator.of(context).pushNamed(AppRoutes.viewed_product);
},
child: Image.asset(
ImageConstant.HISTORY,
height: 17,
width: 19,
),
),
SizedBox(
width: 16,
)
],
),
body: WillPopScope(
onWillPop: onWillPop,
child: BlocListener(
bloc: bloc,
listener: (BuildContext context, HomeUserConatinerState state) {
if (state is HomeUserConatinerPageChangeState) {
_controller.animateToPage(bloc.page,
curve: Curves.linear,
duration: Duration(milliseconds: 250));
}
},
child: _buidPage(),
),
),
),
),
);

Widget _buildFabImage(BuildContext context) {
return Showcase(
key: _one,
description: 'Tap to check mail',
child: FloatingActionButton(
onPressed: () {
Navigator.pushNamed(context, AppRoutes.createPost,
arguments: homeBloc);
},
tooltip: 'Increment',
child: Image.asset(ImageConstant.POST_BUTTON),
elevation: 2.0,
));
}

this error:
ShowCaseWidget.of (package:showcaseview/showcase_widget.dart:21:7)
Syncing files to device vivo 1908...
I/flutter ( 6402): #1 _HomeUserContainerState.initState. (package:girlsourced/src/home/user/home_user_container/home_user_container.dart:68:53)
Syncing files to device vivo 1908...
I/flutter ( 6402): #2 SchedulerBinding._invokeFrameCallback
(package:flutter/src/scheduler/binding.dart:1033:15)
Syncing files to device vivo 1908...
I/flutter ( 6402): #3 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:983:9)
Syncing files to device vivo 1908...
I/flutter ( 6402): #4 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:891:5)
Syncing files to device vivo 1908...
I/flutter ( 6402): #5 _rootRun (dart:async/zone.dart:1124:13)
Syncing files to device vivo 1908...
I/flutter ( 6402): #6 _CustomZone.run (dart:async/zone.dart:1021:19)
Syncing files to device vivo 1908...
I/flutter ( 6402): #7 _CustomZone.runGuarded (dart:async/zone.dart:923:7)
Syncing files to device vivo 1908...
I/flutter ( 6402): #8 _invoke (dart:ui/hooks.dart:249:10)
Syncing files to device vivo 1908...
I/flutter ( 6402): #9 _drawFrame (dart:ui/hooks.dart:207:3

Description overlap

MyCode:

Showcase(
key: _two,
shapeBorder: CircleBorder(),
descTextStyle: TextStyle(
color: Colors.white,
fontSize: 16,
fontFamily: Font.RobotoRegular.value),
showcaseBackgroundColor: ColorResource.PINK,
description:
" Or choose outfits from retail partners that suit your occasion.",
child: Image.asset(
ImageConstant.CART_ICON,
height: 59,
width: 59,
),
),
check this url
https://ibb.co/1bJ8xMk

Crash on hot reload

Describe the bug
Showcase View is causing hot reload to crash the app.

To Reproduce
Steps to reproduce the behavior:

  1. Change a widget.
  2. Hit reload.
  3. App crashes with below exception.

iOS and android. Simulator and physical devices.

Reloaded 7 of 1406 libraries in 2,257ms.
[VERBOSE-2:shell.cc(210)] Dart Unhandled Exception: This widget has been unmounted, so the State no longer has a context (and should be considered defunct).
Consider canceling any active work during "dispose" or using the "mounted" getter to determine if the State is still active., stack trace: #0      State.context.<anonymous closure>
package:flutter/โ€ฆ/widgets/framework.dart:1090
#1      State.context
package:flutter/โ€ฆ/widgets/framework.dart:1096
#2      _OverlayBuilderState.addToOverlay
package:showcaseview/layout_overlays.dart:165
#3      _OverlayBuilderState.showOverlay
package:showcaseview/layout_overlays.dart:157
#4      _OverlayBuilderState.syncWidgetAndOverlay
package:showcaseview/layout_overlays.dart:183
#5      _OverlayBuilderState.reassemble.<anonymous closure>
package:showcaseview/layout_overlays.dart:137
#6      SchedulerBinding._invokeFrameCallback
package:flutter/โ€ฆ/scheduler/binding.dart:1117
#7      SchedulerBinding.handleDrawFrame (package:flutter<โ€ฆ>

I'm not sure what to make of this. Does anyone have a good way of implementing the "mounted" feature mentioned in the exception? I have implemented the ShowCaseWidget like so...


return Builder(
          builder: (context) => (maskCategoryList.isNotEmpty ||
                  favouriteMask != null)
              ? ShowCaseWidget(
                  builder: Builder(builder: (context) {
                    WidgetsBinding.instance.addPostFrameCallback((_) async {
                      if (context
                              .read<UserDataRepo>()
                              .showCaseMap['maskHome'] !=
                          true) {
                        context.read<UserDataRepo>().setShowCase('maskHome');
                        return Future.delayed(Duration(milliseconds: 500)).then(
                            (value) => ShowCaseWidget.of(context).startShowCase(
                                [favouriteText, maskCategoryTile]));
                      }
                    });

                    return Padding(

Exception:BoxConstraints has NaN values

Hi,My first Flutter APP is using showcaseview widget
here is my code

Row(
            mainAxisAlignment: MainAxisAlignment.spaceEvenly,
            children: <Widget>[
              Showcase.withWidget(
                key: _myBook,
                width: 300,
                height: 350,
                container: Card(
                  child: Padding(
                    padding: const EdgeInsets.fromLTRB(8, 10, 8, 10),
                    child: Text('ๅฐ่ฟช้˜…่ฏป่ฟ‡็š„็ป˜ๆœฌ้ƒฝ\nไผšๅœจ่ฟ™้‡Œ็œ‹ๅˆฐๅ“ฆ!'),
                  ),
                ),
                child: Icon(Icons.favorite),
   )])

,But I got some trouble,the console print some log
image

please do me a favor, thanks a lot!
below is the sdk version I'm using:
image

ShowCaseWidget.startShowCase is unknow.

When i try to use ShowCaseWidget.startShowCase like documentation. It is unknow.

When i try to use like the example, trow me: Exception: Please provide ShowCaseView context.

Disable animation on showcase widget

Thank you very much for this awesome package. Is there a way to disable the animation on the showcase widget? I have not been able to figure out how to do that.

Remove requirement for widgets to have activeWidgetIds

Widgets are reusable across the application, and some widgets in specific context may required to be showcased. Additionally, some widgets simply change behavior based on parameters passed.

I am suggesting to change following implementation in showcase_widget to:
static activeTargetWidget(BuildContext context) { return context .dependOnInheritedWidgetOfExactType<_InheritedShowCaseView>() ?.activeWidgetIds; }

Doing so does not break the UI in case a user intends to use Showcase(child: widget), but does not want to use ShowCaseView(builder: ...) for a specific scenario.

I keep getting this error when using ShowCaseView: The method 'findAncestorStateOfType' was called on null.

Describe the bug
A clear and concise description of what the bug is.
I have tried different ways, but I keep getting the following errors:

Performing hot reload...
Syncing files to device iPhone 11 Pro Max...
[VERBOSE-2:shell.cc(210)] Dart Unhandled Exception: NoSuchMethodError: The method 'findAncestorStateOfType' was called on null.
Receiver: null
Tried calling: findAncestorStateOfType(), stack trace: #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)
#1 Overlay.of (package:flutter/src/widgets/overlay.dart:258:19)
#2 _OverlayBuilderState.addToOverlay (package:showcaseview/layout_overlays.dart:165:13)
#3 _OverlayBuilderState.showOverlay (package:showcaseview/layout_overlays.dart:157:7)
#4 _OverlayBuilderState.syncWidgetAndOverlay (package:showcaseview/layout_overlays.dart:183:7)
#5 _OverlayBuilderState.reassemble. (package:showcaseview/layout_overlays.dart:137:57)
#6 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1117:15)
#7 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1063:9)
#8 SchedulerBinding.scheduleWarmUpFrame. (package:flut<โ€ฆ>

Additional context

From the error message we can see something wrong with showcaseview overlay, but I can't find ways to solve it. (I have searched on google and stackoverflow, but no results.

I closely followed the example code and also searched on other use case to apply this plugin, my code is similar like this one: https://stackoverflow.com/questions/60930636/how-can-i-use-show-case-view-in-flutter

The plugin is working (although it's not working as I expected, that can be feature suggestions, but as least it's working as the example shows). However I always get this error complain every time I start or hot reload.

When I remove all the code related with this plugin, I don't get any error complain, so it's definitely the plugin issue.

How can I solve this? does any of other people get same error like i do? is it something wrong with the plugin? thank you!

I am using the latest version of flutter and the plugin, every thing's version is the latest, I always upgrade as soon as I can.

When using addPostFrameCallback, exception occurs

Hi, we've encountered another interesting issue. When we have a startShowcase call within the addPostFrameCallback function within the build method, we get this stack trace and app crash. NOTE: if we start the app with the transition screen set as the home screen of the MaterialApp, we do not get any errors and everything works as expected.

It seems to be hinting that the state that startShowcase relies on is null, but I'm not sure why that would be.


E/flutter (22985): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: NoSuchMethodError: The method 'startShowCase' was called on null.
E/flutter (22985): Receiver: null
E/flutter (22985): Tried calling: startShowCase(Instance(length:1) of '_GrowableList')
E/flutter (22985): #0      Object.noSuchMethod  (dart:core-patch/object_patch.dart:50:5)
E/flutter (22985): #1      ShowCaseWidget.startShowCase 
package:showcaseview/showcase_widget.dart:22

A long description overflows

Including a long description for the 'Showcase' widget makes the tooltip overflow to the right past the screen so that part of the tooltip is hidden.

Is there any recommendation on how to fix this?

Thanks!

Overlay is not displayed properly on web

To Reproduce
Steps to reproduce the behavior:

  1. Run the example project in flutter web

Expected behavior
The background is not greyed out while displaying the showcase.

Screenshots
showcaseview_bug

Desktop (please complete the following information):

  • OS: Windows
  • Browser: Chrome
  • Version: 85.0.4183.121
[โˆš] Flutter (Channel beta, 1.22.1, on Microsoft Windows [Version 10.0.18362.1082], locale en-IN)
    โ€ข Flutter version 1.22.1 at C:\src\flutter
    โ€ข Framework revision f30b7f4db9 (7 days ago), 2020-10-08 10:06:30 -0700
    โ€ข Engine revision 75bef9f6c8
    โ€ข Dart version 2.10.1


[โˆš] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    โ€ข Android SDK at C:\Users\I524760\AppData\Local\Android\sdk
    โ€ข Platform android-30, build-tools 30.0.2
    โ€ข Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    โ€ข Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    โ€ข All Android licenses accepted.

[โˆš] Chrome - develop for the web
    โ€ข Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[โˆš] Android Studio (version 4.0)
    โ€ข Android Studio at C:\Program Files\Android\Android Studio
    โ€ข Flutter plugin version 48.1.2
    โ€ข Dart plugin version 193.7547
    โ€ข Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[โˆš] VS Code (version 1.50.0)
    โ€ข VS Code at C:\Users\I524760\AppData\Local\Programs\Microsoft VS Code
    โ€ข Flutter extension version 3.15.0

[โˆš] Connected device (3 available)
    โ€ข Web Server (web) โ€ข web-server โ€ข web-javascript โ€ข Flutter Tools
    โ€ข Chrome (web)     โ€ข chrome     โ€ข web-javascript โ€ข Google Chrome 85.0.4183.121
    โ€ข Edge (web)       โ€ข edge       โ€ข web-javascript โ€ข Microsoft Edge 86.0.622.38

โ€ข No issues found!

Doesn't work

This library simply doesn't work and the documentation for it is so poor, making it unusable. Please fix the ReadMe. Getting - "Please provide ShowCaseView context" for no reason.

How set position of container in Showcase.withWidget?

How I set the position of of "container" in Showcase.withWidget?
I'm trying to use a custom container but when the Widget is at the bottom of the screen the widget is not showed. If I use Showcase this problem not occurs.

Showcase isn't rendering responsively

Describe the bug
When I minimize the Web Application that is displaying a long text using the Showcase, instead of having a line break responsively, the text goes beyond the screen that is being displayed and is not fully shown to the user, it is only displayed if you increase the screen size.

To Reproduce
Steps to reproduce the behavior:

  1. Go to field 'description'
  2. Write a very long text '...'
  3. Debug the application with a small resolution 'minimize as much'
  4. See error

Expected behavior
I believe that there could be a line break in Showcase, so that everything is visible to the user without the need to maximize the size of the window.

Screenshots
In this, it's perfect!
should_be-showcase

But, when I minimize the Application:
error_showcase

Desktop (please complete the following information):

  • OS: [e.g. Windows 10]
  • Browser [e.g. chrome]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. Pixel 2 API 29]
  • OS: [e.g. Android 10]

Background dim does not work in some screens.

Describe the bug
The background dimming does not work on some screens .When i hot reload the current screen then dimming is shown or if we have multiple showcase then on the first showcase it does not show but on next showcase the dimming works.

Here is my code

class Task extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => _Task();
}

class _Task extends State<Task> {
  DateTime now = DateTime.now();

  GlobalKey _calendarKey = GlobalKey();

  
  BuildContext myContext;

  @override
  void initState() {
    super.initState();
    WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
      if (AppConfig.prefs.getBool('taskFinished') == null ||
          !AppConfig.prefs.getBool('taskFinished')) {
        ShowCaseWidget.of(myContext).startShowCase([
          _calendarKey,
        ]);
      }
    });
  }

  @override
  Widget build(BuildContext context) {
    return ShowCaseWidget(
      builder: Builder(builder: (context) {
        myContext =context;
        return Scaffold(
          backgroundColor: AppColor.appBg,
          appBar: MyAppBar(
            pageTitle: Strings.task,
            showBack: true,
          ),
          body: Stack(
            children: [
              /// Main Column
              Column(
                mainAxisSize: MainAxisSize.max,
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  /// Top Menu
                  CommonWidgets.getTopControlsWidget(context),

                  /// User Info
                  CommonWidgets.getUserWidget(),


                  /// Calendar
                  Showcase(
                    key: _calendarKey,
                    description: 'This is a calendar',
                    child: CalendarDatePicker(
                      lastDate: now,
                      firstDate: DateTime(2001, 01, 01),
                      initialDate: now,
                      onDateChanged: (date) {
                        Navigator.pushNamed(context, "/taskManger");
                      },
                    ),
                  )

                ],
              ),

              //Bottom Controls
              Align(
                alignment: Alignment.bottomCenter,
                child: CommonWidgets.getBottomControls(false),
              )
            ],
          ),
        );
      }),
    );
  }
}

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
https://drive.google.com/file/d/1IEwLA3qVGKXMHz1NMiPmLWT5aTRLzFsV/view?usp=sharing

Desktop (please complete the following information):
[โœ“] Flutter (Channel stable, 1.22.3, on Linux, locale en_IN)

[โœ“] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[!] Android Studio (not installed)
[โœ“] Connected device (1 available)

! Doctor found issues in 1 category.

ShowCase Widget Weird Sizing and Padding

Describe the bug
A clear and concise description of what the bug is.

For some widgets, even though the text may be as simple as "a" the padding to the sides of the ShowCase is at least three times the size of the content (to each side)
For those widgets, if text is large enough it will completely be padded out of screen.

Please find attached a sample photo.

This widget has nothing special on it, it's a simple Card, rounded... Inside a Row. The ShowCase is in the Card.

This widget sits vertically in the middle of the screen and horizontally all the way to the right. The screenshot displays the full width of the screen in Portrait mode.

Expected behavior
Would expect the ShowCase Widget to behave with normal sizing/padding as with other widgets.

Screenshots
IMG_20210203_001345

Desktop (please complete the following information):

  • OS: Windows 10

Smartphone (please complete the following information):

  • Device: Xiaomi Mi 9
  • OS: Android 10 (MIUI 11... Xiaomi's OS)

Multiple Widgets used the same Global Key

i got the following exception:

I/flutter (11385): Another exception was thrown: Multiple widgets used the same GlobalKey.
I/flutter (11385): Another exception was thrown: Duplicate GlobalKeys detected in widget tree.

ListView Item Support

How can I use it on any List's item? Does it support this?

I want to add a description for that item on the item of the list.
However, as far as I understand this is not supported.

disabling dismiss from empty space

Hi, Thanks for this awesome plugin

i want disable dismiss action from empty space, but can't find it? i just want action next to other showcase from button in Showcase.withWidget.

Long text description is hidden

If the description of the showcase is long, all text is placed in a single line and goes outside the screen.

Expected behavior
Text should be splitted in multiline allowing to see all description

Smartphone (please complete the following information):

  • Pixel 3a (emulator)
  • OS: Android X

Cannot disable when user click outside showcase

Hi, i want to disable when user click outside showcase. Because i have a logic when user click next on showcase widget(my custom). So when user click outside showcase, my logic not working and the showcase finished.

Steps to reproduce the behavior:

  1. Showcase came out
  2. I created next button to go to next showcase
  3. When click outside showcase, it will to the next showcase. But my logic not working.

I expected i can disable user when click outside showcase, so it will be one access for go to next showcase with my button.

Exception: Please provide ShowCaseView context

Code:

@override void initState() { // TODO: implement initState super.initState(); WidgetsBinding.instance.addPostFrameCallback( (_) => ShowCaseWidget.of(context).startShowCase([profileKey])); }

appBar: AppBar( title: Text('User Profile', style: TextStyle(color: Colors.white)), iconTheme: IconThemeData( color: Colors.white, //change your color here ), actions: <Widget>[ ShowCaseWidget( builder: Builder( builder: (context) => Showcase( key: profileKey, child: InkWell( onTap: () { Navigator.of(context).push(MaterialPageRoute( builder: (BuildContext context) => EditProfile(widget.currentUser))); }, child: Container( height: 30, width: 30, child: SvgPicture.asset(UIData.editProfileIcon, color: Colors.white, semanticsLabel: 'ranking'), )), description: 'Tap to edit profile')), ), ], )

Logs:

Performing hot restart...
Syncing files to device iPhone 11 Pro...
Restarted application in 2,826ms.
path: satisfied (Path is satisfied), interface: en0
flutter: en-US
flutter: โ•โ•โ•ก EXCEPTION CAUGHT BY SCHEDULER LIBRARY โ•žโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
flutter: The following _Exception was thrown during a scheduler callback:
flutter: Exception: Please provide ShowCaseView context
flutter:
flutter: When the exception was thrown, this was the stack:
flutter: #0 ShowCaseWidget.of (package:showcaseview/showcase_widget.dart:21:7)
flutter: #1 _UserProfileState.initState. (package:full_gool/ui/pages/profile/UserProfile.dart:84:31)
flutter: #2 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1033:15)
flutter: #3 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:983:9)
flutter: #4 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:891:5)
flutter: #8 _invoke (dart:ui/hooks.dart:249:10)
flutter: #9 _drawFrame (dart:ui/hooks.dart:207:3)
flutter: (elided 3 frames from package dart:async)
flutter: โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
[C19.1 1E007A17-3E74-41EC-9097-B144DBB7C94B 192.168.1.7:55159<->172.217.166.206:443]
Connected Path: satisfied (Path is satisfied), interface: en0
Duration: 62.345s, DNS @0.001s took 0.003s, TCP @0.004s took 0.014s, TLS took 0.106s
bytes in/out: 11283/3709, packets in/out: 20/18, rtt: 0.014s, retransmitted packets: 1, out-of-order packets: 0

ShowCaseView "finished" callback

Is there any callback or method to know when showcase has been showed? in order to do something after all steps are finished.

disposeOnTap: true: It doesn't work.

WidgetsBinding.instance.addPostFrameCallback((_) => ShowCaseWidget.of(context).startShowCase([_one]));

floatingActionButton: Showcase( disposeOnTap: true, onTargetClick: (){...... });

I tried: WidgetsBinding.instance.addPostFrameCallback((_) => ShowCaseWidget.of(context).dispose());
After failing.

Showcase inside showDialog() method

Is your feature request related to a problem? Please describe.
I'm always frustrated when having a bug that says "it was called on null" when using it inside showDialog()

Describe the solution you'd like
I want to have a Showcase displayed on elements inside a Dialog using a showDialog() method

Describe alternatives you've considered
Honestly, I tried to use WidgetsBinding,instance,addPostFrameCallback() inside the builder of showDialog but it didn't work as well.

Additional context
image

Error when using Hot Reload

Hello! I'd like to start off by saying this is my first Issue creation, and it is an honor to do it on something I am clearly finding much use of. That being said, this is a first, so bear with me as a get a hold of the nuances of Issue submission.

I implemented the example code into my dart, and it all works well, but any time I use Hot Refresh, like changing code and saving, I get a red screen with a stack error that only further breaks down the more I change code. The only fix is restarting the application.

test device: iOS 13.2 iPhone X

////////////////////////////////////////////////
Continuous Loop Break-Down Error (Restart Application to Fix)

Root Screen

class RootScreen extends StatefulWidget {
RootScreen();

@OverRide
_RootScreenState createState() => _RootScreenState();
}

class _RootScreenState extends State {
GlobalKey _one = GlobalKey();
GlobalKey _two = GlobalKey();

@OverRide
void initState() {
super.initState();
}

@OverRide
Widget build(BuildContext context) {
return Scaffold(
body: Showcase(
key: _one,
description: ' Press and hold to create a new appointment ',
showcaseBackgroundColor: Colors.blueAccent,
textColor: Colors.white,
child: Container(
child: GestureDetector(
onLongPress: () {
ShowCaseWidget.of(context).startShowCase([_one, _two,]);
},
child: DayView(
...
),
),
),
),
);
}

@OverRide
void dispose() {
super.dispose();
}
}

NavScreen

class NavScreen extends StatefulWidget {
@OverRide
_NavScreenState createState() => _NavScreenState();
}

class _NavScreenState extends State {

final List _children = [
HomeScreen(),
RootScreen(),
];

@OverRide
void initState() {
super.initState();
}

@OverRide
Widget build(BuildContext context) {
return Container(
child: new Stack(children: [
new Container(
child: new Image.asset('assets/image.png', fit: BoxFit.contain),
),
Scaffold(
drawer: NavDrawer(),
appBar: appBar,
endDrawer: Drawer(),
body: ShowCaseWidget(
builder: Builder(
builder: (context) => _children[_currentIndex],
),
),
),
],
)
);
}
}

//////////////////////////////////////////////////////

Error:

โ•โ•โ•โ•โ•โ•โ•โ• Exception caught by widgets library โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
The following assertion was thrown building Listener:
'package:flutter/src/rendering/box.dart': Failed assertion: line 1705 pos 18: 'debugDoingThisResize || debugDoingThisLayout ||
(RenderObject.debugActiveLayout == parent && _size._canBeUsedByParent)': is not true.

Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
https://github.com/flutter/flutter/issues/new?template=BUG.md

The relevant error-causing widget was:
GestureDetector file:///Users/home_screen.dart:710:18
When the exception was thrown, this was the stack:
#2 RenderBox.size. (package:flutter/src/rendering/box.dart:1705:18)
#3 RenderBox.size (package:flutter/src/rendering/box.dart:1711:6)
#4 _DayViewState.createEventsDrawProperties (package:flutter_week_view/src/day_view.dart:257:76)
#5 _DayViewState.didUpdateWidget (package:flutter_week_view/src/day_view.dart:109:5)
#6 StatefulElement.update (package:flutter/src/widgets/framework.dart:4694:58)
...
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
Reloaded 0 of 869 libraries in 247ms.

โ•โ•โ•โ•โ•โ•โ•โ• Exception caught by widgets library โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
The following assertion was thrown building Builder:
'package:flutter/src/widgets/framework.dart': Failed assertion: line 4977 pos 14: '_dependents.isEmpty': is not true.

Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
https://github.com/flutter/flutter/issues/new?template=BUG.md

The relevant error-causing widget was:
Builder file:///Users/home_screen.dart:972:22
When the exception was thrown, this was the stack:
#2 InheritedElement.debugDeactivated. (package:flutter/src/widgets/framework.dart:4977:14)
#3 InheritedElement.debugDeactivated (package:flutter/src/widgets/framework.dart:4979:6)
#4 _InactiveElements._deactivateRecursively. (package:flutter/src/widgets/framework.dart:1944:15)
#5 _InactiveElements._deactivateRecursively (package:flutter/src/widgets/framework.dart:1946:6)
#6 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:4560:14)
...
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
flutter: Brightness.light

โ•โ•โ•โ•โ•โ•โ•โ• Exception caught by widgets library โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
The following assertion was thrown building _OverlayEntryWidget-[LabeledGlobalKey<_OverlayEntryWidgetState>#0dc3d](dirty, state: _OverlayEntryWidgetState#a7163):
'package:flutter/src/rendering/object.dart': Failed assertion: line 2330 pos 12: 'attached': is not true.

Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
https://github.com/flutter/flutter/issues/new?template=BUG.md

The relevant error-causing widget was:
MaterialApp file:///Users/lib/main.dart:51:12
When the exception was thrown, this was the stack:
#2 RenderObject.getTransformTo (package:flutter/src/rendering/object.dart:2330:12)
#3 RenderBox.localToGlobal (package:flutter/src/rendering/box.dart:2271:39)
#4 AnchoredOverlay.build.. (package:showcaseview/layout_overlays.dart:68:34)
#5 _OverlayEntryWidgetState.build (package:flutter/src/widgets/overlay.dart:177:34)
#6 StatefulElement.build (package:flutter/src/widgets/framework.dart:4623:28)
...
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

Custom click event for highlighted widget

Can i handle click event on highlighted widget? Now the flow is: you can only dismiss the showcase and then click on widget.

I want to have, if user clicks on highlighted widget it goes to some screen, and only dissmis showcase if you click anywhere outside of highlighted widget.

Is that possible?

Multiline description

Hi,Thanks for this plugin, It will really helpful for me. can anyone help me to solve multiline description or how to set the height of showcase widget,I tried but its not working

Failed assertion: line 5540 pos 12: '_children.contains(child)': is not true.

โ•โ•โ•โ•โ•โ•โ•โ• (3) Exception caught by widgets library โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
'package:flutter/src/widgets/framework.dart': Failed assertion: line 5540 pos 12: '_children.contains(child)': is not true.
The relevant error-causing widget was:
Container file:///home/midhilajm/Downloads/flutte /lib/vendor/order_listing.dart:149:9
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

โ•โ•โ•โ•โ•โ•โ•โ• (4) Exception caught by widgets library โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
Duplicate GlobalKey detected in widget tree.

 @override
  void initState() {
    super.initState();
    //Start showcase view after current widget frames are drawn.
    WidgetsBinding.instance.addPostFrameCallback((_) =>
        ShowCaseWidget.of(context).startShowCase([_one, ]));
  }
Container(
        child: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              Showcase(
              key: _one,
                title: 'Menu',
                description: 'Click here to see menu options',
                child: Icon(
                  Icons.menu,
                  color: Colors.black45,
                ),
              ),
              Icon(Icons.mood_bad,size: 80,),
              Text("No order found",style: TextStyle(fontSize: 22),),

              FlatButton(child: Text("Retry"),onPressed: (){
                print("code for check for any new order");
              },)
            ],
          ),

        ),
      )

ShowcaseState created a Ticker via its TickerProviderStateMixin, but at the time dispose() was called on the mixin, that Ticker was still active

Hello,

I've used this pub a few times across an app I'm using with now issue. This is the first time I'm trying to use it without a button interaction. I've tried initiating the showcase from initState, didChangeDependencies and from the build method but I keep getting the following error/exception after I try to Pop the current screen. Note: The showcase does play, but upon disposing the screen (no matter how much time is waited), this error will occur and cause an app crash. Below is the error and stack trace.

The following assertion was thrown while finalizing the widget tree:
I/flutter ( 4324): _ShowcaseState#2e4a0(tickers: tracking 1 ticker) was disposed with an active Ticker.
I/flutter ( 4324): _ShowcaseState created a Ticker via its TickerProviderStateMixin, but at the time dispose() was
I/flutter ( 4324): called on the mixin, that Ticker was still active. All Tickers must be disposed before calling
I/flutter ( 4324): super.dispose(). Tickers used by AnimationControllers should be disposed by calling dispose() on the
I/flutter ( 4324): AnimationController itself. Otherwise, the ticker will leak.
I/flutter ( 4324): The offending ticker was: _WidgetTicker(created by _ShowcaseState#2e4a0(lifecycle state: created,
I/flutter ( 4324): tickers: tracking 0 tickers))
I/flutter ( 4324): The stack trace when the _WidgetTicker was actually created was:
I/flutter ( 4324): #0      new Ticker.<anonymous closure> 
package:flutter/โ€ฆ/scheduler/ticker.dart:64
I/flutter ( 4324): #1      new Ticker 
package:flutter/โ€ฆ/scheduler/ticker.dart:66
I/flutter ( 4324): #2      new _WidgetTicker 
package:flutter/โ€ฆ/widgets/ticker_provider.dart:225
I/flutter ( 4324): #3      __ShowcaseState&State&TickerProviderStateMixin.createTicker
I/flutter ( 4324): (package:flutter/src/widgets/ticker_provider.dart:161:34)
I/flutter ( 4324): #4      new AnimationController 
package:flutter/โ€ฆ/animation/animation_controller.dart:245
I/flutter ( 4324): #5      _ShowcaseState.initState 
package:showcaseview/showcase.dart:107

While using ShowCase widget, not scrolling to respective widget when its not visible.

     Showcase(
            key: beatGlobalKey,
            description: StringResource.beatShowCaseDescp,
            showcaseBackgroundColor: ColorResource.BLUE15447a,
            titleTextStyle: TextStyle(
                color: ColorResource.WHITE16dfff,
                fontFamily: Font.ProximaNovaBold.value),
            descTextStyle: TextStyle(
                color: ColorResource.WHITE16dfff,
                fontFamily: Font.ProximaNovaRegular.value),
            shapeBorder: CircleBorder(),
            showArrow: true,
            spotlightPadding: EdgeInsets.all(10),
            child: PostActionButton(
              !this.widget.post.isLike
                  ? ImageResource.unlikedIcon
                  : ImageResource.likedIcon,
              'Beat',
              tapFunction: _onTapLikePost,
              titleColor: !this.widget.post.isLike
                  ? ColorResource.BLACK2f2f2f
                  : ColorResource.BLUE16dfff,
            ),
          ),

when i used the above code, showcase is not navigating to respective screen even in botttom, and overlay also not coming could anyone help with this? Thanks in adavance !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.