GithubHelp home page GithubHelp logo

nixrajput / flutter_carousel_widget Goto Github PK

View Code? Open in Web Editor NEW
27.0 2.0 13.0 26.39 MB

A customizable carousel slider widget in Flutter which supports infinite scrolling, auto scrolling, custom child widget, custom animations and built-in indicators.

Home Page: https://pub.dev/packages/flutter_carousel_widget

License: MIT License

Kotlin 0.10% Swift 0.33% Objective-C 0.03% Dart 75.42% HTML 3.31% CMake 6.61% C++ 13.62% C 0.59%
flutter-carousel carousel carousel-slider flutter-packages flutter-plugins nixlab nixrajput nixrajput-github nixlab-packages flutter-carousel-widget collaborate flutter-package flutter-widget dart flutter flutter-ui widget carousel-widget carousel-package

flutter_carousel_widget's Introduction

flutter_carousel_widget

A customizable carousel slider widget in Flutter which supports infinite scrolling, auto scrolling, custom child widget, custom animations and pre-built indicators.

pub package Stars Forks Watchers Contributors

GitHub release (latest by date) GitHub last commit GitHub issues GitHub pull requests GitHub Licence

Table of Contents

Features

  • Infinite Scroll
  • Custom Child Widget
  • Auto Play
  • Horizontal and Vertical Alignment
  • Pre-built Carousel Indicators
  • Custom Indicators
  • Expandable Carousel Widget.
  • Auto-sized child support.

Demo

Demo

View Demo

Installation

Add flutter_carousel_widget as a dependency in your pubspec.yaml file:

dependencies:
  flutter_carousel_widget: ^latest_version

And import it:

import 'package:flutter_carousel_widget/flutter_carousel_widget.dart';

Usage

Using FlutterCarousel Widget

Flutter Carousel is a carousel widget which supports infinite scrolling, auto scrolling, custom child widget, custom animations and pre-built indicators.

FlutterCarousel(
  options: CarouselOptions(
    height: 400.0, 
    showIndicator: true,
    slideIndicator: CircularSlideIndicator(),
  ),
  items: [1,2,3,4,5].map((i) {
    return Builder(
      builder: (BuildContext context) {
        return Container(
          width: MediaQuery.of(context).size.width,
          margin: EdgeInsets.symmetric(horizontal: 5.0),
          decoration: BoxDecoration(
            color: Colors.amber
          ),
          child: Text('text $i', style: TextStyle(fontSize: 16.0),)
        );
      },
    );
  }).toList(),
)

Using ExpandableCarousel Widget

Expandable Carousel is a carousel widget which automatically expands to the size of its child widget. It is useful when you want to show a carousel with different sized child widgets.

ExpandableCarousel(
  options: CarouselOptions(
    autoPlay: true,
    autoPlayInterval: const Duration(seconds: 2),
  ),
  items: [1,2,3,4,5].map((i) {
    return Builder(
      builder: (BuildContext context) {
        return Container(
          width: MediaQuery.of(context).size.width,
          margin: EdgeInsets.symmetric(horizontal: 5.0),
          decoration: BoxDecoration(
            color: Colors.amber
          ),
          child: Text('text $i', style: TextStyle(fontSize: 16.0),)
        );
      },
    );
  }).toList(),
)

Option Customization

FlutterCarousel(
  items: items,
  options: CarouselOptions(
    height: 400.0,
    aspectRatio: 16 / 9,
    viewportFraction: 1.0,
    initialPage: 0,
    enableInfiniteScroll: true,
    reverse: false,
    autoPlay: false,
    autoPlayInterval: const Duration(seconds: 2),
    autoPlayAnimationDuration: const Duration(milliseconds: 800),
    autoPlayCurve: Curves.fastOutSlowIn,
    enlargeCenterPage: false,
    controller: CarouselController(),
    onPageChanged: callbackFunction,
    pageSnapping: true,
    scrollDirection: Axis.horizontal,
    pauseAutoPlayOnTouch: true,
    pauseAutoPlayOnManualNavigate: true,
    pauseAutoPlayInFiniteScroll: false,
    enlargeStrategy: CenterPageEnlargeStrategy.scale,
    disableCenter: false,
    showIndicator: true,
    floatingIndicator = true,
    slideIndicator: CircularSlideIndicator(),
  )
)

