Skip to content

Commit d838a90

Browse files
authored
Merge pull request #233 from guyluz11/master
Show first back button option
2 parents f8121f7 + 252b291 commit d838a90

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

lib/src/introduction_screen.dart

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ class IntroductionScreen extends StatefulWidget {
9999
/// @Default `false`
100100
final bool showBackButton;
101101

102+
/// If the Back button should be display for the first page
103+
///
104+
/// @Default `false`
105+
final bool showFirstBackButton;
106+
102107
/// If a custom Widget should be used instead of the default progress indicator
103108
///
104109
/// @Default `null`
@@ -305,6 +310,7 @@ class IntroductionScreen extends StatefulWidget {
305310
this.showDoneButton = true,
306311
this.showBottomPart = true,
307312
this.showBackButton = false,
313+
this.showFirstBackButton = false,
308314
this.customProgress,
309315
this.isProgress = true,
310316
this.hideBottomOnKeyboard = false,
@@ -575,9 +581,10 @@ class IntroductionScreenState extends State<IntroductionScreen> {
575581
onPressed: _onSkip,
576582
),
577583
);
578-
} else if (widget.showBackButton &&
579-
getCurrentPage() > 0 &&
580-
widget.canProgress(getCurrentPage())) {
584+
} else if ((widget.showFirstBackButton && getCurrentPage() == 0) ||
585+
(widget.showBackButton &&
586+
getCurrentPage() > 0 &&
587+
widget.canProgress(getCurrentPage()))) {
581588
leftBtn = widget.overrideBack != null
582589
? widget.overrideBack!(context, !_isScrolling ? previous : null)
583590
: IntroButton(

0 commit comments

Comments
 (0)