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

image sleding

parent 94a598d8
......@@ -19,7 +19,7 @@ class _OurSolution2State extends State<OurSolution2> {
height: screenSize.height*0.75,
padding: EdgeInsets.symmetric(horizontal: screenSize.width*0.1, vertical: screenSize.height*0.1),
child: Container(
width: screenSize.width*0.8,
width: screenSize.width*0.75,
height: screenSize.height*0.65,
child: VerticalSlider(),
......
......@@ -19,7 +19,7 @@ final List<Widget> imageSliders = imgList
Image.asset(
item,
fit: BoxFit.cover,
width: 700,
width: 840,
),
Positioned(
bottom: 0.0,
......@@ -36,17 +36,17 @@ final List<Widget> imageSliders = imgList
end: Alignment.topCenter,
),
),
padding: const EdgeInsets.symmetric(
vertical: 10.0, horizontal: 20.0),
child: const Text(
'Bootcamp',
//'No. ${imgList.indexOf(item)} image',
style: TextStyle(
color: Colors.white,
fontSize: 20.0,
fontWeight: FontWeight.bold,
),
),
// padding: const EdgeInsets.symmetric(
// vertical: 10.0, horizontal: 20.0),
// child: const Text(
// 'Bootcamp',
// //'No. ${imgList.indexOf(item)} image',
// style: TextStyle(
// color: Colors.white,
// fontSize: 20.0,
// fontWeight: FontWeight.bold,
// ),
// ),
),
),
],
......@@ -54,23 +54,54 @@ final List<Widget> imageSliders = imgList
),
))
.toList();
final CarouselController _controller = CarouselController();
@override
void initState() {
initState();
}
class VerticalSlider extends StatelessWidget {
@override
Widget build(BuildContext context) {
var screenSize = MediaQuery.of(context).size;
return Container(
width: screenSize.width * 0.27,
height: screenSize.height * 0.33,
child: CarouselSlider(
carouselController: CarouselController(),
options: CarouselOptions(
aspectRatio: 2.0,
enlargeCenterPage: true,
scrollDirection: Axis.horizontal,
autoPlay: true,
return Stack(
children: [
Container(
width: screenSize.width*0.8,
child: CarouselSlider(
carouselController: _controller,
options: CarouselOptions(
aspectRatio: 2.0,
enlargeCenterPage: 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