Build item widgets on demand

This method will save memory by building items once it becomes necessary. This way they won't be built if they're not currently meant to be visible on screen. It can be used to build different child item widgets related to content or by item index.

FlutterCarousel.builder(
  itemCount: 15,
  itemBuilder: (BuildContext context, int itemIndex, int pageViewIndex) =>
  Container(
    child: Text(itemIndex.toString()),
  ),
)
ExpandableCarousel.builder(
  itemCount: 15,
  itemBuilder: (BuildContext context, int itemIndex, int pageViewIndex) =>
  Container(
    child: Text(itemIndex.toString()),
  ),
)

Carousel Controller

In order to manually control the pageview's position, you can create your own CarouselController, and pass it to CarouselSlider. Then you can use the CarouselController instance to manipulate the position.

class CarouselDemo extends StatelessWidget {
  CarouselController buttonCarouselController = CarouselController();

 @override
  Widget build(BuildContext context) => Column(
    children: [
      FlutterCarousel(
        items: child,
        options: CarouselOptions(
          autoPlay: false,
          controller: buttonCarouselController,
          enlargeCenterPage: true,
          viewportFraction: 0.9,
          aspectRatio: 2.0,
          initialPage: 2,
        ),
      ),
      RaisedButton(
        onPressed: () => buttonCarouselController.nextPage(
            duration: Duration(milliseconds: 300), curve: Curves.linear),
        child: Text('โ†’'),
      )
    ]
  );
}

CarouselController methods

.nextPage({Duration duration, Curve curve})

Animate to the next page

.previousPage({Duration duration, Curve curve})

Animate to the previous page

.jumpToPage(int page)

Jump to the given page.

.animateToPage(int page, {Duration duration, Curve curve})

Animate to the given page.

Custom Slide Indicators

The flutter_carousel_widget package comes with a few predefined slide indicators with their own unique behaviors. This helps drastically and brings focus towards the actual implementation of your carousel widget.

However, there might be cases where you want to control the look or behavior of the slide indicator or implement a totally new one. You can do that by implementing the SlideIndicator contract.

The following example implements an indicator which tells the percentage of the slide the user is on:

class SlidePercentageIndicator implements SlideIndicator {
  SlidePercentageIndicator({
    this.decimalPlaces = 0,
    this.style,
  });

  /// The number of decimal places to show in the output
  final int decimalPlaces;

  /// The text style to be used by the percentage text
  final TextStyle? style;

  @override
  Widget build(int currentPage, double pageDelta, int itemCount) {
    if (itemCount < 2) return const SizedBox.shrink();
    final step = 100 / (itemCount - 1);
    final percentage = step * (pageDelta + currentPage);
    return Center(
      child: Text(
        '${percentage.toStringAsFixed(decimalPlaces)}%',
        style: style ??
            const TextStyle(
              fontSize: 24,
              fontWeight: FontWeight.w600,
            ),
      ),
    );
  }
}

Contributors

Nikhil Rajput
Nikhil Rajput

๐Ÿ’ฌ ๐Ÿ“– ๐Ÿšง ๐Ÿš‡ ๐Ÿ‘€ ๐Ÿ“ข
David Djordjevic
David Djordjevic

๐Ÿ“– ๐Ÿ‘€
Matthew Jones
Matthew Jones

๐Ÿ“– ๐Ÿ‘€
DjordjeMancic97
DjordjeMancic97

๐Ÿ“– ๐Ÿ‘€

Contributing

