这个错误是什么意思以及如何解决?
错误:
Animation? decodeImage
The argument type 'Image?' can't be assigned to the parameter type 'Image'
飞镖代码:
import 'dart:io';
import 'package:image/image.dart';
void main(){
final image = 'asset/test.webp';
final bytes = File(image).readAsBytesSync(); // type List<int>
final decodeImage = decodeWebPAnimation(bytes); // type Animation
var obj = WebPEncoder();
obj.addFrame(decodeImage?[0]); // gives error
}
有哪些修复方法?