Showcase constructor
const
Showcase({
- required GlobalKey<
State< key,StatefulWidget> > - required Widget child,
- String? title,
- TextAlign titleAlignment = TextAlign.start,
- required String? description,
- TextAlign descriptionAlignment = TextAlign.start,
- ShapeBorder targetShapeBorder = const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(8))),
- Color overlayColor = Colors.black45,
- double overlayOpacity = 0.75,
- TextStyle? titleTextStyle,
- TextStyle? descTextStyle,
- Color tooltipBackgroundColor = Colors.white,
- Color textColor = Colors.black,
- Widget scrollLoadingWidget = const CircularProgressIndicator(valueColor: AlwaysStoppedAnimation(Colors.white)),
- bool showArrow = true,
- VoidCallback? onTargetClick,
- bool? disposeOnTap,
- Duration movingAnimationDuration = const Duration(milliseconds: 2000),
- bool? disableMovingAnimation,
- bool? disableScaleAnimation,
- EdgeInsets tooltipPadding = const EdgeInsets.symmetric(vertical: 8, horizontal: 8),
- VoidCallback? onToolTipClick,
- EdgeInsets targetPadding = EdgeInsets.zero,
- double? blurValue,
- BorderRadius? targetBorderRadius,
- VoidCallback? onTargetLongPress,
- VoidCallback? onTargetDoubleTap,
- BorderRadius? tooltipBorderRadius,
- bool disableDefaultTargetGestures = false,
- Duration scaleAnimationDuration = const Duration(milliseconds: 300),
- Curve scaleAnimationCurve = Curves.easeIn,
- Alignment? scaleAnimationAlignment,
- TooltipPosition? tooltipPosition,
- EdgeInsets? titlePadding,
- EdgeInsets? descriptionPadding,
- Widget? container,
Implementation
const Showcase({
required this.key,
required this.child,
this.title,
this.titleAlignment = TextAlign.start,
required this.description,
this.descriptionAlignment = TextAlign.start,
this.targetShapeBorder = const RoundedRectangleBorder(
borderRadius: BorderRadius.all(
Radius.circular(8),
),
),
this.overlayColor = Colors.black45,
this.overlayOpacity = 0.75,
this.titleTextStyle,
this.descTextStyle,
this.tooltipBackgroundColor = Colors.white,
this.textColor = Colors.black,
this.scrollLoadingWidget = const CircularProgressIndicator(
valueColor: AlwaysStoppedAnimation(Colors.white)),
this.showArrow = true,
this.onTargetClick,
this.disposeOnTap,
this.movingAnimationDuration = const Duration(milliseconds: 2000),
this.disableMovingAnimation,
this.disableScaleAnimation,
this.tooltipPadding =
const EdgeInsets.symmetric(vertical: 8, horizontal: 8),
this.onToolTipClick,
this.targetPadding = EdgeInsets.zero,
this.blurValue,
this.targetBorderRadius,
this.onTargetLongPress,
this.onTargetDoubleTap,
this.tooltipBorderRadius,
this.disableDefaultTargetGestures = false,
this.scaleAnimationDuration = const Duration(milliseconds: 300),
this.scaleAnimationCurve = Curves.easeIn,
this.scaleAnimationAlignment,
this.tooltipPosition,
this.titlePadding,
this.descriptionPadding,
this.container,
}) : height = null,
width = null,
assert(overlayOpacity >= 0.0 && overlayOpacity <= 1.0,
"overlay opacity must be between 0 and 1."),
assert(
onTargetClick == null
? true
: (disposeOnTap == null ? false : true),
"disposeOnTap is required if you're using onTargetClick"),
assert(
disposeOnTap == null
? true
: (onTargetClick == null ? false : true),
"onTargetClick is required if you're using disposeOnTap");