skip to Main Content

I am getting error while compiling flutter app
Anyone can help?
Here is full error :

/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/carousel_slider-4.2.0/lib/carousel_slider.dart:311:29: Error: Member not found: 'trackpad'.
          PointerDeviceKind.trackpad

Here are dependencies from yaml file
`


version: 1.0.0+1

environment:
sdk: ">=2.16.2 <3.0.0"


dependencies:
  flutter:
    sdk: flutter


  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^1.0.2
  carousel_slider: ^4.2.0
  video_player:

`

3

Answers


  1. Clean pub cache folder by command bellow

    flutter pub cache repair 
    

    And download all dependencies by following command in your project directory

    flutter pub cache repair 
    

    IMPORTANT

    All libraries will be downloaded from the internet from the scratch and this will take some time depends how many libraries are you using

    Login or Signup to reply.
  2. Welcome Rohan!

    This issue is because of the introduction of the new trackpad gestures in version 3.3.0-0.0.pre of flutter as documented here: https://docs.flutter.dev/release/breaking-changes/trackpad-gestures looks like carousel_slider has been update to use it.

    You have two options:

    1. Upgrade your flutter SDK to 3.3.0-0.0.pre or greater
    2. Or downgrade carousel_slider: 4.1.0
    Login or Signup to reply.
  3. you should declare carousel_slider: 4.1.1 in pubspec.yaml
    instead of carousel_slider: ^4.1.1 because with ^ sign flutter will try to use latest version in pub.dev

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search