IntroductionScreen constructor
IntroductionScreen({
- Key? key,
- List<
PageViewModel> ? pages, - List<
Widget> ? rawPages, - VoidCallback? onDone,
- VoidCallback? onSkip,
- ValueChanged<
int> ? onChange, - Widget? done,
- Widget? overrideDone,
- Widget? skip,
- Widget? overrideSkip,
- Widget? next,
- Widget? overrideNext,
- Widget? back,
- Widget? overrideBack,
- bool showSkipButton = false,
- bool showNextButton = true,
- bool showDoneButton = true,
- bool showBottomPart = true,
- bool showBackButton = false,
- Widget? customProgress,
- bool isProgress = true,
- bool hideBottomOnKeyboard = false,
- bool isProgressTap = true,
- bool freeze = false,
- Color? globalBackgroundColor,
- DotsDecorator dotsDecorator = const DotsDecorator(),
- Decoration? dotsContainerDecorator,
- int animationDuration = 350,
- int? autoScrollDuration,
- bool infiniteAutoScroll = false,
- int initialPage = 0,
- int skipOrBackFlex = 1,
- int dotsFlex = 1,
- int nextFlex = 1,
- Curve curve = Curves.easeIn,
- ButtonStyle? baseBtnStyle,
- ButtonStyle? skipStyle,
- ButtonStyle? nextStyle,
- ButtonStyle? doneStyle,
- ButtonStyle? backStyle,
- String? skipSemantic,
- String? nextSemantic,
- String? doneSemantic,
- String? backSemantic,
- bool resizeToAvoidBottomInset = true,
- Position controlsPosition = const Position(left: 0, right: 0, bottom: 0),
- EdgeInsets controlsMargin = EdgeInsets.zero,
- EdgeInsets controlsPadding = const EdgeInsets.all(16.0),
- EdgeInsets bodyPadding = EdgeInsets.zero,
- Widget? globalHeader,
- List<
ScrollController?> ? scrollControllers, - Axis pagesAxis = Axis.horizontal,
- ScrollPhysics scrollPhysics = const BouncingScrollPhysics(),
- bool rtl = false,
- bool allowImplicitScrolling = false,
- CanProgress canProgress = kDefaultCanProgressFunction,
- List<
bool> safeAreaList = const [false, false, false, false],
Implementation
IntroductionScreen(
{Key? key,
this.pages,
this.rawPages,
this.onDone,
this.onSkip,
this.onChange,
this.done,
this.overrideDone,
this.skip,
this.overrideSkip,
this.next,
this.overrideNext,
this.back,
this.overrideBack,
this.showSkipButton = false,
this.showNextButton = true,
this.showDoneButton = true,
this.showBottomPart = true,
this.showBackButton = false,
this.customProgress,
this.isProgress = true,
this.hideBottomOnKeyboard = false,
this.isProgressTap = true,
this.freeze = false,
this.globalBackgroundColor,
this.dotsDecorator = const DotsDecorator(),
this.dotsContainerDecorator,
this.animationDuration = 350,
this.autoScrollDuration,
this.infiniteAutoScroll = false,
this.initialPage = 0,
this.skipOrBackFlex = 1,
this.dotsFlex = 1,
this.nextFlex = 1,
this.curve = Curves.easeIn,
this.baseBtnStyle,
this.skipStyle,
this.nextStyle,
this.doneStyle,
this.backStyle,
this.skipSemantic,
this.nextSemantic,
this.doneSemantic,
this.backSemantic,
this.resizeToAvoidBottomInset = true,
this.controlsPosition = const Position(left: 0, right: 0, bottom: 0),
this.controlsMargin = EdgeInsets.zero,
this.controlsPadding = const EdgeInsets.all(16.0),
this.bodyPadding = EdgeInsets.zero,
this.globalHeader,
this.globalFooter,
this.scrollControllers,
this.pagesAxis = Axis.horizontal,
this.scrollPhysics = const BouncingScrollPhysics(),
this.rtl = false,
this.allowImplicitScrolling = false,
this.canProgress = kDefaultCanProgressFunction,
this.safeAreaList = const [false, false, false, false]})
: assert(
pages != null || rawPages != null,
"You must set either 'pages' or 'rawPages' parameter",
),
assert(
(pages?.length ?? rawPages?.length ?? 0) > 0,
"You must provide at least one page using 'pages' or 'rawPages' parameter !",
),
assert(
!showDoneButton || done != null || overrideDone != null,
"You must set 'done' or 'overrideDone' parameter, or set 'showDoneButton' to false",
),
assert(
done == null || onDone != null,
"If you set 'done' parameter, you must also set 'onDone' parameter",
),
assert(
!showSkipButton || skip != null || overrideSkip != null,
"You must set 'skip' or 'overrideSkip' parameter, or set 'showSkipButton' to false",
),
assert(
!showNextButton || next != null || overrideNext != null,
"You must set 'next' or 'overrideNext' parameter, or set 'showNextButton' to false",
),
assert(
!showBackButton || back != null || overrideBack != null,
"You must set 'back' or 'overrideBack' parameter, or set 'showBackButton' to false",
),
assert(
!(showBackButton && showSkipButton),
"You cannot set 'showBackButton' and 'showSkipButton' to true. Only one, or both false.",
),
assert(
skipOrBackFlex >= 0 && dotsFlex >= 0 && nextFlex >= 0,
'Flex parameters must be >= 0',
),
assert(
initialPage >= 0,
'Initial page parameter must by a positive number, >= 0.',
),
assert(
hideBottomOnKeyboard == isProgress || !hideBottomOnKeyboard,
'hideBottomOnKeyboard can only be true if isProgress = true',
),
assert(
customProgress != null && isProgress || customProgress == null,
'customProgress can only be used if isProgress = true',
),
assert(
(infiniteAutoScroll && autoScrollDuration != null) ||
!infiniteAutoScroll,
'infiniteAutoScroll can only be true if autoScrollDuration != null',
),
super(key: key);