lecle_flutter_carousel_pro 0.0.1+1 lecle_flutter_carousel_pro: ^0.0.1+1 copied to clipboard
A Flutter Carousel Slider widget. Support Network and Asset Images. You can modify the UI according your design easily.
import 'package:flutter/material.dart';
import 'package:lecle_flutter_carousel_pro/lecle_flutter_carousel_pro.dart';
void main() {
runApp(
const MaterialApp(
debugShowCheckedModeBanner: true,
title: 'Carousel Pro',
home: CarouselPage(),
),
);
}
class CarouselPage extends StatelessWidget {
const CarouselPage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: SizedBox(
height: MediaQuery.of(context).size.height * 0.2,
width: MediaQuery.of(context).size.width * 0.7,
child: const Carousel(
boxFit: BoxFit.cover,
autoplay: false,
animationCurve: Curves.fastOutSlowIn,
animationDuration: Duration(milliseconds: 1000),
dotSize: 6.0,
dotIncreasedColor: Color(0xFFFF335C),
dotBgColor: Colors.transparent,
dotPosition: DotPosition.topRight,
dotVerticalPadding: 10.0,
dotColor: Colors.grey,
showIndicator: true,
indicatorBgPadding: 7.0,
images: [
NetworkImage(
'https://jackfruit.com.vn/content/images/2022/01/6078b650748b8558d46ffb7f_Flutter-app-development.png'),
NetworkImage(
'https://docs.flutter.dev/assets/images/flutter-logo-sharing.png'),
ExactAssetImage('assets/images/LaunchImage.jpg'),
],
),
),
),
);
}
}