serenader2014 / flutter_carousel_slider

A flutter carousel widget, support infinite scroll, and custom child widget.
https://pub.dev/packages/carousel_slider
MIT License
1.61k stars 583 forks source link

Changes for flutter upgrade to version 3.24 #460

Closed a-hasnain-khan closed 3 months ago

a-hasnain-khan commented 3 months ago

Description While upgrading flutter to 3.24, it was showing an error. The error was: CarouselController() is getting imported from 2 packages.

The reason is in this latest version, flutter has added a CarouselView() widget in material package which also has a controller named CarouselController. You can see the changes here: reference. Or you can know more about this here.

Hence while building, it was showing the error.

This Fixes the Issue #457

Fix: I have used prefix for telling flutter that this CarouselController() and CarouselControllerImpl are imported from 'carousel_controller.dart' package in the file carousel_slider.dart Also I have removed null check operator on line no. 358 in the same file. The reason is flutter have added PageStorage.maybeOf packages/flutter/test/widgets/page_storage_test.dart and now PageStorage.of(storageContext) gives non null values only, and hence that check was not needed. commit ref

Testing Manual Testing: I have done manual testing in my project where we use this package and it was completely working fine.

cerberodev commented 3 months ago

Hi @serenader2014,I think this PR should be approved as soon as possible for those of us who update Flutter to 3.24 or do you have other solutions in mind for this package?

bytefz commented 3 months ago

Hi! @serenader2014 !! I totally agree with this implementation. Many apps have been updated to Flutter 3.24.

serenader2014 commented 3 months ago

I'll close this PR, since the issue is fixed in v5.0.0