flutter_carousel_media_slider

Last updated:

0 purchases

flutter_carousel_media_slider Image
flutter_carousel_media_slider Images
Add to Cart

Description:

flutter carousel media slider

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
copied to clipboard
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,
)
];
copied to clipboard
Step 2: add the media list to the carousel Media slider widget #
FlutterCarouselMediaSlider(
carouselMediaList: media,
placeholder: const Center(
child: Text('Loading...'),
),
onPageChanged: (index) {
debugPrint('Page Changed: $index');
},
),
copied to clipboard
Raise an issue if you find any bugs or if you have any suggestions email us at agkc-flutter-pub.

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.