If you would like to contribute to this project, feel free to fork the repository, make your changes, and submit a pull request. Please follow the guidelines in the CONTRIBUTING.md file.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Sponsor Me

  • By sponsoring my efforts, you're not merely contributing to the development of my projects; you're investing in its growth and sustainability.
  • Your support empowers me to dedicate more time and resources to improving the project's features, addressing issues, and ensuring its continued relevance in the rapidly evolving landscape of technology.
  • Your sponsorship directly fuels innovation, fosters a vibrant community, and helps maintain the project's high standards of quality. Together, we can shape the future of the projects and make a lasting impact in the open-source community.
  • Thank you for considering sponsoring my work!

Sponsor

Connect With Me

GitHub: nixrajput Linkedin: nixrajput Instagram: nixrajput Twitter: nixrajput07 Telegram: nixrajput Gmail: nkr.nikhi.nkr@gmail.com

Activities

Alt

flutter_carousel_widget's People

Contributors

ddavidprime avatar djordjemancic97 avatar matthewjones517 avatar nikhil-merito avatar nixrajput avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

flutter_carousel_widget's Issues

how remove 'setState' error log?

i find error log
log here

======== Exception caught by foundation library ====================================================
The following assertion was thrown while dispatching notifications for PageController:
setState() or markNeedsBuild() called during build.

This FlutterCarousel widget cannot be marked as needing to build because the framework is already in the process of building widgets. A widget can be marked as needing to be built during the build phase only if one of its ancestors is currently building. This exception is allowed because the framework builds parent widgets before children, which means a dirty descendant will always be built. Otherwise, the framework might not visit this widget during this build phase.
The widget on which setState() or markNeedsBuild() was called was: FlutterCarousel
  dependencies: [ScrollConfiguration]
  state: FlutterCarouselState#ffde5
The widget which was currently being built when the offending call was made was: NotificationListener<ScrollNotification>
When the exception was thrown, this was the stack: 
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 266:49      throw_
packages/flutter/src/widgets/framework.dart 4634:9                                <fn>
packages/flutter/src/widgets/framework.dart 4645:14                               markNeedsBuild
packages/flutter/src/widgets/framework.dart 1153:5                                setState
packages/flutter_carousel_widget/src/_flutter_carousel_widget.dart 86:7           <fn>
packages/flutter/src/foundation/change_notifier.dart 381:24                       notifyListeners
packages/flutter/src/foundation/change_notifier.dart 381:24                       notifyListeners
packages/flutter/src/widgets/scroll_position.dart 984:11                          notifyListeners
packages/flutter/src/widgets/scroll_position.dart 384:5                           forcePixels
packages/flutter/src/widgets/page_view.dart 367:7                                 set viewportFraction
packages/flutter/src/widgets/page_view.dart 259:17                                attach
packages/flutter/src/widgets/scrollable.dart 561:34                               didUpdateWidget

i don`t use setState

but this package useful setState

_pageController!.addListener(() {
      setState(() {
        _currentPage = _pageController!.page!.floor();
        _pageDelta = _pageController!.page! - _pageController!.page!.floor();
      });
    });
 _pageController!.addListener(() {
      setState(() {
        _currentPage = _pageController!.page!.floor();
        _pageDelta = _pageController!.page! - _pageController!.page!.floor();
      });
    });
  }

how delete error log ?

I don't want it.

[Feature Request]: Itens with shadowed borders

Contact Details

No response

Is your feature request related to a problem? Please describe.

Possibility to add shadows in borders of the itens

Describe the solution you'd like

Shadow in borders

Describe alternatives you've considered

Shadow in borders of the itens

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Page value is only available after content dimensions are established.)

After enabling enlargerPage to true then the error message appeared
Exception has occurred.
_AssertionError ('package:flutter/src/widgets/page_view.dart': Failed assertion: line 402 pos 7: '!hasPixels || hasContentDimensions': Page value is only available after content dimensions are established.)

This was happened to flutter_carousel_slider, I don't have an idea how to fix this, I've tried to resolve it did not succeed

[Bug]: Indicator remains half-filled when padEnds: false

Contact Details

No response

What happened?

Hi guys , the indicator gets stuck in the middle when I set padEnd to false. And it needs to false to make the carousel occupy the entire screen.
ExpandableCarousel(
options: CarouselOptions(
showIndicator: true,
padEnds: false,
viewportFraction: athletes.length > 1 ? 0.8 : 0.9,
floatingIndicator: false,
slideIndicator: CircularSlideIndicator(
//padding: const EdgeInsets.only(top: 100),
currentIndicatorColor: ColorManager.primary),
),
picture

Version

2.0.1

What devices are you seeing the problem on?

Android

OS

Android 12

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[QUESTION] How do we use this with Android TV remote?

I am trying to enable my app to run on Android TV. I followed this guide. I made the changes to the AndroidManifest.xml and wrapped MaterialApp with Shortcuts widget to enable navigation. That's all, didn't do the YouTube player bits.

In my app I have some SwitchListTile widgets and a single flutter_carousel_slider widget. SwitchListTile widgets work with the TV D-pad controller out of the box. I can navigate to them using arrow buttons and if I press the action button I can toggle on/off value.

But I cannot get Carousel to get focus. I tried wrapping it in Focus widget, but didn't help.

Is this something that needs to be added to the widget or am I doing something wrong?

Ideally, the widget should receive focus and pressing action button should change to the next item so that arrows can be used for navigation and action button for changes, same as the 'SwitchListTile` widget does.

