@@ -35,6 +35,7 @@ import 'shape_clipper.dart';
35
35
import 'showcase_widget.dart' ;
36
36
import 'tooltip_action_button_widget.dart' ;
37
37
import 'tooltip_widget.dart' ;
38
+ import 'widget/floating_action_widget.dart' ;
38
39
39
40
class Showcase extends StatefulWidget {
40
41
/// A key that is unique across the entire app.
@@ -96,8 +97,9 @@ class Showcase extends StatefulWidget {
96
97
/// Custom tooltip widget when [Showcase.withWidget] is used.
97
98
final Widget ? container;
98
99
99
- /// Custom static tooltip widget when [Showcase.withWidget] is used.
100
- final Widget ? staticContainer;
100
+ /// Custom static floating action widget to show a static widget anywhere
101
+ /// on the screen
102
+ final FloatingActionWidget ? floatingActionWidget;
101
103
102
104
/// Defines background color for tooltip widget.
103
105
///
@@ -418,10 +420,10 @@ class Showcase extends StatefulWidget {
418
420
this .tooltipActionConfig,
419
421
this .scrollAlignment = 0.5 ,
420
422
this .enableAutoScroll,
423
+ this .floatingActionWidget,
421
424
}) : height = null ,
422
425
width = null ,
423
426
container = null ,
424
- staticContainer = null ,
425
427
assert (overlayOpacity >= 0.0 && overlayOpacity <= 1.0 ,
426
428
"overlay opacity must be between 0 and 1." ),
427
429
assert (onTargetClick == null || disposeOnTap != null ,
@@ -471,6 +473,7 @@ class Showcase extends StatefulWidget {
471
473
/// - `toolTipSlideEndDistance` : The distance the tooltip slides in from the edge of the screen (defaults to 7dp).
472
474
/// - `tooltipActions` : A list of custom actions (widgets) to display within the tooltip.
473
475
/// - `tooltipActionConfig` : Configuration options for custom tooltip actions.
476
+ /// - `floatingActionWidget` : Custom static floating action widget to show a static widget anywhere
474
477
///
475
478
/// **Differences from default constructor:**
476
479
///
@@ -488,7 +491,7 @@ class Showcase extends StatefulWidget {
488
491
required this .width,
489
492
required this .container,
490
493
required this .child,
491
- this .staticContainer ,
494
+ this .floatingActionWidget ,
492
495
this .targetShapeBorder = const RoundedRectangleBorder (
493
496
borderRadius: BorderRadius .all (
494
497
Radius .circular (8 ),
@@ -794,7 +797,8 @@ class _ShowcaseState extends State<Showcase> {
794
797
titleTextStyle: widget.titleTextStyle,
795
798
descTextStyle: widget.descTextStyle,
796
799
container: widget.container,
797
- staticContainer: widget.staticContainer,
800
+ floatingActionWidget: widget.floatingActionWidget ??
801
+ showCaseWidgetState.widget.globalFloatingActionWidget,
798
802
tooltipBackgroundColor: widget.tooltipBackgroundColor,
799
803
textColor: widget.textColor,
800
804
showArrow: widget.showArrow,
0 commit comments