### Showcase Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/Showcase-class.html Creates a showcase widget with a standard tooltip to guide the user. ```APIDOC ## Showcase ### Description Creates a showcase widget with a standard tooltip. ### Parameters - **key** (GlobalKey>) - Required - The key for the showcase. - **child** (Widget) - Required - The widget to be highlighted. - **title** (String) - Optional - The title text for the tooltip. - **description** (String) - Optional - The description text for the tooltip. - **overlayColor** (Color) - Optional - The color of the overlay. - **overlayOpacity** (double) - Optional - The opacity of the overlay. ``` -------------------------------- ### Lifecycle Management Methods Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowcaseView-class.html Methods to start, navigate, and dismiss the showcase tour. ```APIDOC ## startShowCase(List>> widgetIds, {Duration delay = Duration.zero}) -> void Starts the showcase tour for the provided list of widget keys with an optional delay. ## next({bool force = false}) -> void Moves to the next showcase step if possible. ## previous() -> void Moves to the previous showcase step if possible. ## dismiss() -> void Dismisses the entire showcase and triggers the onDismiss callback. ## completed(GlobalKey>? key) -> void Marks the showcase for the given key as completed and proceeds to the next one. ``` -------------------------------- ### startShowCase Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowCaseWidgetState-class.html Starts the showcase view from the beginning of the specified list of widget keys. ```APIDOC ## void startShowCase(List>> widgetIds, {Duration delay = Duration.zero}) ### Description Starts the showcase view from the beginning of the specified list of widget IDs. If this function is used when the showcase has been disabled, it will throw an exception. ### Parameters - **widgetIds** (List>>) - Required - The list of keys representing the widgets to showcase. - **delay** (Duration) - Optional - The delay before starting the showcase. ``` -------------------------------- ### void addOnStartCallback(OnShowcaseCallback listener) Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowcaseView/addOnStartCallback.html Adds a listener that will be called when the showcase tour is started. ```APIDOC ## void addOnStartCallback(OnShowcaseCallback listener) ### Description Adds a listener that will be called when the showcase tour is started. ### Parameters - **listener** (OnShowcaseCallback) - Required - The callback to be executed when the showcase starts. ``` -------------------------------- ### Implementation of addOnStartCallback Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowcaseView/addOnStartCallback.html This method adds the provided listener to the internal list of start callbacks. ```dart void addOnStartCallback(OnShowcaseCallback listener) { _onStartCallbacks.add(listener); } ``` -------------------------------- ### startShowCase(List widgetIds, {Duration delay}) Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowcaseView/startShowCase.html Starts the showcase sequence for the specified list of widgets after an optional delay. ```APIDOC ## startShowCase ### Description Starts the showcase sequence for a provided list of widgets identified by their GlobalKeys. An optional delay can be specified before the showcase begins. ### Signature `void startShowCase(List>> widgetIds, {Duration delay = Duration.zero})` ### Parameters - **widgetIds** (List>>) - Required - A list of GlobalKeys corresponding to the widgets to be showcased. - **delay** (Duration) - Optional - The duration to wait before starting the showcase. Defaults to `Duration.zero`. ``` -------------------------------- ### Install showcaseview dependency Source: https://pub.dev/packages/showcaseview Add the package to your pubspec.yaml file to begin using it in your Flutter project. ```yaml dependencies: showcaseview: ``` -------------------------------- ### void next({bool force = false}) Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowCaseWidgetState/next.html Completes the current active showcase and starts the next one. If force is set to true, it ignores the enableAutoPlayLock. ```APIDOC ## void next({bool force = false}) ### Description Completes the current active showcase and starts the next one. If no further showcases are available, it finishes the entire showcase view. ### Parameters - **force** (bool) - Optional - If true, ignores the enableAutoPlayLock and proceeds to the next showcase. Defaults to false. ### Note This method is deprecated and will be removed in v6.0.0. Please use `ShowcaseView.get().next` instead. ``` -------------------------------- ### void startShowCase(List widgetIds, {Duration delay}) Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowCaseWidgetState/startShowCase.html Starts the showcase view from the beginning of the specified list of widget IDs. Note that this method is deprecated and users should use ShowcaseView.get().startShowCase instead. ```APIDOC ## void startShowCase(List widgetIds, {Duration delay}) ### Description Starts the showcase view from the beginning of the specified list of widget IDs. If this function is called when the showcase has been disabled, it will throw an exception. ### Parameters - **widgetIds** (List) - Required - The list of widget keys to showcase. - **delay** (Duration) - Optional - The duration to wait before starting the showcase, useful for waiting for animations to complete. Defaults to Duration.zero. ``` -------------------------------- ### bool get isTop Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/TooltipPosition/isTop.html A getter property that returns true if the TooltipPosition is equal to TooltipPosition.top. ```APIDOC ## bool get isTop ### Description Returns a boolean value indicating whether the current TooltipPosition instance is equivalent to the top position. ### Signature `bool get isTop` ### Returns - **bool** - Returns true if the position is top, otherwise false. ``` -------------------------------- ### Define scaleAnimationAlignment Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/Showcase/scaleAnimationAlignment.html Example values for setting the alignment of the tooltip animation origin. ```dart Alignment(-0.2,0.3) or Alignment.centerLeft ``` -------------------------------- ### bool get isLeft Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/TooltipPosition/isLeft.html A getter that returns true if the TooltipPosition is equal to TooltipPosition.left. ```APIDOC ## bool get isLeft ### Description Returns a boolean value indicating whether the current TooltipPosition instance is equivalent to the left position. ### Signature `bool get isLeft` ### Returns - **bool** - Returns true if the position is TooltipPosition.left, otherwise false. ``` -------------------------------- ### void previous() Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowCaseWidgetState/previous.html Completes the current active showcase and starts the previous one. If no previous showcase exists, it finishes the entire showcase view. ```APIDOC ## void previous() ### Description Completes the current active showcase and starts the previous one. If no previous showcase exists, it finishes the entire showcase view. ### Signature `void previous()` ### Deprecation Notice This method is deprecated and will be removed in v6.0.0. Please use `ShowcaseView.get().previous` instead. ``` -------------------------------- ### next Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowCaseWidgetState-class.html Completes the current active showcase and starts the next one, or finishes the entire showcase view if no more items remain. ```APIDOC ## void next({bool force = false}) ### Description Completes the current active showcase and starts the next one. If no more items are available, it finishes the entire showcase view. ``` -------------------------------- ### bool get isShowcaseRunning Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowcaseView/isShowcaseRunning.html Returns a boolean value indicating whether the showcase is currently running. ```APIDOC ## bool get isShowcaseRunning ### Description Returns whether the showcase is currently running or not. ### Signature `bool get isShowcaseRunning` ### Returns - **bool**: Returns true if a showcase is active, false otherwise. ``` -------------------------------- ### bool get isBottom Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/TooltipPosition/isBottom.html A getter method that returns true if the TooltipPosition instance is equal to TooltipPosition.bottom. ```APIDOC ## bool get isBottom ### Description Returns a boolean value indicating whether the current TooltipPosition is positioned at the bottom. ### Signature `bool get isBottom` ### Returns - **bool**: Returns true if the instance is TooltipPosition.bottom, otherwise false. ``` -------------------------------- ### bool get isVertical Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/TooltipPosition/isVertical.html A getter that returns true if the tooltip position is either at the top or the bottom. ```APIDOC ## bool get isVertical ### Description Returns a boolean value indicating whether the tooltip is positioned vertically. It evaluates to true if the tooltip is positioned at the top or the bottom. ### Signature `bool get isVertical` ### Implementation ```dart bool get isVertical => isTop || isBottom; ``` ``` -------------------------------- ### bool get isShowCaseCompleted Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowcaseView/isShowCaseCompleted.html Returns a boolean value indicating whether the showcase process has been completed. ```APIDOC ## bool get isShowCaseCompleted ### Description Returns whether the showcase is completed or not. This property checks the internal state of the showcase view to determine if it has finished its sequence. ### Signature `bool get isShowCaseCompleted` ### Returns - **bool**: Returns `true` if the showcase is completed, otherwise `false`. ``` -------------------------------- ### bool get isOutside Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/TooltipActionPosition/isOutside.html A getter that returns true if the current instance is equal to the outside position. ```APIDOC ## bool get isOutside ### Description Returns a boolean value indicating whether the current TooltipActionPosition is defined as 'outside'. ### Signature `bool get isOutside` ### Returns - **bool**: Returns `true` if the current position is `outside`, otherwise `false`. ``` -------------------------------- ### bool get enableShowcase Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowCaseWidgetState/enableShowcase.html A getter property that returns the current showcase status. Note that this property is deprecated and will be removed in v6.0.0. ```APIDOC ## bool get enableShowcase ### Description Returns the current status of the showcase. This property is marked as deprecated. ### Usage `bool isEnabled = showcaseWidgetState.enableShowcase;` ### Note This property is deprecated and will be removed in v6.0.0. Please use `ShowcaseView.get().enableShowcase` instead. ``` -------------------------------- ### bool get isShowcaseRunning Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowCaseWidgetState/isShowcaseRunning.html A getter property that returns a boolean indicating whether the showcase is currently running. This property is marked as deprecated. ```APIDOC ## bool get isShowcaseRunning ### Description Returns a boolean value indicating if the showcase is currently active. This property is deprecated and will be removed in v6.0.0. ### Signature `bool get isShowcaseRunning` ### Migration Please use `ShowcaseView.get().isShowcaseRunning` instead. ``` -------------------------------- ### bool get autoPlay Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowCaseWidgetState/autoPlay.html Retrieves the current autoPlay status of the showcase. This property is deprecated and users are advised to use ShowcaseView.get().autoPlay instead. ```APIDOC ## bool get autoPlay ### Description Returns the autoPlay status of the showcase. This property is marked as deprecated and will be removed in v6.0.0. ### Usage Use `ShowcaseView.get().autoPlay` as the preferred alternative. ### Signature `bool get autoPlay` ``` -------------------------------- ### bool get isShowCaseCompleted Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowCaseWidgetState/isShowCaseCompleted.html A getter that returns a boolean indicating whether the showcase view has been completed. This property is marked as deprecated. ```APIDOC ## bool get isShowCaseCompleted ### Description Returns a boolean value indicating if the showcase view process is completed. ### Note This property is @Deprecated and will be removed in v6.0.0. Please use `ShowcaseView.get().isShowCaseCompleted` instead. ### Return Type bool ``` -------------------------------- ### autoPlay property Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowCaseWidget/autoPlay.html The autoPlay property is a boolean that determines whether all showcases will automatically start in sequence with a specified time interval. ```APIDOC ## autoPlay ### Description Whether all showcases will auto sequentially start having time interval of autoPlayDelay. ### Type bool ### Default Value false ### Implementation final bool autoPlay; ``` -------------------------------- ### Implementation of startShowCase Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowcaseView/startShowCase.html This method verifies the widget is mounted before initiating the showcase process for the provided list of GlobalKeys. ```dart void startShowCase( List widgetIds, { Duration delay = Duration.zero, }) { assert(_mounted, 'ShowcaseView is no longer mounted'); if (!_mounted) return; _findEnclosingShowcaseView(widgetIds)._startShowcase(delay, widgetIds); } ``` -------------------------------- ### Implementation of removeOnStartCallback Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowcaseView/removeOnStartCallback.html This method removes the specified listener from the internal list of start callbacks. ```dart void removeOnStartCallback(OnShowcaseCallback listener) { _onStartCallbacks.remove(listener); } ``` -------------------------------- ### onStart property Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowCaseWidget/onStart.html The onStart property is a callback function that executes whenever a showcase begins. It provides the index of the showcase and the GlobalKey associated with the target widget. ```APIDOC ## onStart property ### Description Triggered every time on start of each showcase. ### Signature `void Function(int?, GlobalKey>)? onStart` ### Parameters - **index** (int?) - The index of the current showcase. - **key** (GlobalKey>) - The GlobalKey of the widget being showcased. ``` -------------------------------- ### Initialize a Showcase widget Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/Showcase/Showcase.html Basic implementation of a Showcase widget wrapping an IconButton to highlight a profile feature. ```dart Showcase( key: _myShowcaseKey, title: 'Profile', description: 'Tap to view your profile details', child: IconButton( icon: Icon(Icons.person), onPressed: () {}, ), ) ``` -------------------------------- ### Implementation of startShowCase Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowCaseWidgetState/startShowCase.html This method is deprecated and will be removed in v6.0.0; use ShowcaseView.get().startShowCase instead. ```dart @Deprecated( 'This will be removed in v6.0.0. please use ' '`ShowcaseView.get().startShowCase` instead', ) void startShowCase( List widgetIds, { Duration delay = Duration.zero, }) { _showcaseView.startShowCase(widgetIds, delay: delay); } ``` -------------------------------- ### bool get isRight Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/TooltipPosition/isRight.html A getter method that returns true if the TooltipPosition instance is equal to TooltipPosition.right. ```APIDOC ## bool get isRight ### Description Returns a boolean value indicating whether the current TooltipPosition is positioned to the right. ### Signature `bool get isRight` ### Returns - **bool**: Returns true if the position is TooltipPosition.right, otherwise false. ``` -------------------------------- ### ShowcaseView.register Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowcaseView/ShowcaseView.register.html Initializes a new ShowcaseView instance and registers it with the ShowcaseService. ```APIDOC ## ShowcaseView.register ### Description Creates and registers a ShowcaseView with the specified scope. This controller manages showcase state and configuration. ### Parameters - **scope** (String) - Optional - The scope identifier for the showcase (default: Constants.defaultScope). - **onStart** (OnShowcaseCallback) - Optional - Callback triggered when the showcase starts. - **onFinish** (VoidCallback) - Optional - Callback triggered when the showcase finishes. - **onComplete** (OnShowcaseCallback) - Optional - Callback triggered when the showcase completes. - **onDismiss** (OnDismissCallback) - Optional - Callback triggered when the showcase is dismissed. - **skipIfTargetNotPresent** (bool) - Optional - Whether to skip the showcase if the target is not present (default: false). - **enableShowcase** (bool) - Optional - Whether to enable the showcase (default: true). - **autoPlay** (bool) - Optional - Whether to enable auto-play (default: false). - **autoPlayDelay** (Duration) - Optional - Delay for auto-play (default: Constants.defaultAutoPlayDelay). - **enableAutoPlayLock** (bool) - Optional - Whether to lock auto-play (default: false). - **enableAutoScroll** (bool) - Optional - Whether to enable auto-scroll (default: false). - **scrollDuration** (Duration) - Optional - Duration for auto-scroll (default: Constants.defaultScrollDuration). - **disableBarrierInteraction** (bool) - Optional - Whether to disable barrier interaction (default: false). - **disableScaleAnimation** (bool) - Optional - Whether to disable scale animation (default: false). - **disableMovingAnimation** (bool) - Optional - Whether to disable moving animation (default: false). - **blurValue** (double) - Optional - Blur intensity (default: 0). - **overlayColor** (Color) - Optional - Color of the overlay. - **overlayOpacity** (double) - Optional - Opacity of the overlay. - **globalTooltipActionConfig** (TooltipActionConfig) - Optional - Global configuration for tooltip actions. - **globalTooltipActions** (List) - Optional - List of global tooltip actions. - **globalFloatingActionWidget** (FloatingActionBuilderCallback) - Optional - Global builder for floating action widgets. - **hideFloatingActionWidgetForShowcase** (List) - Optional - Keys for widgets to hide during the showcase. - **semanticEnable** (bool) - Optional - Whether to enable semantic support (default: false). ``` -------------------------------- ### Showcase Constructor Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/Showcase/Showcase.html The Showcase constructor initializes a highlight overlay for a specific widget identified by a GlobalKey. ```APIDOC ## Showcase Constructor ### Description Creates a Showcase widget to highlight a target UI element with a tooltip and overlay. ### Parameters - **key** (GlobalKey) - Required - The unique identifier for the widget being showcased. - **child** (Widget) - Required - The widget to be highlighted. - **title** (String) - Optional - The title text for the tooltip. - **description** (String) - Optional - The description text for the tooltip. - **overlayColor** (Color) - Optional - The color of the background overlay. - **overlayOpacity** (double) - Optional - The opacity of the overlay (0.0 to 1.0). - **onTargetClick** (VoidCallback) - Optional - Callback triggered when the target is clicked. - **disposeOnTap** (bool) - Optional - Whether to dismiss the showcase on tap. - **autoPlayDelay** (Duration) - Optional - Delay before auto-playing the animation. ``` -------------------------------- ### bool get isInsideRight Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/TooltipActionPosition/isInsideRight.html A boolean getter that returns true if the current instance is equal to insideRight. ```APIDOC ## bool get isInsideRight ### Description Returns a boolean value indicating whether the current TooltipActionPosition is equivalent to the insideRight position. ### Signature `bool get isInsideRight` ### Returns - **bool** - True if the current instance is insideRight, otherwise false. ``` -------------------------------- ### void next({bool force = false}) Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowcaseView/next.html Advances the showcase sequence to the next widget. If no more widgets are available, the entire showcase sequence is finished. ```APIDOC ## void next({bool force = false}) ### Description Moves to the next showcase widget if possible. If no more widgets are available, it will finish the entire showcase sequence. ### Parameters - **force** (bool) - Optional - Whether to ignore autoPlayLock. Defaults to false. ``` -------------------------------- ### Showcase constructor Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/Showcase/Showcase.html Creates a showcase widget with a standard tooltip to highlight a specific child widget. ```APIDOC ## Showcase constructor ### Description Creates a showcase widget with a standard tooltip. This constructor is used to highlight specific widgets within your app and provide explanatory text to guide users. ### Signature `Showcase({required GlobalKey> key, required Widget child, String? title, String? description, ...})` ### Parameters - **key** (GlobalKey>) - Required - Unique identifier for the showcase state. - **child** (Widget) - Required - The widget to be highlighted. - **title** (String) - Optional - The title text displayed in the tooltip. - **description** (String) - Optional - The description text displayed in the tooltip. - **overlayColor** (Color) - Optional - The color of the overlay surrounding the target. - **overlayOpacity** (double) - Optional - The opacity of the overlay. - **onTargetClick** (VoidCallback) - Optional - Callback triggered when the target is clicked. ### Usage Example ```dart Showcase( key: _myShowcaseKey, title: 'Profile', description: 'Tap to view your profile details', child: IconButton( icon: Icon(Icons.person), onPressed: () {}, ), ) ``` ``` -------------------------------- ### bool get enableAutoScroll Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowCaseWidgetState/enableAutoScroll.html Retrieves the current auto-scroll status for the ShowcaseView. This property is marked as deprecated. ```APIDOC ## bool get enableAutoScroll ### Description Returns the current auto-scroll configuration for the ShowcaseView. This property is deprecated and will be removed in v6.0.0. ### Usage Use `ShowcaseView.get().enableAutoScroll` instead of this property. ### Return Type bool ``` -------------------------------- ### Showcase.withWidget Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/Showcase/Showcase.withWidget.html Creates a showcase with a completely custom tooltip widget. Use this when you need a tooltip design that requires complex layouts, images, or interactive elements. ```APIDOC ## Showcase.withWidget ### Description Creates a showcase with a completely custom tooltip widget. Unlike the standard constructor, this allows you to provide your own custom widget via the `container` parameter. ### Signature ```dart const Showcase.withWidget({ required GlobalKey> key, required Widget? container, required Widget child, FloatingActionWidget? floatingActionWidget, ShapeBorder targetShapeBorder = Constants.defaultTargetShapeBorder, Color overlayColor = Colors.black45, BorderRadius? targetBorderRadius, double overlayOpacity = 0.75, Widget scrollLoadingWidget = Constants.defaultProgressIndicator, VoidCallback? onTargetClick, bool? disposeOnTap, Duration? autoPlayDelay, Duration movingAnimationDuration = Constants.defaultAnimationDuration, bool? disableMovingAnimation, EdgeInsets targetPadding = EdgeInsets.zero, double? blurValue, VoidCallback? onTargetLongPress, VoidCallback? onTargetDoubleTap, bool disableDefaultTargetGestures = false, TooltipPosition? tooltipPosition, VoidCallback? onBarrierClick, bool disableBarrierInteraction = false, double toolTipSlideEndDistance = 7, List? tooltipActions, TooltipActionConfig? tooltipActionConfig, double scrollAlignment = 0.5, bool? enableAutoScroll, double toolTipMargin = 14, double targetTooltipGap = 10, ValueSetter? onTargetRectUpdate, String? scope }) ``` ### Example Usage ```dart Showcase.withWidget( key: _customKey, container: Column( children: [ Text( "This is a custom widget!", style: TextStyle(color: Colors.white), ), SizedBox(height: 10), Image.asset('assets/tutorial_image.png', width: 100), ], ), child: FloatingActionButton( onPressed: () {}, child: Icon(Icons.add), ), ) ``` ``` -------------------------------- ### bool get disableMovingAnimation Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowCaseWidgetState/disableMovingAnimation.html Retrieves the current state of the moving animation setting. This property is deprecated. ```APIDOC ## bool get disableMovingAnimation ### Description Returns a boolean value indicating whether the moving animation is disabled. This property is marked as deprecated and will be removed in v6.0.0. ### Usage Use `ShowcaseView.get().disableMovingAnimation` instead of accessing this property directly. ### Return Type bool ``` -------------------------------- ### void completed(GlobalKey>? key) Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowCaseWidgetState/completed.html Completes the showcase associated with the provided key and proceeds to the next one, or finishes the entire showcase view if no more are pending. ```APIDOC ## void completed(GlobalKey>? key) ### Description Completes the showcase of the given key and starts the next one. If no further showcases are available, it will finish the entire showcase view. ### Parameters - **key** (GlobalKey>?) - Optional - The key associated with the showcase to be marked as completed. ### Note This method is deprecated and will be removed in v6.0.0. Please use `ShowcaseView.get().completed` instead. ``` -------------------------------- ### Define TooltipPosition values Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/TooltipPosition.html Examples of how the TooltipPosition enum values are configured with rotation angles and scale alignments. ```dart const TooltipPosition(rotationAngle: pi, scaleAlignment: Alignment.topCenter) ``` ```dart const TooltipPosition(rotationAngle: 0, scaleAlignment: Alignment.bottomCenter) ``` ```dart const TooltipPosition(rotationAngle: pi * 0.5, scaleAlignment: Alignment.centerLeft) ``` ```dart const TooltipPosition(rotationAngle: 3 * pi * 0.5, scaleAlignment: Alignment.centerRight) ``` -------------------------------- ### Showcase.withWidget Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/Showcase/Showcase.withWidget.html Constructor for creating a showcase with a custom widget container. ```APIDOC ## Showcase.withWidget ### Description Creates a showcase overlay for a specific widget. This constructor requires a container widget and provides various configuration options for the showcase appearance and behavior. ### Parameters - **key** (GlobalKey) - Required - The global key for the showcase. - **container** (Widget) - Required - The widget to be showcased. - **child** (Widget) - Required - The child widget. - **floatingActionWidget** (Widget) - Optional - A widget to display as a floating action. - **targetShapeBorder** (ShapeBorder) - Optional - The shape of the target highlight. - **overlayColor** (Color) - Optional - The color of the overlay. - **overlayOpacity** (double) - Optional - The opacity of the overlay (0.0 to 1.0). - **onTargetClick** (VoidCallback) - Optional - Callback triggered when the target is clicked. - **disposeOnTap** (bool) - Optional - Whether to dispose the showcase on tap. - **onTargetLongPress** (VoidCallback) - Optional - Callback triggered on long press. - **onTargetDoubleTap** (VoidCallback) - Optional - Callback triggered on double tap. - **onBarrierClick** (VoidCallback) - Optional - Callback triggered when the barrier is clicked. ``` -------------------------------- ### bool get isHorizontal Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/TooltipPosition/isHorizontal.html A getter that returns true if the tooltip is positioned horizontally (either left or right). ```APIDOC ## bool get isHorizontal ### Description Returns a boolean value indicating whether the tooltip position is horizontal. This is determined by checking if the position is either left or right. ### Signature `bool get isHorizontal` ### Returns - **bool**: True if the position is horizontal, false otherwise. ``` -------------------------------- ### Showcase.withWidget Usage Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/Showcase/Showcase.withWidget.html Demonstrates how to implement a custom tooltip using the container parameter within a Showcase.withWidget constructor. ```dart Showcase.withWidget( key: _customKey, container: Column( children: [ Text( "This is a custom widget!", style: TextStyle(color: Colors.white), ), SizedBox(height: 10), Image.asset('assets/tutorial_image.png', width: 100), ], ), child: FloatingActionButton( onPressed: () {}, child: Icon(Icons.add), ), ) ``` -------------------------------- ### bool get isInsideHorizontal Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/TooltipActionPosition/isInsideHorizontal.html A boolean property that returns true if the current value is either insideLeft or insideRight. ```APIDOC ## bool get isInsideHorizontal ### Description Returns a boolean value indicating whether the current instance represents a horizontal position (insideLeft or insideRight). ### Signature `bool get isInsideHorizontal` ### Implementation ```dart bool get isInsideHorizontal => this == insideLeft || this == insideRight; ``` ``` -------------------------------- ### State and Utility Methods Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowcaseView-class.html Methods for querying showcase state and managing UI elements. ```APIDOC ## isTargetRendered(GlobalKey> key) -> bool Checks if the showcase registered with the given key is currently mounted in the widget tree. ## getFloatingActionWidget(GlobalKey> showcaseKey) -> FloatingActionBuilderCallback? Retrieves the floating action widget for a specific key if it is not hidden. ## hideFloatingActionWidgetForKeys(List>> updatedList) -> void Updates the list of keys for which the floating action widget should be hidden. ## updateOverlay() -> void Forces an update of the overlay to reflect the current showcase state. ## unregister() -> void Cleans up resources associated with the showcase view. ``` -------------------------------- ### completed Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowCaseWidgetState-class.html Completes the showcase for a specific key and moves to the next one. ```APIDOC ## void completed(GlobalKey>? key) ### Description Completes the showcase of the given key and starts the next one; otherwise, it will finish the entire showcase view. ``` -------------------------------- ### bool get enableAutoPlayLock Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowCaseWidgetState/enableAutoPlayLock.html Retrieves the current auto-play lock status. This property is deprecated as of the current version. ```APIDOC ## bool get enableAutoPlayLock ### Description Returns the current state of the auto-play lock. This property is marked as @Deprecated and will be removed in v6.0.0. ### Usage Users should migrate to using `ShowcaseView.get().enableAutoPlayLock` instead of accessing this property directly. ### Return Type - **bool** - The current auto-play lock status. ``` -------------------------------- ### void addOnFinishCallback(VoidCallback listener) Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowcaseView/addOnFinishCallback.html Registers a callback function to be invoked upon the completion of the showcase tour. ```APIDOC ## void addOnFinishCallback(VoidCallback listener) ### Description Adds a listener that will be called when the showcase tour is finished. ### Parameters - **listener** (VoidCallback) - Required - The callback function to execute when the tour finishes. ``` -------------------------------- ### bool get disableScaleAnimation Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowCaseWidgetState/disableScaleAnimation.html Retrieves the current state of the scale animation setting. This property is marked as deprecated. ```APIDOC ## bool get disableScaleAnimation ### Description Returns a boolean value indicating whether the scale animation is disabled. This property is deprecated and will be removed in v6.0.0. ### Usage Use `ShowcaseView.get().disableScaleAnimation` as the recommended replacement. ### Signature `bool get disableScaleAnimation` ``` -------------------------------- ### bool get isInside Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/TooltipActionPosition/isInside.html Checks if the current position is one of the internal alignment options (inside, insideLeft, or insideRight). ```APIDOC ## bool get isInside ### Description A boolean property that returns true if the current TooltipActionPosition is equal to `inside`, `insideLeft`, or `insideRight`. ### Signature `bool get isInside` ### Returns - **bool**: Returns `true` if the position is internal, otherwise `false`. ``` -------------------------------- ### ShowcaseView next method implementation Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowcaseView/next.html The internal implementation of the next method, which checks for auto-play locks and mounting status before advancing the sequence. ```dart void next({bool force = false}) { if ((!force && enableAutoPlayLock) || _ids == null || !_mounted) { return; } _changeSequence(ShowcaseProgressType.forward); } ``` -------------------------------- ### Duration get scrollDuration Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowCaseWidgetState/scrollDuration.html Retrieves the duration of the scroll animation. This property is marked as deprecated and will be removed in version 6.0.0. ```APIDOC ## Duration get scrollDuration ### Description Returns the current scroll duration for the showcase view. This property is deprecated; please use `ShowcaseView.get().scrollDuration` instead. ### Signature `Duration get scrollDuration` ### Returns - **Duration** - The duration of the scroll animation. ``` -------------------------------- ### void addOnCompleteCallback(OnShowcaseCallback listener) Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowcaseView/addOnCompleteCallback.html Registers a listener to be invoked upon the completion of each showcase step. ```APIDOC ## void addOnCompleteCallback(OnShowcaseCallback listener) ### Description Adds a listener that will be called when each showcase step completes. ### Parameters - **listener** (OnShowcaseCallback) - Required - The callback to be executed when a showcase step completes. ``` -------------------------------- ### bool get disableBarrierInteraction Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowCaseWidgetState/disableBarrierInteraction.html Retrieves the current state of barrier interaction. This property is deprecated and scheduled for removal in v6.0.0. ```APIDOC ## bool get disableBarrierInteraction ### Description Returns a boolean indicating whether barrier interaction is disabled. This property is marked as @Deprecated and will be removed in v6.0.0. ### Usage Use `ShowcaseView.get().disableBarrierInteraction` instead of this property. ### Return Type bool ``` -------------------------------- ### ShowCaseWidgetState build implementation Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowCaseWidgetState/build.html The actual implementation of the build method for ShowCaseWidgetState. ```dart @override Widget build(BuildContext context) => Builder( // Will be removed in v6.0.0. //ignore: deprecated_member_use_from_same_package builder: widget.builder, ); ``` -------------------------------- ### double get blurValue Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowCaseWidgetState/blurValue.html Retrieves the current blur value. This property is marked as deprecated and will be removed in version 6.0.0. ```APIDOC ## double get blurValue ### Description Returns the blur value associated with the showcase view. This property is deprecated; please use `ShowcaseView.get().blurValue` instead. ### Signature `double get blurValue` ### Returns - **double**: The current blur intensity value. ``` -------------------------------- ### Duration get autoPlayDelay Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowCaseWidgetState/autoPlayDelay.html Retrieves the duration for the auto-play delay. This property is marked as deprecated and will be removed in version 6.0.0. ```APIDOC ## Duration get autoPlayDelay ### Description Returns the `Duration` representing the delay for auto-playing showcase views. This property is deprecated; please use `ShowcaseView.get().autoPlayDelay` instead. ### Signature `Duration get autoPlayDelay` ``` -------------------------------- ### TooltipActionConfig Constructor Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/TooltipActionConfig-class.html Creates a configuration object for tooltip action buttons with customizable layout parameters. ```APIDOC ## TooltipActionConfig({MainAxisAlignment alignment, double actionGap, TooltipActionPosition position, double gapBetweenContentAndAction, CrossAxisAlignment crossAxisAlignment, MainAxisSize mainAxisSize, TextBaseline? textBaseline}) ### Description Initializes the configuration for tooltip action buttons, defining how they are positioned and spaced relative to the tooltip content. ### Parameters - **alignment** (MainAxisAlignment) - Optional - Defines the alignment of action buttons. - **actionGap** (double) - Optional - Defines the gap between the action buttons. - **position** (TooltipActionPosition) - Optional - Defines whether the action widget is inside or outside the tooltip. - **gapBetweenContentAndAction** (double) - Optional - Defines the vertical gap between tooltip content and actions. - **crossAxisAlignment** (CrossAxisAlignment) - Optional - Defines running direction alignment for the Action widgets. - **mainAxisSize** (MainAxisSize) - Optional - Defines the main axis size of action buttons. - **textBaseline** (TextBaseline?) - Optional - The baseline to use if aligning items according to their baseline. ``` -------------------------------- ### bool get isInsideVertical Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/TooltipActionPosition/isInsideVertical.html A boolean property that returns true if the current position is set to 'inside', indicating a vertical alignment. ```APIDOC ## bool get isInsideVertical ### Description Returns a boolean value indicating whether the tooltip action position is inside, which corresponds to a vertical orientation. ### Signature `bool get isInsideVertical` ### Returns - **bool** - Returns true if the current state is equal to 'inside', otherwise false. ``` -------------------------------- ### Define onStart property Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowCaseWidget/onStart.html The onStart property is defined as a function that receives an optional integer index and a GlobalKey. ```dart final void Function(int?, GlobalKey)? onStart; ``` -------------------------------- ### Showcase Widget Configuration Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/Showcase-class.html Properties available for configuring the appearance and behavior of the Showcase tooltip widget. ```APIDOC ## Showcase Widget Properties ### Tooltip Styling - **titleTextAlign** (TextAlign) - Title text alignment within the tooltip widget. - **titleTextDirection** (TextDirection?) - Provides text direction of the tooltip title. - **titleTextStyle** (TextStyle?) - TextStyle for the default tooltip title. - **tooltipBackgroundColor** (Color) - Defines the background color for the tooltip widget. - **tooltipBorderRadius** (BorderRadius?) - Border radius of the default tooltip. - **tooltipPadding** (EdgeInsets) - Empty space around tooltip content. ### Tooltip Layout and Positioning - **tooltipPosition** (TooltipPosition?) - Defines the vertical position of the tooltip relative to the Target widget. - **toolTipMargin** (double) - Defines the margin from the screen edge for the tooltip. - **toolTipSlideEndDistance** (double) - Defines the motion range for the tooltip slide animation. ### Tooltip Actions - **tooltipActionConfig** (TooltipActionConfig?) - Configuration for the tooltip action widget (alignment, position, gap, etc.). - **tooltipActions** (List?) - Provides tooltip action widgets at the bottom of the tooltip. ``` -------------------------------- ### Register a ShowcaseView Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowcaseView/ShowcaseView.register.html Initializes a new ShowcaseView instance with specific configuration parameters and registers it with the ShowcaseService. ```dart ShowcaseView.register({ this.scope = Constants.defaultScope, this.onStart, this.onFinish, this.onComplete, this.onDismiss, this.skipIfTargetNotPresent = false, this.enableShowcase = true, this.autoPlay = false, this.autoPlayDelay = Constants.defaultAutoPlayDelay, this.enableAutoPlayLock = false, this.enableAutoScroll = false, this.scrollDuration = Constants.defaultScrollDuration, this.disableBarrierInteraction = false, this.disableScaleAnimation = false, this.disableMovingAnimation = false, this.blurValue = 0, this.overlayColor, this.overlayOpacity, this.globalTooltipActionConfig, this.globalTooltipActions, this.globalFloatingActionWidget, this.hideFloatingActionWidgetForShowcase = const [], this.semanticEnable = false, }) { ShowcaseService.instance.register(this, scope: scope); _hideFloatingWidgetKeys = { for (final item in hideFloatingActionWidgetForShowcase) item: true, }; } ``` -------------------------------- ### ShowCaseWidget Constructor Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowCaseWidget-class.html Initializes a new ShowCaseWidget to manage multiple showcase widgets with various configuration options for animations, auto-play, and callbacks. ```APIDOC ## ShowCaseWidget({WidgetBuilder builder, VoidCallback onFinish, Function onStart, Function onComplete, OnDismissCallback onDismiss, bool autoPlay, Duration autoPlayDelay, bool enableAutoPlayLock, double blurValue, Duration scrollDuration, bool disableMovingAnimation, bool disableScaleAnimation, bool enableAutoScroll, bool disableBarrierInteraction, bool enableShowcase, TooltipActionConfig globalTooltipActionConfig, List globalTooltipActions, FloatingActionBuilderCallback globalFloatingActionWidget, List hideFloatingActionWidgetForShowcase, Key key}) ### Description Creates a widget that manages multiple Showcase widgets, allowing for global configuration of showcase behavior, animations, and event callbacks. ### Parameters - **builder** (WidgetBuilder) - Required - The builder function for the showcase content. - **onFinish** (VoidCallback) - Optional - Callback triggered when all showcases are completed. - **onStart** (Function(int?, GlobalKey)) - Optional - Callback triggered when a showcase starts. - **onComplete** (Function(int?, GlobalKey)) - Optional - Callback triggered when a showcase completes. - **onDismiss** (OnDismissCallback) - Optional - Callback triggered when a showcase is dismissed. - **autoPlay** (bool) - Optional - Whether showcases start sequentially automatically. - **autoPlayDelay** (Duration) - Optional - Delay between auto-played showcases. - **enableAutoPlayLock** (bool) - Optional - Whether to block user interaction during auto-play. - **blurValue** (double) - Optional - Default overlay blur value. - **scrollDuration** (Duration) - Optional - Duration for auto-scrolling. - **disableMovingAnimation** (bool) - Optional - Disables bouncing/moving animations. - **disableScaleAnimation** (bool) - Optional - Disables initial scale animations. - **enableAutoScroll** (bool) - Optional - Enables auto-scrolling to target widgets. - **disableBarrierInteraction** (bool) - Optional - Disables interaction with the barrier. - **enableShowcase** (bool) - Optional - Globally enables or disables showcases. - **globalTooltipActionConfig** (TooltipActionConfig) - Optional - Global configuration for tooltip actions. - **globalTooltipActions** (List) - Optional - Global actions for all tooltips. - **globalFloatingActionWidget** (FloatingActionBuilderCallback) - Optional - Custom static floating action widget. - **hideFloatingActionWidgetForShowcase** (List) - Optional - List of keys for showcases where the global floating action widget should be hidden. ``` -------------------------------- ### TooltipActionConfig constructor Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/TooltipActionConfig/TooltipActionConfig.html Initializes a new TooltipActionConfig instance to define the appearance and layout of action buttons. ```APIDOC ## TooltipActionConfig ### Description Creates a configuration object for tooltip action buttons, allowing customization of alignment, spacing, and positioning. ### Constructor `const TooltipActionConfig({MainAxisAlignment alignment, double actionGap, TooltipActionPosition position, double gapBetweenContentAndAction, CrossAxisAlignment crossAxisAlignment, MainAxisSize mainAxisSize, TextBaseline? textBaseline})` ### Parameters - **alignment** (MainAxisAlignment) - Optional - Defines how the action buttons are aligned along the main axis. Defaults to MainAxisAlignment.spaceBetween. - **actionGap** (double) - Optional - The spacing between action buttons. Defaults to 5. - **position** (TooltipActionPosition) - Optional - Determines if actions are placed inside or outside the tooltip content. Defaults to TooltipActionPosition.inside. - **gapBetweenContentAndAction** (double) - Optional - The space between the tooltip content and the action buttons. Defaults to 10. - **crossAxisAlignment** (CrossAxisAlignment) - Optional - Defines how the action buttons are aligned along the cross axis. Defaults to CrossAxisAlignment.start. - **mainAxisSize** (MainAxisSize) - Optional - Determines how much space the action buttons occupy along the main axis. Defaults to MainAxisSize.max. - **textBaseline** (TextBaseline?) - Optional - The baseline to use for aligning text within the action area. ``` -------------------------------- ### FloatingActionWidget.directional Implementation Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/FloatingActionWidget/FloatingActionWidget.directional.html The factory constructor maps start and end parameters to left and right properties based on the provided TextDirection. ```dart factory FloatingActionWidget.directional({ required TextDirection textDirection, required Widget child, double? start, double? top, double? end, double? bottom, double? width, double? height, Key? key, }) { /// Default value will be [TextDirection.ltr]. var left = start; var right = end; switch (textDirection) { case TextDirection.ltr: break; case TextDirection.rtl: left = end; right = start; } return FloatingActionWidget( key: key, left: left, top: top, right: right, bottom: bottom, width: width, height: height, child: child, ); } ``` -------------------------------- ### void onTap(ShowcaseView showcaseView) Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/TooltipDefaultActionType/onTap.html Executes the default action associated with the TooltipDefaultActionType enum value on the given ShowcaseView. ```APIDOC ## void onTap(ShowcaseView showcaseView) ### Description Triggers the specific action associated with the current TooltipDefaultActionType (next, previous, or skip) on the provided ShowcaseView instance. ### Parameters - **showcaseView** (ShowcaseView) - Required - The instance of the ShowcaseView to perform the action on. ``` -------------------------------- ### Define onStart callback property Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowcaseView/onStart.html The onStart property is defined as an optional OnShowcaseCallback. ```dart final OnShowcaseCallback? onStart; ``` -------------------------------- ### void updateOverlay() Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowcaseView/updateOverlay.html Updates the overlay to reflect the current showcase state by interacting with the OverlayManager. ```APIDOC ## void updateOverlay() ### Description Updates the overlay to reflect current showcase state. ### Signature `void updateOverlay()` ``` -------------------------------- ### List get hiddenFloatingActionKeys Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowCaseWidgetState/hiddenFloatingActionKeys.html Retrieves the list of GlobalKeys associated with hidden floating action buttons. This property is marked as deprecated. ```APIDOC ## List get hiddenFloatingActionKeys ### Description Returns a list of `GlobalKey` objects representing floating action buttons that are currently hidden. ### Deprecation Warning This property is deprecated and will be removed in v6.0.0. Please use `ShowcaseView.get().hiddenFloatingActionKeys` instead. ### Signature `List>> get hiddenFloatingActionKeys` ``` -------------------------------- ### Implement addOnCompleteCallback Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowcaseView/addOnCompleteCallback.html Registers a listener to the internal callback list to be executed when a showcase step finishes. ```dart void addOnCompleteCallback(OnShowcaseCallback listener) { _onCompleteCallbacks.add(listener); } ``` -------------------------------- ### Invalid StatefulWidget build pattern Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowCaseWidgetState/build.html An example of an invalid pattern where closures capture the widget instance instead of the state, leading to stale data. ```dart // (this is not valid Flutter code) class MyButton extends StatefulWidgetX { MyButton({super.key, required this.color}); final Color color; @override Widget build(BuildContext context, State state) { return SpecialWidget( handler: () { print('color: $color'); }, ); } } ``` -------------------------------- ### Callback Registration Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/ShowcaseView-class.html Methods to add and remove listeners for showcase events. ```APIDOC ## addOnStartCallback(OnShowcaseCallback listener) -> void Registers a listener for when the showcase tour starts. ## addOnCompleteCallback(OnShowcaseCallback listener) -> void Registers a listener for when each showcase step completes. ## addOnDismissCallback(OnDismissCallback listener) -> void Registers a listener for when the showcase tour is dismissed. ## addOnFinishCallback(VoidCallback listener) -> void Registers a listener for when the entire showcase tour finishes. ``` -------------------------------- ### Implement build method for TooltipActionButtonWidget Source: https://pub.dev/documentation/showcaseview/latest/showcaseview/TooltipActionButtonWidget/build.html Constructs the widget tree, applying theme styles, handling tap events, and optionally wrapping the result in a Semantics widget for accessibility. ```dart @override Widget build(BuildContext context) { final theme = Theme.of(context); final child = config.button ?? MouseRegion( cursor: SystemMouseCursors.click, child: GestureDetector( onTap: _handleOnTap, child: Container( padding: config.padding, decoration: BoxDecoration( color: config.backgroundColor ?? theme.primaryColor, borderRadius: config.borderRadius, border: config.border, ), child: Row( mainAxisSize: MainAxisSize.min, children: [ if (config.leadIcon case final lead?) Padding( padding: lead.padding ?? const EdgeInsets.only(right: 5), child: lead.icon, ), Text( config.name ?? config.type?.actionName ?? '', style: config.textStyle, ), if (config.tailIcon case final tail?) Padding( padding: tail.padding ?? const EdgeInsets.only(left: 5), child: tail.icon, ), ], ), ), ), ); // Semantics widget is used to improve accessibility for screen readers. // Only applied when semanticEnable is true. if (showCaseState.semanticEnable) { return Semantics( button: true, liveRegion: true, child: child, ); } return child; } ```