Unhandled Exception: Null check operator used on a null value

I get an error because state is null in the most recent version.

Any ideas what I'm missing?

I'll post more code if needed.

flutter_carousel_controller.dart

  Future<void> nextPage(
      {Duration? duration = const Duration(milliseconds: 300),
      Curve? curve = Curves.linear}) async {
    final isNeedResetTimer = _state!.options.pauseAutoPlayOnManualNavigate;
    if (isNeedResetTimer) {
      _state!.onResetTimer();
    }
    _setModeController();
    await _state!.pageController!.nextPage(duration: duration!, curve: curve!);
    if (isNeedResetTimer) {
      _state!.onResumeTimer();
    }
  }

[Bug]: it crashes

Contact Details

[email protected]

What happened?

when someone open the page and go back quikly it crashes I'm just suggesting to add mounted condition
`
WidgetsBinding.instance.addPostFrameCallback((_) {

  • if (mounted) {
    setState(() {
    _currentPage = realIndex;
    _pageDelta = _pageController!.page! - _pageController!.page!.floor();
    });
  • }
    });
    `

Version

2.1.0

What devices are you seeing the problem on?

Android

OS

Android 13

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Bug]: Infinite-scrolling carousels get out of sync with their indicators.

Contact Details

[email protected]

What happened?

image
It appears that when a carousel is initially built with infiniteScrolling set to true, the sliders appear out of order.

As you can see in the screenshot attached, the page is 'Slide 1' but it appears on the 5th indicator icon. This is taken from the example app, which creates Slide 1 as the first element, which should mean that it appears first in the carousel.

Initially, the order is correct when the route is opened, but if you navigate forwards in the carousel a few pages the indicator jumps back and remains out of sync until rebuilt from scratch.

I think this could be an incorrect calculation of the current carousel's index during calls to getRealIndex(), as casting doubles to ints truncates them. This is done in a few places in the controller implementation and I think this could be the cause but I can't quite narrow it down.

The index returned by onPageChanged(index, reason) actually returns a different index to the getRealIndex calls within the controller, interestingly.

Not urgent for me, but something I noticed when looking through the example app.

Version

2.0.4

What devices are you seeing the problem on?

Android

OS

Android emulator

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

State null error with controller

When trying to programmatically scroll on tap event, I am getting below error. Sometimes on first tap, other times it works once, then it fails on second tap.

_CastError (Null check operator used on a null value)

Error is on line 78, _state is null:
final isNeedResetTimer = _state!.options.pauseAutoPlayOnManualNavigate;

