Skip to content

Commit 86a27b1

Browse files
committed
gfintroslide example testing
1 parent 1cecfef commit 86a27b1

File tree

3 files changed

+123
-26
lines changed

3 files changed

+123
-26
lines changed

example/lib/main_temp.dart

Lines changed: 101 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -117,39 +117,114 @@ class IntroScreen extends StatefulWidget {
117117
_IntroScreenState createState() => _IntroScreenState();
118118
}
119119
class _IntroScreenState extends State<IntroScreen> {
120+
121+
PageController _pageController;
122+
List<Widget> slideList;
123+
int initialPage;
124+
125+
@override
126+
void initState() {
127+
_pageController = PageController(initialPage: 1, keepPage: false, viewportFraction: 2);
128+
initialPage = _pageController.initialPage;
129+
super.initState();
130+
}
131+
132+
120133
@override
121134
// ignore: prefer_expression_function_bodies
122135
Widget build(BuildContext context) {
123136
return SafeArea(
124137
child: GFIntroScreen(
125-
// height: 500,
126-
// width: 300,
127-
color: Colors.blueGrey,
138+
height: 500,
139+
width: 300,
140+
// color: Colors.blueGrey,
128141
slides: slides(),
129-
// type: GFIntroType.rounded,
130-
// pageController: PageController(
131-
// initialPage: 1, keepPage: false, viewportFraction: 2
132-
// ),
142+
pageController: _pageController,
143+
gfIntroBottomNavigation: GFIntroBottomNavigation(
144+
pageController: _pageController,
145+
pageCount: slideList.length,
146+
currentIndex: initialPage,
147+
// child: Text('dfghj'),
148+
149+
// onForwardButtonTap: () {
150+
// print('fffffff');
151+
// // _pageController.nextPage(
152+
// // duration: const Duration(milliseconds: 500),
153+
// // curve: Curves.linear);
154+
// },
155+
// onBackButtonTap: () {
156+
// print('kkkkkkkkk');
157+
// // _pageController.previousPage(
158+
// // duration: const Duration(milliseconds: 500),
159+
// // curve: Curves.linear);
160+
// },
161+
// onDoneTap: (){
162+
// print('done');
163+
// },
164+
// onSkipTap: (){
165+
// print('skip');
166+
// },
167+
// backButtonTextStyle: TextStyle(
168+
// fontSize: 12
169+
// ),
133170

171+
// backButton: GFButton(onPressed: null, child: Text('back'),),
172+
// forwardButton: GFButton(onPressed: null, child: Text('next'),),
173+
// skipButton: GFButton(onPressed: null, child: Text('skip'),),
174+
// doneButton: GFButton(onPressed: null, child: Text('done'),),
175+
176+
// backButtonText: 'bbbb',
177+
// forwardButtonText: 'ffffff',
178+
// skipButtonText: 'ssssss',
179+
// doneButtonText: 'ddddddd',
180+
181+
// navigationBarHeight: 100,
182+
// navigationBarWidth: 300,
183+
// navigationBarMargin: EdgeInsets.all(20),
184+
// navigationBarPadding: EdgeInsets.all(20),
185+
// navigationBarShape: RoundedRectangleBorder(
186+
// side: const BorderSide(color: Colors.blue, width: 4),
187+
// borderRadius: BorderRadius.circular(50),
188+
// ),
189+
// navigationBarColor: GFColors.SECONDARY,
190+
//
191+
// showDivider: true,
192+
// dividerHeight: 2,
193+
// dividerThickness: 13,
194+
// dividerColor: GFColors.ALT,
195+
//
196+
// dotHeight: 10,
197+
// dotWidth: 16,
198+
// dotShape: RoundedRectangleBorder(
199+
// side: BorderSide(color: Colors.red, width: 2),
200+
// borderRadius: BorderRadius.circular(5)
201+
// ),
202+
// inActiveColor: GFColors.DARK,
203+
// activeColor: GFColors.DANGER,
204+
// dotMargin: EdgeInsets.symmetric(horizontal: 6),
205+
//
206+
// showButton: false,
207+
// showPagination: true,
208+
),
134209
),
135210
);
136211
}
137212
List<Widget> slides() {
138-
final List<Widget> list = [
139-
// Container(
140-
// color: Colors.tealAccent,
141-
// ),
142-
// Container(
143-
// color: Colors.teal,
144-
// ),
145-
// Container(
146-
// color: Colors.grey,
147-
// ),
148-
// Container(
149-
// color: Colors.red,
150-
// ),
213+
slideList = [
214+
Container(
215+
color: Colors.tealAccent,
216+
),
217+
Container(
218+
color: Colors.teal,
219+
),
220+
Container(
221+
color: Colors.grey,
222+
),
223+
Container(
224+
color: Colors.red,
225+
),
151226
];
152-
list.add(GFIntroSlide(
227+
slideList.add(GFIntroSlide(
153228
// backgroundColor: Colors.yellow,
154229
// child: Container(
155230
// height: 100, color: Colors.blueGrey.withOpacity(.5),
@@ -160,35 +235,35 @@ class _IntroScreenState extends State<IntroScreen> {
160235
// imageWidth: 200,
161236
// image: AssetImage('assets/images/5.png'),
162237
));
163-
list.add(const GFIntroSlide(
238+
slideList.add(const GFIntroSlide(
164239
backgroundColor: Colors.blue,
165240
title: Text('Second'),
166241
// imageHeight: 200,
167242
// imageWidth: 200,
168243
// image: AssetImage('assets/images/2.png'),
169244
));
170-
list.add(const GFIntroSlide(
245+
slideList.add(const GFIntroSlide(
171246
backgroundColor: Colors.green,
172247
title: Text('Third'),
173248
// imageHeight: 200,
174249
// imageWidth: 200,
175250
// image: AssetImage('assets/images/3.png'),
176251
));
177-
list.add(const GFIntroSlide(
252+
slideList.add(const GFIntroSlide(
178253
backgroundColor: Colors.red,
179254
title: Text('Fourth'),
180255
// imageHeight: 200,
181256
// imageWidth: 200,
182257
// image: AssetImage('assets/images/4.png'),
183258
));
184-
list.add(const GFIntroSlide(
259+
slideList.add(const GFIntroSlide(
185260
backgroundColor: Colors.deepPurple,
186261
title: Text('Fifth'),
187262
// imageHeight: 200,
188263
// imageWidth: 200,
189264
// image: AssetImage('assets/images/5.png'),
190265
));
191-
return list;
266+
return slideList;
192267
}
193268
}
194269

lib/components/intro_screen/gf_intro_bottom_navigation.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,17 @@ class GFIntroBottomNavigation extends StatelessWidget {
7777
final VoidCallback onBackButtonTap;
7878
final VoidCallback onDoneTap;
7979
final VoidCallback onSkipTap;
80+
8081
final Widget backButton;
8182
final Widget forwardButton;
8283
final Widget doneButton;
8384
final Widget skipButton;
85+
8486
final String backButtonText;
8587
final String forwardButtonText;
8688
final String doneButtonText;
8789
final String skipButtonText;
90+
8891
final TextStyle skipButtonTextStyle;
8992
final TextStyle doneButtonTextStyle;
9093
final TextStyle backButtonTextStyle;

lib/components/intro_screen/gf_intro_screen.dart

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,25 @@ class _GFIntroScreenState extends State<GFIntroScreen> {
107107
// // duration: const Duration(milliseconds: 500),
108108
// // curve: Curves.linear);
109109
// },
110+
// onDoneTap: (){
111+
// print('done');
112+
// },
113+
// onSkipTap: (){
114+
// print('skip');
115+
// },
116+
// backButtonTextStyle: TextStyle(
117+
// fontSize: 12
118+
// ),
119+
120+
// backButton: GFButton(onPressed: null, child: Text('back'),),
121+
// forwardButton: GFButton(onPressed: null, child: Text('next'),),
122+
// skipButton: GFButton(onPressed: null, child: Text('skip'),),
123+
// doneButton: GFButton(onPressed: null, child: Text('done'),),
124+
125+
// backButtonText: 'bbbb',
126+
// forwardButtonText: 'ffffff',
127+
// skipButtonText: 'ssssss',
128+
// doneButtonText: 'ddddddd',
110129

111130
// navigationBarHeight: 100,
112131
// navigationBarWidth: 300,

0 commit comments

Comments
 (0)