flutter_carousel_media_slider 0.0.4 copy "flutter_carousel_media_slider: ^0.0.4" to clipboard
flutter_carousel_media_slider: ^0.0.4 copied to clipboard

Carousel slider supports for both video (.mp4), image (.png / .jpg) and Youtube Videos which is highly useful at commercial places to promote their business

Flutter Carousel Media Slider #

A Flutter package for creating a carousel media slider widget. It supports both images and videos.

Configuration #

Android #

Add the following to your build.gradle file located in android/app/build.gradle.

compileSdkVersion 33
minSdkVersion 21
targetSdkVersion 33

iOS #

No configuration required.

Required fields: #

  • MediaName
  • MediaUrl
  • MediaType
  • carouselImageSource

Step 1: Create a list of CarouselMedia #


List<CarouselMedia> media = [
  CarouselMedia(
    mediaName: 'Image 1',
    mediaUrl:
    'https://images.pexels.com/photos/1172253/pexels-photo-1172253.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500',
    mediaType: CarouselMediaType.image,
    carouselImageSource: CarouselImageSource.network,
  ),
  CarouselMedia(
    mediaName: 'Video 1',
    mediaUrl: 'https://www.youtube.com/watch?v=4AoFA19gbLo',
    mediaType: CarouselMediaType.video,
    carouselImageSource: CarouselImageSource.network,
  ),
  CarouselMedia(
    mediaName: 'Image 2',
    mediaUrl:
    'https://media.istockphoto.com/photos/mountain-landscape-picture-id517188688?k=20&m=517188688&s=612x612&w=0&h=i38qBm2P-6V4vZVEaMy_TaTEaoCMkYhvLCysE7yJQ5Q=',
    mediaType: CarouselMediaType.image,
    carouselImageSource: CarouselImageSource.network,
  ),
  CarouselMedia(
    mediaName: 'Image 5',
    mediaUrl:
    'https://sample-videos.com/video123/mp4/720/big_buck_bunny_720p_1mb.mp4',
    mediaType: CarouselMediaType.video,
    carouselImageSource: CarouselImageSource.network,
  )
];
FlutterCarouselMediaSlider(
    carouselMediaList: media,
    placeholder: const Center(
    child: Text('Loading...'),
    ),
    onPageChanged: (index) {
    debugPrint('Page Changed: $index');
    },
),

Raise an issue if you find any bugs or if you have any suggestions email us at agkc-flutter-pub.

11
likes
120
pub points
83%
popularity

Publisher

verified publisheravinashgotluru.me

Carousel slider supports for both video (.mp4), image (.png / .jpg) and Youtube Videos which is highly useful at commercial places to promote their business

Homepage

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, video_player, video_player_tizen, youtube_player_iframe

More

Packages that depend on flutter_carousel_media_slider