showTutorial method

void showTutorial({
  1. bool? hideSkip,
  2. String? skipText,
  3. TextStyle? skipTextStyle,
  4. AlignmentGeometry? skipPosition,
  5. Color? bgColor,
  6. double? opacity,
  7. double? padding,
  8. List? keyList,
  9. double? radius,
  10. dynamic clickTarget(
    1. TargetFocus
    )?,
  11. dynamic clickOverlay(
    1. TargetFocus
    )?,
  12. dynamic clickTargetWithTapPosition(
    1. TargetFocus,
    2. TapDownDetails
    )?,
  13. dynamic onSkip()?,
  14. dynamic onFinish()?,
})

Implementation

void showTutorial({
  bool? hideSkip,
  String? skipText,
  TextStyle? skipTextStyle,
  AlignmentGeometry? skipPosition,
  Color? bgColor,
  double? opacity,
  double? padding,
  List? keyList,
  double? radius,
  Function(TargetFocus)? clickTarget,
  Function(TargetFocus)? clickOverlay,
  Function(TargetFocus, TapDownDetails)? clickTargetWithTapPosition,
  Function()? onSkip,
  Function()? onFinish,
}) {
  TutorialCoachMark(
    targets: _createTargets(
      keyList: keyList ?? [],
      radius: radius,
      skipPosition: skipPosition,
    ),
    colorShadow: bgColor ?? Colors.red,
    pulseEnable: false,
    skipWidget: Text(
      skipText ?? "跳过",
      style: skipTextStyle,
    ),
    hideSkip: hideSkip ?? false,
    paddingFocus: padding ?? 0,
    opacityShadow: opacity ?? 0.5,
    imageFilter: ImageFilter.blur(sigmaX: 8, sigmaY: 8),
    onFinish: () {
      onFinish?.call();
    },
    onClickTarget: (target) {
      clickTarget?.call(target);
    },
    onClickTargetWithTapPosition: (target, tapDetails) {
      clickTargetWithTapPosition?.call(target, tapDetails);
    },
    onClickOverlay: (target) {
      clickOverlay?.call(target);
    },
    onSkip: () {
      onSkip?.call();
      return true;
    },
  ).show(context: context);
}