This is my code snippet:

 Widget build(BuildContext context) {
    CarouselController gestureCarouselController = CarouselController();

    return GestureDetector(
        onTap: () {
          gestureCarouselController.nextPage(
              duration: const Duration(milliseconds: 300),
              curve: Curves.linear);
        },
        child: FlutterCarousel(
          options: CarouselOptions(
              controller: gestureCarouselController,
              showIndicator: false,
etc...

Stateful widget not being restored with ValueKey

Hello
I've created a carousel by supplying an array of stateful widgets and when the provider signals, this will be reconstructed as part of the normal build process. On the rebuild and the array changing dimension I loose the state of my widgets, which do have ValueKeys on each. Switching the key to a GlobalKey means I retain the state, but there are obvious reasons for not wanting to use GlobalKeys.
I didn't find anything in the documentation about this, so I assumed that it should work the same way as other lists where the position of a widget can be changed using local keys.
regards
Matthew

bug show indicator

trying to hide the indicator using showIndicator: false but the indicator still showing up

[Question] Remove Center from each child

The plugin is forcing a center widget in each of its elements, constraining the application of this plugin.

E.g If i want the carousel to have the image at left of the screen it would be almost impossible because of this Center widget without using some obscure hacky stuff ;)

There is some way to don't force this behavior in the carousel?

I want to have this effect

immagine

Edit:
I tried to use the disableCenter: true option but it doesn't work.

Error: Method 'readState' cannot be called on 'PageStorageBucket?' because it is potentially null

I'm using Flutter 3.3.8v

Full error is:

../../development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_carousel_widget-2.0.2/lib/src/_flutter_carousel_widget.dart:368:22: Error: Method 'readState' cannot be called on 'PageStorageBucket?' because it is potentially null.
 - 'PageStorageBucket' is from 'package:flutter/src/widgets/page_storage.dart' ('../../development/flutter/packages/flutter/lib/src/widgets/page_storage.dart').
Try calling using ?. instead.
                    .readState(storageContext) as double?;
                     ^^^^^^^^^

Looks like the solution is easy, but not sure if compatible with older versions of flutter.

[Bug]: [3.7.12] page changed reason is always controller.

Contact Details

[email protected]

What happened?

Not sure if this is intentional, but the current impl of the CarouselController class always sets the changed reason to 'controller', regardless of whether a controller is assigned or not, or even if the transition is triggered by autoplay or the user.

I've linked a demo below that I've created that displays and prints the different states. The actions on the top row can be used to quickly toggle autoplay, and whether a controller is assigned to the carousel.

https://pastebin.com/jQr3Sd6P

Version

^2.0.4

What devices are you seeing the problem on?

Android

OS

Android API 33 (emulator~)

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Add option for dynamic height based on the child's height

Is it possible to add an option for dynamic height? in my use case, the children widget's height isn't fixed, there's possibility that one children's height isn't the same with the other children's height.

image
within that card, there's a dynamically loaded widget, sometimes loaded, sometimes not.
because the current implementation forced children's height to be the same as the height set on the option, it makes a blank space within the card. would be great if the carousel doesn't force the height at least. and even better if there's option for dynamic height.

carouselController is missing from CarouselOptions function definition

I need to specify a carouselController, and should be able to do so as per the documentation.

Looking at the CarouselOptions function definition, it looks like the carouselController property is missing. I'm not sure if there's a particular reason for this, but I would really like it back. :)

BTW, thanks for creating this package. The ExpandableCarousel widget solves a massive problem I was having.

Portrait images do not fill the available space on iPad

Contact Details

[email protected]

What happened?

I'm not sure this is a bug, perhaps is me missing something about the way this widget works, but I thought I'd ask after several unsuccessful attempts at fixing it, I hope it's ok.

I'm using the carousel to display a gallery of images I fetch from the web via a backend service. I set the viewportFraction to 1.0, so the "slides" are expected to fill the available horizontal space, and that's what happens on iPhone, check the following screenshot (some parts are edited for privacy and NDA):

iphone14pro

On the left you see a landscape gallery picture, on the right a portrait one. As you can see they both fit the whole screen horizontally, the latter simply expands the carousel area downwards to accomodate the different aspect ratio, which is perfect for me.

But here's what happens when I run the app on an iPad Pro (6gen):

iPadpro6th

As you can see, the landscape picture fits perfectly, while the portrait one gets those weird paddings (you can also see the spinner loading animation I put in an underneath container of the same stack because the gallery image doesn't cover it anymore).

Here is the code I use:

ExpandableCarousel(
options: CarouselOptions(
autoPlay: false,
viewportFraction: 1.0, //full width
),
items: imgGallery.map((i) {
return Builder(
builder: (BuildContext context) {
var noimg = AssetImage(//default placeholder
'assets/images/noimg.png');
var img;
if (i != '') {
img = NetworkImage(i);
}
return Image(
image: i != '' ? img : noimg,
);
},
);
}).toList(),
),

Any suggestions? Thanks in advance

Version

2.1.0

What devices are you seeing the problem on?

iPhone

OS

iOS 16.4

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Indicator not working properly for last item when using padEnds : false with viewportFraction less than 1

The animation of the Indicator doesn't complete for some reasons for last item, when the attribute of CarouselOptions are set to padEnd: false and viewportFraction: 0.8 (any less than 1). As a result, the Circle of the last indicator doesn't gets completely fill with color. This problem is also in your sample code available on 'pub.dev' when you jus set padEnds to false. Please solve it as fast as possible because the UI itself is not correct.

[Feature Request]: Expose SlideIndicator contract

Contact Details

[email protected]

Is your feature request related to a problem? Please describe.

There is a limited number of slide indicators we can use (CircularSlideIndicator,CircularStaticIndicator and CircularWaveSlideIndicator) which all implement the SlideIndicator contract. If we decide to go with a custom implementation, with the current version of the package (at the moment of writing it is flutter_carousel_widget: ^2.1.2) that is not possible. In order to allow users of this package for custom implementations of indicators, we may expose the contract.

Describe the solution you'd like

As an easy solution proposal to this issue, we may expose the SlideIndicator contract by including lib/src/indicators/slide_indicator.dart in the lib/flutter_carousel_widget.dart file. This would provide access to users of this package to the mentioned contract allowing them to extend it with their custom implementations, still keeping access to information provided by the framework (int currentPage, double pageDelta, int itemCount).

Describe alternatives you've considered

In order to have a custom slide indicator with the current version of the package, we could disable the slide indicator by setting showIndicator: false in the CarouselOptions and stack a custom implementation of a slide indicator (or another package) on top of our carousel. This however brings overhead in coordinating the change of the pages through the onPageChanged callback and syncing with the custom slide indicator which may not provide expected results.

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

A method to know center item

Contact Details

No response

Is your feature request related to a problem? Please describe.

Yes

Describe the solution you'd like

Hello, i want to get the center item index in carousel as i has youtube player with autoplay enabled so i want to play videos only if widget is in center else pause

Describe alternatives you've considered

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Bug]: pinch and zoom

Contact Details

No response

What happened?

I've tried blocking the scrolling feature while I do a pinch and zoom on the widget. I didn't find a way to achieve this.
When you try to pinch and zoom, the widget scroll controller takes control and it is a hit or miss.
I also tried setting the physics to NeverScroll and a boolean, but no luck. It seems this widget cannot allow for pinch and zoom on its images.

To give you an idea of what I'm trying to achieve, something similar to what Instagram photos achieve. You may have a post with multiple images (a flutter_carousel_widget) and at the same time you have a scroll up and down the feed and a pinch and zoom on the images.

This widget does not allow for that, the moment you try to pinch and zoom it will either ignore it or move the page to the beginning.

I'm using the flutter package: https://pub.dev/packages/pinch_to_zoom_scrollable

If you have multiple images it will always go back to page 1 while zooming or when releasing and it loses track of the page index, even if you have it as a global variable.

Version

latest

What devices are you seeing the problem on?

Android

OS

Android any

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Suggest an idea for this project

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

License

Contact Details

No response

What happened?

Hello, why do you use the GNU/GPL license for your package? The conditions of this license require me to disclose the source code under the same license, but I'm unable to do so, which means I cannot use this package.

Why don't you consider using the MIT license, which is better suited for libraries? All Flutter packages are distributed under the MIT license. The GNU/GPL license is more suitable for applications and programs that you want to keep open, but not for packages that can be used by any application.

The MIT license allows for copying your package's code under the same license, without the requirement to disclose the entire application that wants to use this package.

Version

2.0.4

What devices are you seeing the problem on?

Android, iPhone, Windows, Mac, Linux

OS

any

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Feature Request]: Add Test Cases

Contact Details

[email protected]

Is your feature request related to a problem? Please describe.

No, this feature request is not related to any problem. I am looking to add test cases to this project, but due to lack of time, I am unable to complete it individually.

Describe the solution you'd like

I am the owner of this project and I am inviting every open-source contributor to contribute to my project so that I can focus on my other projects.

Describe alternatives you've considered

If anyone is interested in adding test cases, I want to thank him/her in advance.
Also, I would mention the name of every contributor to this project.

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Bug]: initialPage parameter should affect the slide indicators

