Skip to content

Commit 83316fd

Browse files
author
srinivas
committed
code refactored
1 parent 633f85c commit 83316fd

File tree

2 files changed

+18
-13
lines changed

2 files changed

+18
-13
lines changed

lib/components/intro_screen/gf_intro_screen.dart

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class _GFIntroScreenState extends State<GFIntroScreen> {
3838
setState(() {
3939
page = _pageController.page.round() + 1;
4040
_pageController.nextPage(
41-
duration: const Duration(milliseconds: 200),
41+
duration: const Duration(milliseconds: 500),
4242
curve: Curves.linear);
4343
});
4444
}
@@ -53,39 +53,39 @@ class _GFIntroScreenState extends State<GFIntroScreen> {
5353
List<Widget> slides() {
5454
final List<Widget> list = [];
5555
list.add(const GFIntroSlide(
56+
backgroundColor: Colors.white,
5657
title: 'First',
5758
imageHeight: 200,
5859
imageWidth: 200,
59-
image: NetworkImage(
60-
'https://rukminim1.flixcart.com/image/832/832/kcc9q4w0/television/g/g/g/samsung-ua32t4010arxxl-ua32t4010arxxl-original-imafthw74azys6rp.jpeg?q=70'),
60+
image: NetworkImage('https://www.gstatic.com/webp/gallery/3.jpg'),
6161
));
6262
list.add(const GFIntroSlide(
63+
backgroundColor: Colors.yellow,
6364
title: 'Second',
6465
imageHeight: 200,
6566
imageWidth: 200,
66-
image: NetworkImage(
67-
'https://rukminim1.flixcart.com/image/832/832/kcc9q4w0/television/g/g/g/samsung-ua32t4010arxxl-ua32t4010arxxl-original-imafthw74azys6rp.jpeg?q=70'),
67+
image: NetworkImage('https://www.gstatic.com/webp/gallery/1.jpg'),
6868
));
6969
list.add(const GFIntroSlide(
70+
backgroundColor: Colors.brown,
7071
title: 'Third',
7172
imageHeight: 200,
7273
imageWidth: 200,
73-
image: NetworkImage(
74-
'https://rukminim1.flixcart.com/image/832/832/kcc9q4w0/television/g/g/g/samsung-ua32t4010arxxl-ua32t4010arxxl-original-imafthw74azys6rp.jpeg?q=70'),
74+
image: NetworkImage('https://www.gstatic.com/webp/gallery/2.jpg'),
7575
));
7676
list.add(const GFIntroSlide(
77+
backgroundColor: Colors.purple,
7778
title: 'Fourth',
7879
imageHeight: 200,
7980
imageWidth: 200,
80-
image: NetworkImage(
81-
'https://rukminim1.flixcart.com/image/832/832/kcc9q4w0/television/g/g/g/samsung-ua32t4010arxxl-ua32t4010arxxl-original-imafthw74azys6rp.jpeg?q=70'),
81+
image: NetworkImage('https://www.gstatic.com/webp/gallery/3.jpg'),
8282
));
8383
list.add(const GFIntroSlide(
84+
backgroundColor: Colors.orange,
8485
title: 'Fifth',
8586
imageHeight: 200,
8687
imageWidth: 200,
87-
image: NetworkImage(
88-
'https://rukminim1.flixcart.com/image/832/832/kcc9q4w0/television/g/g/g/samsung-ua32t4010arxxl-ua32t4010arxxl-original-imafthw74azys6rp.jpeg?q=70'),
88+
image: NetworkImage('https://www.gstatic.com/webp/gallery/4.jpg'),
8989
));
9090
return list;
9191
}

lib/components/intro_screen/gf_intro_slide.dart

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ class GFIntroSlide extends StatelessWidget {
1212
this.subTitle,
1313
this.titleStyle = const TextStyle(fontSize: 20, color: GFColors.DARK),
1414
this.subTitleStyle = const TextStyle(fontSize: 16, color: GFColors.DARK),
15-
this.backgroundColor = GFColors.PRIMARY})
15+
this.backgroundColor = GFColors.PRIMARY,
16+
this.imageShape = BoxShape.circle})
1617
: super(key: key);
1718
final double imageHeight;
1819
final double imageWidth;
@@ -22,6 +23,7 @@ class GFIntroSlide extends StatelessWidget {
2223
final String subTitle;
2324
final TextStyle subTitleStyle;
2425
final Color backgroundColor;
26+
final BoxShape imageShape;
2527

2628
@override
2729
Widget build(BuildContext context) => Container(
@@ -31,7 +33,10 @@ class GFIntroSlide extends StatelessWidget {
3133
crossAxisAlignment: CrossAxisAlignment.center,
3234
children: <Widget>[
3335
GFImageOverlay(
34-
height: imageHeight, width: imageWidth, image: image),
36+
shape: imageShape,
37+
height: imageHeight,
38+
width: imageWidth,
39+
image: image),
3540
const SizedBox(
3641
height: 20,
3742
),

0 commit comments

Comments
 (0)