Showcase constructor

const Showcase({
  1. required GlobalKey<State<StatefulWidget>> key,
  2. required String? description,
  3. required Widget child,
  4. String? title,
  5. TextAlign titleAlignment = TextAlign.start,
  6. TextAlign descriptionAlignment = TextAlign.start,
  7. ShapeBorder targetShapeBorder = const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(8))),
  8. Color overlayColor = Colors.black45,
  9. double overlayOpacity = 0.75,
  10. TextStyle? titleTextStyle,
  11. TextStyle? descTextStyle,
  12. Color tooltipBackgroundColor = Colors.white,
  13. Color textColor = Colors.black,
  14. Widget scrollLoadingWidget = const CircularProgressIndicator(valueColor: AlwaysStoppedAnimation(Colors.white)),
  15. bool showArrow = true,
  16. VoidCallback? onTargetClick,
  17. bool? disposeOnTap,
  18. Duration movingAnimationDuration = const Duration(milliseconds: 2000),
  19. bool? disableMovingAnimation,
  20. bool? disableScaleAnimation,
  21. EdgeInsets tooltipPadding = const EdgeInsets.symmetric(vertical: 8, horizontal: 8),
  22. VoidCallback? onToolTipClick,
  23. EdgeInsets targetPadding = EdgeInsets.zero,
  24. double? blurValue,
  25. BorderRadius? targetBorderRadius,
  26. VoidCallback? onTargetLongPress,
  27. VoidCallback? onTargetDoubleTap,
  28. BorderRadius? tooltipBorderRadius,
  29. bool disableDefaultTargetGestures = false,
  30. Duration scaleAnimationDuration = const Duration(milliseconds: 300),
  31. Curve scaleAnimationCurve = Curves.easeIn,
  32. Alignment? scaleAnimationAlignment,
  33. TooltipPosition? tooltipPosition,
  34. EdgeInsets? titlePadding,
  35. EdgeInsets? descriptionPadding,
  36. TextDirection? titleTextDirection,
  37. TextDirection? descriptionTextDirection,
  38. VoidCallback? onBarrierClick,
  39. bool disableBarrierInteraction = false,
  40. double toolTipSlideEndDistance = 7,
  41. Widget? staticContainer,
})

Implementation

const Showcase(
    {required this.key,
    required this.description,
    required this.child,
    this.title,
    this.titleAlignment = TextAlign.start,
    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.titleTextDirection,
    this.descriptionTextDirection,
    this.onBarrierClick,
    this.disableBarrierInteraction = false,
    this.toolTipSlideEndDistance = 7,
    this.staticContainer})
    : height = null,
      width = null,
      container = null,
      assert(overlayOpacity >= 0.0 && overlayOpacity <= 1.0,
          "overlay opacity must be between 0 and 1."),
      assert(onTargetClick == null || disposeOnTap != null,
          "disposeOnTap is required if you're using onTargetClick"),
      assert(disposeOnTap == null || onTargetClick != null,
          "onTargetClick is required if you're using disposeOnTap"),
      assert(onBarrierClick == null || disableBarrierInteraction == false,
          "can't use onBarrierClick & disableBarrierInteraction property at same time");