Contact Details

[email protected]

What happened?

Given the initialPage parameter in CarouselOptions, the slide indicators always start with index 0.

I extended one of the slide indicators and wrote this and it works as expected:

class ModifiedCircularSlideIndicator extends CircularSlideIndicator {
  const ModifiedCircularSlideIndicator({
    super.itemSpacing,
    super.indicatorRadius,
    super.indicatorBorderWidth,
    super.indicatorBorderColor,
    super.padding,
    super.alignment,
    super.currentIndicatorColor,
    super.indicatorBackgroundColor,
    required this.startIndex,
  });

  final int startIndex;

  @override
  Widget build(int currentPage, double pageDelta, int itemCount) {
    final newCurrentPage = (startIndex + currentPage) % itemCount
    return super.build(newCurrentPage, pageDelta, itemCount);
  }
}

Version

2.2.0

What devices are you seeing the problem on?

Android, iPhone

OS

iOS 16

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Overlapping parent

Hi

The carousel widget is great and works really well with good options. but the basic constraining to the parent eg a Card, doesn't seem to work?

image

eg as shown here the carousel is overlapping the edges of the card shown in red lines.

any ideas?

thanks

[Feature Request]: Make image transitions smooth

Contact Details

[email protected]

Is your feature request related to a problem? Please describe.

