IntroductionScreen constructor

IntroductionScreen({
  1. Key? key,
  2. List<PageViewModel>? pages,
  3. List<Widget>? rawPages,
  4. VoidCallback? onDone,
  5. VoidCallback? onSkip,
  6. ValueChanged<int>? onChange,
  7. Widget? done,
  8. Widget? overrideDone,
  9. Widget? skip,
  10. Widget? overrideSkip,
  11. Widget? next,
  12. Widget? overrideNext,
  13. Widget? back,
  14. Widget? overrideBack,
  15. bool showSkipButton = false,
  16. bool showNextButton = true,
  17. bool showDoneButton = true,
  18. bool showBottomPart = true,
  19. bool showBackButton = false,
  20. Widget? customProgress,
  21. bool isProgress = true,
  22. bool hideBottomOnKeyboard = false,
  23. bool isProgressTap = true,
  24. bool freeze = false,
  25. Color? globalBackgroundColor,
  26. DotsDecorator dotsDecorator = const DotsDecorator(),
  27. Decoration? dotsContainerDecorator,
  28. int animationDuration = 350,
  29. int? autoScrollDuration,
  30. bool infiniteAutoScroll = false,
  31. int initialPage = 0,
  32. int skipOrBackFlex = 1,
  33. int dotsFlex = 1,
  34. int nextFlex = 1,
  35. Curve curve = Curves.easeIn,
  36. ButtonStyle? baseBtnStyle,
  37. ButtonStyle? skipStyle,
  38. ButtonStyle? nextStyle,
  39. ButtonStyle? doneStyle,
  40. ButtonStyle? backStyle,
  41. String? skipSemantic,
  42. String? nextSemantic,
  43. String? doneSemantic,
  44. String? backSemantic,
  45. bool resizeToAvoidBottomInset = true,
  46. Position controlsPosition = const Position(left: 0, right: 0, bottom: 0),
  47. EdgeInsets controlsMargin = EdgeInsets.zero,
  48. EdgeInsets controlsPadding = const EdgeInsets.all(16.0),
  49. EdgeInsets bodyPadding = EdgeInsets.zero,
  50. Widget? globalHeader,
  51. Widget? globalFooter,
  52. List<ScrollController?>? scrollControllers,
  53. Axis pagesAxis = Axis.horizontal,
  54. ScrollPhysics scrollPhysics = const BouncingScrollPhysics(),
  55. bool rtl = false,
  56. bool allowImplicitScrolling = false,
  57. CanProgress canProgress = kDefaultCanProgressFunction,
  58. 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);