Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The method 'CachedNetworkImageProvider.load' has fewer positional arguments than those of overridden method 'ImageProvider.load'

enter image description here

Please help me to resolve this error in flutter, i can't understand whats the error and how to resolve it. please tell me solution briefly means where to add code lines and changes which file, thank you in advance

like image 489
Umair Aleem Avatar asked Dec 14 '19 18:12

Umair Aleem


2 Answers

Flutter 1.12.13+hotfix.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 27321ebbad (12 days ago) • 2019-12-10 18:15:01 -0800
Engine • revision 2994f7e1e6
Tools • Dart 2.7.0

I updated the Flutter to latest today and got this error and read the repo readme and act on it. Everything works fine now thanks to package owner Rene Floor

Just increment the package in pubspec.yaml as suggested by the owner:

cached_network_image: ^2.0.0-rc

By package owner:

Breaking change with ImageProvider.load in Flutter 1.10

The Flutter team made a breaking change with the ImageProvider in Flutter 1.10.15 (currently Master channel only).

If you are experiencing one of the following errors upgrade to 2.0.0-rc.

The method 'ScaledFileImage.load' has fewer positional arguments than those of overridden method 'ImageProvider.load'

The method 'CachedNetworkImageProvider.load' has fewer positional arguments than those of overridden method

like image 144
Blasanka Avatar answered Nov 15 '22 09:11

Blasanka


according to package documentation on here

The Flutter team made a breaking change with the ImageProvider in Flutter 1.10.15 (currently Master channel only).

If you are experiencing one of the following errors upgrade to 2.0.0-rc.

like image 45
Jerson Morocho Avatar answered Nov 15 '22 08:11

Jerson Morocho