itsDARKSAMA / wonderful_images_carousel

a flutter package to generate a (Wonderful) images carousel easily

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

wonderful images carousel

a wonderful images carousel for flutter

screenshot

Features

  • 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

Getting started

1. Add dependency to your pubspec.yaml

dependencies:
  wonderful_images_carousel: ^0.0.1

2. Import package in dart file

import 'package:wonderful_images_carousel/wonderful_images_carousel.dart';

3. Use the widget

 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,
            ),
        );
        }

custom indicator size & colors

    @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,
            ),
        );
        }

properties

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

About

a flutter package to generate a (Wonderful) images carousel easily

License:Other


Languages

Language:Dart 100.0%