연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
A fantasy carousel slider widget; only for displaying online and local images. You can use it with two different types accessible with two named constructors:
Type 1 Demo:
Type 2 Demo:
Installation
In the pubspec.yaml of your flutter project, add the following dependency:
dependencies:
flutter:
sdk:
fan_carousel_image_slider: any
Import the fantasy carousel package like this:
import 'package:fan_carousel_image_slider/fan_carousel_image_slider.dart';
Usage
Simply create a FanCarouselImageSlider widget, and pass the required params:
static const List<String> sampleImages = [
'https://img.freepik.com/free-photo/lovely-woman-vintage-outfit-expressing-interest-outdoor-shot-glamorous-happy-girl-sunglasses_197531-11312.jpg',
'https://img.freepik.com/free-photo/shapely-woman-vintage-dress-touching-her-glasses-outdoor-shot-interested-relaxed-girl-brown-outfit_197531-11308.jpg',
'https://img.freepik.com/premium-photo/cheerful-lady-brown-outfit-looking-around-outdoor-portrait-fashionable-caucasian-model-with-short-wavy-hairstyle_197531-25791.jpg',
];
FanCarouselImageSlider.sliderType1(
imagesLink: sampleImages,
isAssets: false,
autoPlay: false,
sliderHeight: 400,
showIndicator: true,
),
FanCarouselImageSlider.sliderType2(
imagesLink: sampleImages,
isAssets: false,
autoPlay: false,
sliderHeight: 300,
currentItemShadow: const [],
sliderDuration: const Duration(milliseconds: 200),
imageRadius: 0,
slideViewportFraction: 1.2,
),
Customization
Customize the FanCarouselImageSlider widget with these parameters:
final List<String> imagesLink;
final bool isAssets;
final int initalPageIndex;
final double sliderHeight;
final double sliderWidth;
final double imageRadius;
final double turns;
final double sidesOpacity;
final BoxFit imageFitMode;
final double slideViewportFraction;
final Duration sliderDuration;
final bool showIndicator;
final bool showArrowNav;
final Color indicatorActiveColor;
final Color indicatorDeactiveColor;
final bool autoPlay;
final Duration autoPlayInterval;
final bool userCanDrag;
final List<BoxShadow>? currentItemShadow;
final List<BoxShadow>? sideItemsShadow;
final bool isClickable;
final double? expandImageWidth;
final double? expandImageHeight;
final BoxFit expandedImageFitMode;
final AlignmentGeometry expandedCloseBtnAlign;
final Widget? expandedCloseBtn;
final Widget expandedCloseChild;
final BoxDecoration? expandedCloseBtnDecoration;
final bool expandFitAndZoomable;
final bool displayIndicatorOnSlider;