useDefaultTheme static method

Widget Function(StepWidgetParams params) useDefaultTheme({
  1. required List<TipInfoBean> tipInfo,
  2. String buttonTextBuilder(
    1. int currentStepIndex,
    2. int stepCount
    )?,
  3. bool showStepLabel = true,
  4. bool showSkipLabel = true,
  5. bool showClose = true,
})

Implementation

static Widget Function(StepWidgetParams params) useDefaultTheme(
    {required List<TipInfoBean> tipInfo,
    String Function(int currentStepIndex, int stepCount)? buttonTextBuilder,
    bool showStepLabel = true,
    bool showSkipLabel = true,
    bool showClose = true}) {
  return (StepWidgetParams stepWidgetParams) {
    int currentStepIndex = stepWidgetParams.currentStepIndex;
    int stepCount = stepWidgetParams.stepCount;
    Offset offset = stepWidgetParams.offset;
    Size size = stepWidgetParams.size;
    Map position = _smartGetPosition(
        screenSize: stepWidgetParams.screenSize,
        size: size,
        offset: offset,
        introMode: stepWidgetParams.introMode);
    return Stack(
      children: [
        Positioned(
          left: position['left'],
          top: position['top'],
          bottom: position['bottom'],
          right: position['right'],
          child: Container(
              width: position['direction'] == GuideDirection.left ||
                      position['direction'] == GuideDirection.right
                  ? position['width'] + 8
                  : position['width'],
              child: TipInfoWidget(
                width: position['width'],
                height: null,
                info: tipInfo[currentStepIndex],
                onNext: showStepLabel ? stepWidgetParams.onNext : null,
                onSkip: showSkipLabel ? stepWidgetParams.onFinish : null,
                onClose: showClose ? stepWidgetParams.onFinish : null,
                currentStepIndex: currentStepIndex,
                stepCount: stepCount,
                direction: position['direction'],
                mode: stepWidgetParams.introMode,
                arrowPadding: position['arrowPadding'],
                nextTip: buttonTextBuilder != null
                    ? buttonTextBuilder(currentStepIndex, stepCount)
                    : null,
              )),
        ),
        Positioned(
          left: offset.dx + size.width / 2 - 10,
          top: offset.dy + size.height / 2 - 10,
          child: stepWidgetParams.introMode == GuideMode.soft
              ? const PulseWidget(
                  width: 20,
                  height: 20,
                )
              : const Row(),
        ),
      ],
    );
  };
}