import
'package:flutter/material.dart'
;
import
'package:intro_slider/intro_slider.dart'
;
import
'package:intro_slider/slide_object.dart'
;
import
'package:intro_slider/scrollbar_behavior_enum.dart'
;
void
main() {
runApp(MyApp());
}
class
MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return
MaterialApp(
debugShowCheckedModeBanner:
false
,
title:
'Flutter Demo'
,
theme: ThemeData(
primarySwatch: Colors.green,
),
home: IntroScreen(),
);
}
}
class
IntroScreen extends StatefulWidget {
@override
_IntroScreenState createState() => _IntroScreenState();
}
class
_IntroScreenState extends State<IntroScreen> {
List<Slide> slides = [];
@override
void
initState() {
super.initState();
slides.add(
new
Slide(
title:
"GeeksForGeeks "
,
maxLineTitle: 2,
styleTitle: TextStyle(
color: Colors.green,
fontSize: 30.0,
fontWeight: FontWeight.bold,
),
description:
"GeeksForGeeks present you the intro_slider
tutorial making your learning phase Easier.",
styleDescription: TextStyle(
color: Colors.green,
fontSize: 20.0,
),
marginDescription:
EdgeInsets.only(left: 20.0,
right: 20.0,
top: 20.0,
bottom: 70.0),
backgroundColor: Colors.yellow,
directionColorBegin: Alignment.topLeft,
directionColorEnd: Alignment.bottomRight,
onCenterItemPress: () {},
),
);
slides.add(
new
Slide(
title:
"Second Slide"
,
styleTitle: TextStyle(
color: Colors.white,
fontSize: 30.0,
fontWeight: FontWeight.bold,
),
description:
"Do video call anywhere anytime with this app."
,
styleDescription: TextStyle(
color: Colors.white,
fontSize: 20.0,
),
backgroundImage:
"assets/image1.png"
,
directionColorBegin: Alignment.topRight,
directionColorEnd: Alignment.bottomLeft,
),
);
slides.add(
new
Slide(
title:
"Third Slide"
,
styleTitle: TextStyle(
color: Colors.white,
fontSize: 30.0,
fontWeight: FontWeight.bold,
),
description:
"Now track the location with this app easily."
,
styleDescription: TextStyle(
color: Colors.white,
fontSize: 20.0,
),
backgroundImage:
"assets/image2.png"
,
directionColorBegin: Alignment.topCenter,
directionColorEnd: Alignment.bottomCenter,
maxLineTextDescription: 3,
),
);
}
@override
Widget build(BuildContext context) {
return
new
IntroSlider(
slides:
this
.slides,
renderSkipBtn: TextButton(
onPressed: () {},
child: Text(
"Skip"
,
style: TextStyle(fontSize: 20),
)),
renderNextBtn: Icon(
Icons.navigate_next,
color: Colors.green,
size: 40.0,
),
renderDoneBtn: TextButton(
onPressed: () {},
child: Text(
"Done"
,
style: TextStyle(fontSize: 20))),
colorDot: Colors.green,
colorActiveDot: Colors.green,
sizeDot: 13.0,
hideStatusBar:
true
,
backgroundColorAllSlides: Colors.black,
verticalScrollbarBehavior: scrollbarBehavior.SHOW_ALWAYS,
);
}
}