flutter_svg
flutter_svg copied to clipboard
Why the ! operator on message in provideSvg?
Hi!
I created my own SvgNetworkLoader extending it. In overriden prepareMessage I return null on some network failures, as the return type was Future<Uint8List?>.
But looks like returning null is illegal here, because in loaders.dart:361 the library uses ! on it:
String provideSvg(Uint8List? message) => utf8.decode(message!);
Which results in an unhandled exception. I propose to either change return type of prepareMessage or handle nulls there.
Agreed this is a problem. Probably related to #250