Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(intro_page): allow skipButton and backButton to be used at the same time #219

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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