我目前正在创建一个应用程序,其中我编写了一个函数以便能够从具有特定扩展名的 Web 获取图像,但这里有一个错误,我不知道如何解决帮帮我
文字错误
/C:/Users/sina%20saffar/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_dropzone_web-3.0.13/lib/flutter_dropzone_plugin.dart:64:25: Error: The return type of the method 'FlutterDropzonePlugin.pickFiles' is 'Future<List<dynamic>>', which does not match the return type, 'Future<List<DropzoneFileInterface>>', of the overridden method, 'FlutterDropzonePlatform.pickFiles'.
- 'Future' is from 'dart:async'.
- 'List' is from 'dart:core'.
- 'DropzoneFileInterface' is from 'package:flutter_dropzone_platform_interface/dropzone_file_interface.dart' ('/C:/Users/sina%20saffar/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_dropzone_platform_interface-2.2.0/lib/dropzone_file_interface.dart').
Change to a subtype of 'Future<List<DropzoneFileInterface>>'.
Future<List<dynamic>> pickFiles(bool multiple,
^
/C:/Users/sina%20saffar/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_dropzone_platform_interface-2.2.0/lib/flutter_dropzone_platform_interface.dart:97:39: Context: This is the overridden method ('pickFiles').
Future<List<DropzoneFileInterface>> pickFiles(bool multiple,
选择本地图像功能:
Future<void> selectLocalImages() async {
final files = await dropzoneViewController.pickFiles(
multiple: true,
mime: ['image/jpeg', 'image/png'],
);
if (files.isNotEmpty) {
for (var file in files) {
if (file is html.File) {
final bytes = await dropzoneViewController.getFileData(file);
final image = ImageModel(
url: '',
file: file,
folder: '',
filename: file.name,
localImageToDisplay: Uint8List.fromList(bytes),
);
selectedImagesToUpload.add(image);
}
}
}
}