nixrajput / flutter_carousel_widget

A customizable carousel slider widget in Flutter which supports infinite scrolling, auto scrolling, custom child widget, custom animations and built-in indicators.
https://pub.dev/packages/flutter_carousel_widget
MIT License
27 stars 16 forks source link

[Bug]: 'CarouselController' is Defined in both material and flutter_carousel_widget #46

Open Johnishaa007 opened 2 days ago

Johnishaa007 commented 2 days ago

Contact Details

johnnyripperak47@gmail.com

What happened?

I tried using this package in my project but some errors occurred so I forked and tried to understand using the example app given but still the same error persist. I have tried using alias but does not solve anything. I have also cleared pub cache and again tried

Errors in EXAMPLE APP : `The name 'CarouselController' is defined in the libraries 'package:flutter/src/material/carousel.dart (via package:flutter/material.dart)' and 'package:flutter_carousel_widget/src/helpers/flutter_carousel_controller.dart (via package:flutter_carousel_widget/flutter_carousel_widget.dart)'.

The name 'CarouselController' is defined in the libraries 'package:flutter/src/material/carousel.dart (via package:flutter/material.dart)' and 'package:flutter_carousel_widget/src/helpers/flutter_carousel_controller.dart (via package:flutter_carousel_widget/flutter_carousel_widget.dart)'. Try using 'as prefix' for one of the import directives, or hiding the name from all but one of the imports.

Errors in Project C:/Users/hp/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_carousel_widget-2.2.0/lib/src/helpers/flutter_carousel_options.dart:5:1: Error: 'CarouselController' is imported from both 'package:flutter/src/material/carousel.dart' and 'package:flutter_carousel_widget/src/helpers/flutter_carousel_controller.dart'. import 'package:flutter_carousel_widget/src/helpers/flutter_carousel_controller.dart'; ^^^^^^^^^^^^^^^^^^ /C:/Users/hp/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_carousel_widget-2.2.0/lib/src/_expandable_carousel_widget.dart:208:13: Error: 'CarouselController' is imported from both 'package:flutter/src/material/carousel.dart' and 'package:flutter_carousel_widget/src/helpers/flutter_carousel_controller.dart'. : CarouselController() as CarouselControllerImpl; ^^^^^^^^^^^^^^^^^^ /C:/Users/hp/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_carousel_widget-2.2.0/lib/src/_flutter_carousel_widget.dart:149:13: Error: 'CarouselController' is imported from both 'package:flutter/src/material/carousel.dart' and 'package:flutter_carousel_widget/src/helpers/flutter_carousel_controller.dart'. : CarouselController() as CarouselControllerImpl;

Version

2.2.0

What devices are you seeing the problem on?

Android, iPhone

OS

Android 12

Relevant log output

`C:/Users/hp/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_carousel_widget-2.2.0/lib/src/_flutter_carousel_widget.dart:149:13: Error: 'CarouselController' is imported from both 'package:flutter/src/material/carousel.dart' and 'package:flutter_carousel_widget/src/helpers/flutter_carousel_controller.dart'.
          : CarouselController() as CarouselControllerImpl;
            ^^^^^^^^^^^^^^^^^^
Unhandled exception:
Unsupported operation: Unsupported invalid type InvalidType(<invalid>) (InvalidType). Encountered while compiling file:///C:/Users/hp/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_carousel_widget-2.2.0/lib/src/helpers/flutter_carousel_options.dart, which contains the type: FunctionType(CarouselOptions Function({allowImplicitScrolling: bool?, aspectRatio: double?, autoPlay: bool?, autoPlayAnimationDuration: Duration?, autoPlayCurve: Curve?, autoPlayInterval: Duration?, carouselController: <invalid>, clipBehavior: Clip?, disableCenter: bool?, dragStartBehavior: DragStartBehavior?, enableInfiniteScroll: bool?, enlargeCenterPage: bool?, enlargeStrategy: CenterPageEnlargeStrategy?, floatingIndicator: bool?, height: double?, indicatorMargin: double?, initialPage: int?, keepPage: bool?, onPageChanged: dynamic Function(int, CarouselPageChangedReason)?, onScrolled: void Function(double?)?, padEnds: bool?, pageSnapping: bool?, pageViewKey: PageStorageKey<dynamic>?, pauseAutoPlayInFiniteScroll: bool?, pauseAutoPlayOnManualNavigate: bool?, pauseAutoPlayOnTouch: bool?, physics: ScrollPhysics?, restorationId: String?, reverse: bool?, scrollBehavior: ScrollBehavior?, scrollDirection: Axis?, showIndicator: bool?, slideIndicator: SlideIndicator?, viewportFraction: double?})).
#0      ProgramCompiler._typeCompilationError (package:dev_compiler/src/kernel/compiler.dart:3224)
`

Code of Conduct

nixrajput commented 2 days ago

Hi @Johnishaa007,

Thank you for bringing this issue to my attention!

I am already aware of the problem and will address it in the next update, which I plan to release next week.

Thank you for your patience.

Regards, Nikhil