Can you make the image transitions smoother as in the description?

https://miro.medium.com/v2/resize:fit:1400/1*RIs56GsyQOPcTuuFWV7m3A.gif

Describe the solution you'd like

https://medium.flutterdevs.com/velocityx-animated-page-view-in-flutter-5862a539e397

Describe alternatives you've considered

.

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Feature Request]: Maximum height value

Contact Details

[email protected]

Is your feature request related to a problem? Please describe.

I am using Expandable Carousel. I want to set the maximum height. Thanks

Describe the solution you'd like

Maxheight:

Describe alternatives you've considered

I think easy solution

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Bug]: The original package is not listed in the license.

Contact Details

No response

What happened?

Hello,
If this package is based on flutter_carousel_slider, I think you are obligated to give a copyright notice to that effect.
For example, diox had the following copyright notice mentioning the original.

The project is originally authored by @wendux with the organization @flutterchina, hard-forked at 2022 and maintained by @cfug.

Mentioning that flutter_carousel_slider is original
โ†’ #4 (comment)

What are your thoughts on this?
Thanks for publishing a great package.

Version

2.1.2

What devices are you seeing the problem on?

Android, iPhone

OS

iOS, Android

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Feature Request]: enlargeCenterPage support for ExpandableCarousel

Contact Details

No response

Is your feature request related to a problem? Please describe.

I've been trying to use ExpandableCarousel (builder constructor as well) to leverage CarouselOptions.enlargeCenterPage, but it seems like the component's implementation ignores this option's property.

Could you please think of a possibility of fixing it?

Describe the solution you'd like

Otherwise, could you please create a different CarouselOptions object, that wouldn't support this option? Currently, it is misleading.

Describe alternatives you've considered

Using matrix transformer for each component in combine with current page index selection.

Additional context

ExpandablePageView library could be used to reach expected behaviour.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.