DecoderCallBack isn't a type
Asked Answered
F

2

8

When I try to run my flutter code into my phone, it is showing this error:

    Error: 'DecoderCallback' isn't a type.
  ImageStreamCompleter load(AdvancedNetworkImage key, DecoderCallback decode) {

This is my pubspec.yaml file:

    name: 
description: A new Flutter project.

# The following line prevents the package from being accidentally published to
# pub.dev using `flutter pub publish`. This is preferred for private packages.
publish_to: "none" # Remove this line if you wish to publish to pub.dev

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 12.0.0+1

environment:
  sdk: ">=2.16.2 <3.0.0"

# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
# consider running `flutter pub upgrade --major-versions`. Alternatively,
# dependencies can be manually updated by changing the version numbers below to
# the latest version available on pub.dev. To see which dependencies have newer
# versions available, run `flutter pub outdated`.
dependencies:
  flutter:
    sdk: flutter
  cupertino_icons: ^1.0.4
  dartz: ^0.10.1
  animated_text_kit: ^4.2.1
  font_awesome_flutter: ^10.1.0
  intl: ^0.18.1
  pinput: ^3.0.1
  # flutter_svg: ^2.0.4
  flutter_svg: ^1.1.6
  json_serializable: ^6.2.0
  json_annotation: ^4.5.0
  freezed_annotation: ^2.2.0
  uuid: ^4.0.0
  get_it: ^7.2.0
  provider: ^6.0.2
  # camera: ^0.9.7+1
  permission_handler: ^11.0.0
  encrypt: ^5.0.1
  http: ^0.13.6
  equatable: ^2.0.3
  # mysql1: ^0.20.0
  shared_preferences: ^2.0.15
  image_picker: ^1.0.4
  timeago: ^3.3.0
  jiffy: ^6.2.1
  google_fonts: ^4.0.4
  from_css_color: ^2.0.0
  simple_gradient_text: ^1.2.4
  dynamic_height_grid_view: ^0.0.3
  get: ^4.6.5
  flutter_rating_bar: ^4.0.1
  multiselect: ^0.1.0
  multiselect_formfield: ^0.1.7
  getwidget: ^4.0.0
  dropdown_button2: ^2.0.0
  custom_rating_bar: ^2.0.4
  flutter_rating_native: ^0.0.2
  flutter_launcher_icons: ^0.13.1
  tuple: ^2.0.1
  change_app_package_name: ^1.1.0
  animated_splash_screen: ^1.3.0
  custom_refresh_indicator: ^2.0.1
  flutter_gif: ^0.0.4
  url_launcher: ^6.1.10
  firebase_dynamic_links: ^5.3.1
  is_first_run: ^1.0.0
  extended_nested_scroll_view: ^6.0.0
  path: ^1.8.2
  image_cropper: ^4.0.1
  crop_image: ^1.0.5
  # sqlite3: ^1.11.0
  hive: ^2.2.3
  hive_flutter: ^1.1.0
  multi_select_flutter: ^4.1.3
  crop: ^0.5.5
  flutter_advanced_networkimage_2: ^2.0.1
  # firebase_storage: ^11.2.0
  # cloud_firestore: ^4.7.0
  sqflite: ^2.2.8+3
  path_provider: ^2.0.15

  # google sign-in using firebase
  firebase_auth: ^4.6.1
  google_sign_in: ^6.1.1
  # video_viewer: ^1.2.7
  # video_player: ^2.6.1








dev_dependencies:
  flutter_test:
    sdk: flutter
  freezed: ^2.3.2
  flutter_lints: ^2.0.1
  build_runner: ^2.1.10


flutter_icons:
  android: "launcher_icon"
  ios: true
  image_path: "assets/images/app_logo.png"


# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter packages.
flutter:
  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true

  # To add assets to your application, add an assets section, like this:
  assets:
    - assets/images/app_logo.svg
    - assets/images/app_logo.png
    - assets/images/mail.svg
    - assets/images/padlock.svg
    - assets/images/hide_1.svg
    - assets/images/google.svg
    - assets/images/facebook.svg
    - assets/images/Edit.svg
    - assets/images/Settings.svg
    - assets/images/Profile.svg
    - assets/images/Camera.svg
    - assets/images/back.svg
    - assets/images/Multiply.svg
    - assets/images/FourSquares.svg
    - assets/images/Bookmark.svg
    - assets/images/user.svg
    - assets/images/phone.svg
    - assets/images/dob.svg
    - assets/images/gender.svg
    - assets/images/left-arrow.svg
    - assets/images/Forward.svg
    - assets/images/delete.svg
    - assets/images/Cancel.svg
    - assets/images/newDelete.svg
    - assets/images/Ok.svg
    - assets/images/Right.svg
    - assets/images/Close.svg
    - assets/images/Home.svg
    - assets/images/addPost.svg
    - assets/images/Search.svg
    - assets/images/Profile_Icon.svg
    - assets/images/loader/logo.webp
    - assets/images/loader/indicators.webp
    - assets/images/hashtags.svg
    - assets/images/Customer.svg
    - assets/images/Rate.svg
    - assets/images/Like.svg
    - assets/images/Share.svg
    - assets/images/Comment.svg
    - assets/images/Eye.svg
    - assets/images/Heart.svg
    - assets/images/bell.svg
    - assets/images/new.svg
    - assets/images/support.svg
    - assets/images/Plus.svg
    - assets/images/Pen.svg
    - assets/images/trans_app_logo.png
    - assets/gif/splash_screen.gif
  #   - images/a_dot_ham.jpeg

  # An image asset can refer to one or more resolution-specific "variants", see
  # https://flutter.dev/assets-and-images/#resolution-aware.

  # For details regarding adding assets from package dependencies, see
  # https://flutter.dev/assets-and-images/#from-packages

  # To add custom fonts to your application, add a fonts section here,
  # in this "flutter" section. Each entry in this list should have a
  # "family" key with the font family name, and a "fonts" key with a
  # list giving the asset and other descriptors for the font. For
  # example:
  fonts:
  #   - family: Schyler
  #     fonts:
  #       - asset: fonts/Schyler-Regular.ttf
  #       - asset: fonts/Schyler-Italic.ttf
  #         style: italic
    - family: Recoleta Alt
      fonts:
        - asset: fonts/Recoleta Alt.ttf
          weight: 400
    - family: AbhayaLibre-ExtraBold
      fonts:
        - asset: fonts/AbhayaLibre-ExtraBold.ttf
          weight: 800
    - family: NotoEmoji
      fonts:
        - asset: fonts/NotoColorEmoji-Regular.ttf
          weight: 400
  #
  # For details regarding fonts from package dependencies,
  # see https://flutter.dev/custom-fonts/#from-packages

It is showing an error for the dependency "flutter_advanced_networkimage_2: ^2.0.1" I tried checking if it was compatible with the flutter or not but it was ok. I tried updating the dependencies to newer ones but it showed that few dependencies are not compatable. I tried to change the channel from master to stable but that didn't worked too.

Freudian answered 20/9, 2023 at 15:35 Comment(2)
DecoderCallback is deprecated.Lull
Then what should i doFreudian
H
9

I had the same error.

you can simply upgrade the dependencies as follows:

$ flutter pub upgrade
Hyperthyroidism answered 26/11, 2023 at 2:30 Comment(0)
C
0

Run the following commands in order

    $ flutter clean
    $ flutter pub get
    $ flutter analyze
    $ dart fix --apply
    $ flutter pub upgrade
Cully answered 28/3 at 9:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.