felixblaschke / simple_animations

Flutter package for creating awesome animations.
MIT License
1.04k stars 107 forks source link

Error: A value of type 'ValueListenable<bool>' can't be assigned to a variable of type 'ValueNotifier<bool>'. #104

Open NaveenNirban opened 6 months ago

NaveenNirban commented 6 months ago

While running the application, I am getting below error.


> ../../../.pub-cache/hosted/pub.dev/simple_animations-4.2.0/lib/anicoto/animation_mixin.dart:139:56: Error: A value of type 'ValueListenable<bool>' can't be assigned to a variable of type 'ValueNotifier<bool>'.
>  - 'ValueListenable' is from 'package:flutter/src/foundation/change_notifier.dart' ('../../../Downloads/flutter/packages/flutter/lib/src/foundation/change_notifier.dart').
>  - 'ValueNotifier' is from 'package:flutter/src/foundation/change_notifier.dart' ('../../../Downloads/flutter/packages/flutter/lib/src/foundation/change_notifier.dart').
>     final ValueNotifier<bool> newNotifier = TickerMode.getNotifier(context);
>                                                        ^
> Target kernel_snapshot failed: Exception

Flutter doctor output is below.

[✓] Flutter (Channel stable, 3.19.6, on macOS 14.4.1 23E224 darwin-arm64, locale en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.1)
[✓] IntelliJ IDEA Community Edition (version 2022.1.4)
[✓] VS Code (version 1.89.1)
[✓] Connected device (3 available)
    ! Error: Browsing on the local area network for Naveen’s iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network
      as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources

• No issues found!

This is my pubspec.yaml file

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
  get: ^4.6.3
  #  firebase-config
  firebase_core: ^2.5.0
  firebase_crashlytics: ^3.1.0

  responsive_sizer: ^3.0.8
  nanoid: ^1.0.0
  syncfusion_flutter_charts: ^20.1.59
  dropdown_button2: ^1.5.3
  shared_preferences: ^2.0.12
  http: ^0.13.4
  fluttertoast: 8.1.2
  dotted_border: ^2.0.0+2
  image_picker: ^0.8.5+3
  simple_animations: ^4.2.0
  flutter_feather_icons: ^2.0.0+1
  cached_network_image: ^3.2.1
  flutter_logs: ^2.1.7
  flutter_screenutil: ^5.5.3+2
  flutter_spinkit: ^5.1.0
  rxdart: ^0.27.5
  mime: ^1.0.2
  jwt_decoder: ^2.0.1
  d_chart: ^2.2.5
  hive: ^2.2.3
  local_auth: ^2.1.2
  pull_to_refresh: ^2.0.0
  connectivity_plus: ^3.0.3
  internet_connection_checker: ^1.0.0+1
  #  flutter_downloader:
  path_provider: ^2.0.11
  permission_handler: ^10.0.0
  device_info_plus: ^8.1.0
  android_path_provider: ^0.3.0
  open_filex: ^4.3.2
  #  open_file_plus: ^3.3.0
  shimmer: ^2.0.0
  url_launcher: ^6.1.6
  flutter_local_notifications: ^13.0.0
  flutter_image_compress: ^1.1.3
  firebase_remote_config: ^3.0.10
  store_redirect: ^2.0.1
  package_info_plus:
  firebase_analytics: ^10.1.6
  webview_flutter: ^4.1.0
  fk_user_agent: ^2.1.0
  dart_ipify: ^1.1.1

dependency_overrides:
  firebase_core_platform_interface: ^4.6.0
  simple_animations: ^4.2.0

Any clue or help will be appreciated.

felixblaschke commented 6 months ago

Use version 5 of simple animations. 4.x branch might be outdated with your Flutter version.