Skip to content

Commit 7d8b9e3

Browse files
committed
rename properties
1 parent 579ca50 commit 7d8b9e3

File tree

1 file changed

+40
-42
lines changed

1 file changed

+40
-42
lines changed

lib/intro_views_flutter.dart

Lines changed: 40 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -49,23 +49,23 @@ class IntroViewsFlutter extends StatefulWidget {
4949
final String pageButtonFontFamily;
5050

5151
/// Override 'DONE' Text with Your Own Text, its TextStyle will be copied and override [pageButtonTextSize] [PageButtonFontFamily] [PageButtonsColor]
52-
final Text done;
52+
final Text endText;
5353

5454
/// Override 'Skip' Text with Your Own Text, its TextStyle will be copied and override [pageButtonTextSize] [PageButtonFontFamily] [PageButtonsColor]
55-
final Text skip;
56-
IntroViewsFlutter(this.pages, {
55+
final Text startText;
56+
IntroViewsFlutter(
57+
this.pages, {
5758
Key key,
58-
this.onTapDoneButton,
59-
this.showSkipButton = true,
60-
this.pageButtonTextStyles,
61-
this.pageButtonTextSize = 18.0,
62-
this.pageButtonFontFamily,
63-
this.onTapSkipButton,
64-
this.pageButtonsColor,
65-
this.done,
66-
this.skip,
67-
}): super(key: key);
68-
59+
this.onTapDoneButton,
60+
this.showSkipButton = true,
61+
this.pageButtonTextStyles,
62+
this.pageButtonTextSize = 18.0,
63+
this.pageButtonFontFamily,
64+
this.onTapSkipButton,
65+
this.pageButtonsColor,
66+
this.endText = const Text("DONE"),
67+
this.startText = const Text("SKIP"),
68+
}) : super(key: key);
6969

7070
@override
7171
_IntroViewsFlutterState createState() => new _IntroViewsFlutterState();
@@ -161,7 +161,7 @@ class _IntroViewsFlutterState extends State<IntroViewsFlutter>
161161
162162
@override
163163
Widget build(BuildContext context) {
164-
TextStyle defaultTextStyle = new TextStyle(
164+
TextStyle textStyle = new TextStyle(
165165
fontSize: widget.pageButtonTextSize ?? 18.0,
166166
color: widget.pageButtonsColor ?? const Color(0x88FFFFFF),
167167
fontFamily: widget.pageButtonFontFamily)
@@ -196,34 +196,32 @@ class _IntroViewsFlutterState extends State<IntroViewsFlutter>
196196
),
197197
), //PagerIndicator
198198

199-
DefaultTextStyle.merge(
200-
style: defaultTextStyle,
201-
child: PageIndicatorButtons(
202-
//Skip and Done Buttons
203-
acitvePageIndex: activePageIndex,
204-
totalPages: pages.length,
205-
onPressedDoneButton: widget
206-
.onTapDoneButton, //void Callback to be executed after pressing done button
207-
slidePercent: slidePercent,
208-
slideDirection: slideDirection,
209-
onPressedSkipButton: () {
210-
//method executed on pressing skip button
211-
setState(() {
212-
activePageIndex = pages.length - 1;
213-
nextPageIndex = activePageIndex;
214-
// after skip pressed invoke function
215-
// this can be used for analytics/page transition
216-
if (widget.onTapSkipButton != null) {
217-
widget.onTapSkipButton();
218-
}
219-
});
220-
},
221-
showSkipButton: widget.showSkipButton,
222-
done: widget.done,
223-
skip: widget.skip,
224-
),
225-
199+
new PageIndicatorButtons(
200+
//Skip and Done Buttons
201+
textStyle: textStyle,
202+
acitvePageIndex: activePageIndex,
203+
totalPages: pages.length,
204+
onPressedDoneButton: widget
205+
.onTapDoneButton, //void Callback to be executed after pressing done button
206+
slidePercent: slidePercent,
207+
slideDirection: slideDirection,
208+
onPressedSkipButton: () {
209+
//method executed on pressing skip button
210+
setState(() {
211+
activePageIndex = pages.length - 1;
212+
nextPageIndex = activePageIndex;
213+
// after skip pressed invoke function
214+
// this can be used for analytics/page transition
215+
if (widget.onTapSkipButton != null) {
216+
widget.onTapSkipButton();
217+
}
218+
});
219+
},
220+
showSkipButton: widget.showSkipButton,
221+
endText: widget.endText,
222+
startText: widget.startText,
226223
),
224+
227225
new PageDragger(
228226
//Used for gesture control
229227
canDragLeftToRight: activePageIndex > 0,

0 commit comments

Comments
 (0)