a wonderful images carousel for flutter
- Display images in a carousel
- cache images
- auto play
- custom indicator size & colors
- custom indicator position
- custom carousel size
- custom carousel radius
- custom carousel margin
- custom carousel background color
dependencies:
wonderful_images_carousel: ^0.0.1
import 'package:wonderful_images_carousel/wonderful_images_carousel.dart';
final List<String> images = [
"https://picsum.photos/id/45/1080/1920",
"https://picsum.photos/id/237/1080/1920",
"https://picsum.photos/id/74/1080/1920",
];
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: WonderfulImagesCarousel(
images: images,
),
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: WonderfulImagesCarousel(
images: images,
indicatorSize: 10,
indicatorActiveColor: Colors.red,
indicatorInactiveColor: Colors.blue,
),
);
}
property | description | default |
---|---|---|
images | list of images url | required |
height | height of the carousel | 200 |
width | width of the carousel | width of the screen |
borderRadius | border radius of the carousel | 10 |
backgroundColor | background color of the carousel | grey[300] |
indicatorColor | color of the indicator | primary color of the app |
unselectedIndicatorColor | color of the unselected indicator | grey[300] |
indicatorSize | size of the indicator | 15 |
unSelectedIndicatorSize | size of the unselected indicator | 10 |
indicatorSpacing | spacing between the indicators | 4 |
autoSlide | enable auto slide | true |
autoSlideDuration | duration of the auto slide | 6 seconds |
slideDuration | duration of the slide | 300 milliseconds |
slideCurve | curve of the slide | Curves.easeIn |
loadingIndicatorWidget | widget to show while loading the image from the network | CircularProgressIndicator() |
onErrorWidget | is the widget to show if there is an error while loading the image from the network | error icon with a red color |
edgeMargin | margin of the container | 16 |
indicatorPositioned | positioned of the indicator | bottom: 20 , right: 20 |