Commit 0291eadd authored by Budi Prasetyo's avatar Budi Prasetyo

image sleding

parent 94a598d8
...@@ -19,7 +19,7 @@ class _OurSolution2State extends State<OurSolution2> { ...@@ -19,7 +19,7 @@ class _OurSolution2State extends State<OurSolution2> {
height: screenSize.height*0.75, height: screenSize.height*0.75,
padding: EdgeInsets.symmetric(horizontal: screenSize.width*0.1, vertical: screenSize.height*0.1), padding: EdgeInsets.symmetric(horizontal: screenSize.width*0.1, vertical: screenSize.height*0.1),
child: Container( child: Container(
width: screenSize.width*0.8, width: screenSize.width*0.75,
height: screenSize.height*0.65, height: screenSize.height*0.65,
child: VerticalSlider(), child: VerticalSlider(),
......
...@@ -19,7 +19,7 @@ final List<Widget> imageSliders = imgList ...@@ -19,7 +19,7 @@ final List<Widget> imageSliders = imgList
Image.asset( Image.asset(
item, item,
fit: BoxFit.cover, fit: BoxFit.cover,
width: 700, width: 840,
), ),
Positioned( Positioned(
bottom: 0.0, bottom: 0.0,
...@@ -36,17 +36,17 @@ final List<Widget> imageSliders = imgList ...@@ -36,17 +36,17 @@ final List<Widget> imageSliders = imgList
end: Alignment.topCenter, end: Alignment.topCenter,
), ),
), ),
padding: const EdgeInsets.symmetric( // padding: const EdgeInsets.symmetric(
vertical: 10.0, horizontal: 20.0), // vertical: 10.0, horizontal: 20.0),
child: const Text( // child: const Text(
'Bootcamp', // 'Bootcamp',
//'No. ${imgList.indexOf(item)} image', // //'No. ${imgList.indexOf(item)} image',
style: TextStyle( // style: TextStyle(
color: Colors.white, // color: Colors.white,
fontSize: 20.0, // fontSize: 20.0,
fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
), // ),
), // ),
), ),
), ),
], ],
...@@ -54,23 +54,54 @@ final List<Widget> imageSliders = imgList ...@@ -54,23 +54,54 @@ final List<Widget> imageSliders = imgList
), ),
)) ))
.toList(); .toList();
final CarouselController _controller = CarouselController();
@override
void initState() {
initState();
}
class VerticalSlider extends StatelessWidget { class VerticalSlider extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var screenSize = MediaQuery.of(context).size; var screenSize = MediaQuery.of(context).size;
return Container( return Stack(
width: screenSize.width * 0.27, children: [
height: screenSize.height * 0.33, Container(
child: CarouselSlider( width: screenSize.width*0.8,
carouselController: CarouselController(), child: CarouselSlider(
options: CarouselOptions( carouselController: _controller,
aspectRatio: 2.0, options: CarouselOptions(
enlargeCenterPage: true, aspectRatio: 2.0,
scrollDirection: Axis.horizontal, enlargeCenterPage: true,
autoPlay: true, scrollDirection: Axis.horizontal,
autoPlay: true,
),
items: imageSliders,
),
),
Center(
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Flexible(
child: ElevatedButton(
onPressed: () => _controller.previousPage(),
child: Icon(Icons.arrow_back_rounded),
style: ElevatedButton.styleFrom(primary: Colors.grey),
),
),
Flexible(
child: ElevatedButton(
onPressed: () => _controller.nextPage(),
child: Icon(Icons.arrow_forward),
style: ElevatedButton.styleFrom(primary: Colors.grey),
),
),
],
), ),
items: imageSliders, )
)); ],
);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment