show<T extends TutorialEntry> method
void
show<T extends TutorialEntry>(
- BuildContext context, {
- GlobalKey<
TutorialWidgetState> ? key, - required List<
T> children, - DialogBuilder? dialogBuilder,
- Color backgroundColor = Colors.black,
- double backgroundMaxOpacity = 0.5,
- AnimationController? opacityAnimationController,
- AnimationController? highlightAnimationController,
- Animation<
double> ? opacityAnimation, - Animation<
double> ? highlightAnimation, - OnPressedBehavior onPressedBehavior = OnPressedBehavior.next,
- Future<
void> prepareNext()?,
Implementation
void show<T extends TutorialEntry>(
BuildContext context, {
GlobalKey<TutorialWidgetState>? key,
required List<T> children,
DialogBuilder? dialogBuilder,
Color backgroundColor = Colors.black,
double backgroundMaxOpacity = 0.5,
AnimationController? opacityAnimationController,
AnimationController? highlightAnimationController,
Animation<double>? opacityAnimation,
Animation<double>? highlightAnimation,
OnPressedBehavior onPressedBehavior = OnPressedBehavior.next,
/// Place to wait for any animations between tutorial items to finish.
///
/// Works only with [onPressedBehaviour] set to [OnPressedBehavior.next].
/// Called before firing next event on tap.
Future<void> Function()? prepareNext,
}) {
if (!_isVisible) {
_isVisible = true;
key = key ?? GlobalKey<TutorialWidgetState>();
_overlayBackground = _overlayBackground ??
OverlayEntry(
builder: (BuildContext context) => TutorialWidget<T>(
key: key,
children: children,
close: () => _close(key!),
dialogBuilder: dialogBuilder,
backgroundColor: backgroundColor,
backgroundMaxOpacity: backgroundMaxOpacity,
highlightAnimation: highlightAnimation,
opacityAnimation: opacityAnimation,
opacityAnimationController: opacityAnimationController,
highlightAnimationController: highlightAnimationController,
onPressedBehavior: onPressedBehavior,
prepareNext: prepareNext,
),
);
Overlay.of(context)?.insert(_overlayBackground!);
}
}