Skip to content

Commit efd3a59

Browse files
committed
add navigate buttons color param
1 parent 0817696 commit efd3a59

6 files changed

Lines changed: 20 additions & 14 deletions

File tree

lib/src/helpers/constants.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ignore_for_file: constant_identifier_names
22
/// This package contains all the constants used.
33
4-
const BUBBLE_WIDTH = 55.0;
4+
const BUBBLE_WIDTH = 50.0;
55

66
const FULL_TRANSITION_PX = 300.0;
77

lib/src/models/page_view_model.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class PageViewModel {
1515
this.textStyle,
1616
this.titleTextStyle = const TextStyle(color: Colors.white, fontSize: 50.0),
1717
this.bodyTextStyle = const TextStyle(color: Colors.white, fontSize: 24.0),
18+
this.buttonsTextStyle,
1819
});
1920

2021
/// Page background color.
@@ -71,6 +72,8 @@ class PageViewModel {
7172
/// Defaults to `TextStyle(color: Colors.white, fontSize: 24.0)`.
7273
final TextStyle bodyTextStyle;
7374

75+
final TextStyle? buttonsTextStyle;
76+
7477
/// Main widget.
7578
///
7679
/// _Typically an [Image] widget_.

lib/src/ui/intro_views_flutter.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ class _IntroViewsFlutterState extends State<IntroViewsFlutter> with TickerProvid
283283
textStyle: textStyle,
284284
activePageIndex: activePageIndex,
285285
totalPages: pages.length,
286+
buttonsTextStyle: pages[activePageIndex].buttonsTextStyle,
286287
onPressedDoneButton: widget.onTapDoneButton,
287288
// void callback to be executed after pressing done button
288289
slidePercent: slidePercent,

lib/src/ui/page.dart

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,14 @@ class Page extends StatelessWidget {
5858
),
5959
),
6060
Expanded(
61-
flex: 4,
61+
flex: 3,
6262
child: _ImagePageTransform(
6363
percentVisible: percentVisible,
6464
pageViewModel: pageViewModel,
6565
),
6666
),
6767
Flexible(
68-
flex: 2,
68+
flex: 3,
6969
child: _BodyPageTransform(
7070
percentVisible: percentVisible,
7171
pageViewModel: pageViewModel,
@@ -92,8 +92,7 @@ class Page extends StatelessWidget {
9292
mainAxisAlignment: columnMainAxisAlignment,
9393
mainAxisSize: MainAxisSize.max,
9494
children: <Widget>[
95-
Expanded(
96-
flex: 2,
95+
Flexible(
9796
child: SafeArea(
9897
child: _TitlePageTransform(
9998
percentVisible: percentVisible,
@@ -102,10 +101,11 @@ class Page extends StatelessWidget {
102101
),
103102
),
104103
Expanded(
105-
flex: 4,
106-
child: _BodyPageTransform(
107-
percentVisible: percentVisible,
108-
pageViewModel: pageViewModel,
104+
child: SafeArea(
105+
child: _BodyPageTransform(
106+
percentVisible: percentVisible,
107+
pageViewModel: pageViewModel,
108+
),
109109
),
110110
),
111111
],
@@ -136,7 +136,7 @@ class _BodyPageTransform extends StatelessWidget {
136136
Matrix4.translationValues(0.0, 30.0 * (1 - percentVisible), 0.0),
137137
child: Padding(
138138
padding: EdgeInsets.only(
139-
bottom: 100.0 + MediaQuery.of(context).padding.bottom,
139+
bottom: 75.0 + MediaQuery.of(context).padding.bottom,
140140
left: 10.0,
141141
right: 10.0,
142142
),

lib/src/ui/page_bubble.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ class PageBubble extends StatelessWidget {
2121
height: 65.0,
2222
child: Center(
2323
child: Padding(
24-
padding: const EdgeInsets.all(10.0),
24+
padding: const EdgeInsets.all(0),
2525
child: Container(
2626
// this method returns in between values according to active percent
27-
width: lerpDouble(20.0, 45.0, viewModel.activePercent),
28-
height: lerpDouble(20.0, 45.0, viewModel.activePercent),
27+
width: lerpDouble(20.0, 40.0, viewModel.activePercent),
28+
height: lerpDouble(20.0, 40.0, viewModel.activePercent),
2929
decoration: BoxDecoration(
3030
shape: BoxShape.circle,
3131
// alpha is used to create fade effect for background color

lib/src/ui/page_indicator_buttons.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ class PageIndicatorButtons extends StatelessWidget {
106106
this.showNextButton = true,
107107
this.showBackButton = true,
108108
required this.backText,
109+
this.buttonsTextStyle,
109110
}) : super(key: key);
110111

111112
final int activePageIndex;
@@ -126,6 +127,7 @@ class PageIndicatorButtons extends StatelessWidget {
126127
final Widget nextText;
127128
final Widget backText;
128129
final TextStyle textStyle;
130+
final TextStyle? buttonsTextStyle;
129131

130132
final bool doneButtonPersist;
131133

@@ -204,7 +206,7 @@ class PageIndicatorButtons extends StatelessWidget {
204206
bottom: 0.0,
205207
child: SafeArea(
206208
child: DefaultTextStyle(
207-
style: textStyle,
209+
style: buttonsTextStyle ?? textStyle,
208210
child: Row(
209211
mainAxisAlignment: MainAxisAlignment.spaceBetween,
210212
crossAxisAlignment: CrossAxisAlignment.center,

0 commit comments

Comments
 (0)