Skip to content

Commit

Permalink
Merge pull request #219 from dekoster-IT-Consulting-GmbH/master
Browse files Browse the repository at this point in the history
feat(intro_page): allow skipButton and backButton to be used at the same time
  • Loading branch information
Pyozer authored Feb 12, 2025
2 parents 75d4d14 + a889e46 commit ed27dbf
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/src/introduction_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -366,10 +366,6 @@ class IntroductionScreen extends StatefulWidget {
!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',
Expand Down Expand Up @@ -550,7 +546,9 @@ class IntroductionScreenState extends State<IntroductionScreen> {
final isLastPage = (getCurrentPage() == getPagesLength() - 1);

Widget? leftBtn;
if (widget.showSkipButton) {
// show skip button when skip is enabled and back is disabled,
// or show it on the first page when back is enabled.
if (widget.showSkipButton && ((getCurrentPage() == 0 && widget.showBackButton) || !widget.showBackButton)) {
leftBtn = Visibility(
visible: !isLastPage && !_isSkipPressed,
maintainState: true,
Expand Down

0 comments on commit ed27dbf

Please sign in to comment.