useDefaultTheme static method
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(),
),
],
);
};
}