Showcase constructor

const Showcase({
  1. required GlobalKey<State<StatefulWidget>> key,
  2. required Widget child,
  3. String? title,
  4. TextAlign titleAlignment = TextAlign.start,
  5. required String? description,
  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. 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");