CircleAvatar(
radius: 40.0,
backgroundColor: Colors.blue,
backgroundImage:
user.profileImageUrl.isEmpty
? AssetImage('assets/images/user.png')
: CachedNetworkImageProvider(user.profileImageUrl),
),
它说“CachedNetworkImageProvider.load”的位置参数比覆盖方法“ImageProvider.load”的位置参数少。
当我打颤时,它给了我以下
/C:/Users/Acer/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/cached_network_image-1.1.3/lib/src/cached_network_image_provider.dart:42:24: Error: The method 'CachedNetworkImageProvider.load' has fewer positional arguments than those of overridden method 'ImageProvider.load'.
ImageStreamCompleter load(CachedNetworkImageProvider key) {
^
/D:/Flutter/flutter/packages/flutter/lib/src/painting/image_provider.dart:403:24: Context: This is the overridden method ('load').
ImageStreamCompleter load(T key, DecoderCallback decode);
^