provideSvg method

  1. @override
String provideSvg(
  1. void message
)
override

Provides the SVG string by reading the file's bytes and decoding them.

If the file cannot be read or the data is invalid, it will return an empty string or handle the error gracefully depending on the implementation.

Implementation

@override
String provideSvg(void message) {
  try {
    final Uint8List bytes = file.readAsBytesSync();
    return utf8.decode(bytes, allowMalformed: true);
  } catch (e) {
    // Log or handle the error as appropriate
    return ''; // Returning an empty string as a fallback
  }
}