addImage method

  1. @override
Future<void> addImage(
  1. String name,
  2. Uint8List bytes, [
  3. bool sdf = false
])
override

Implementation

@override
Future<void> addImage(String name, Uint8List bytes,
    [bool sdf = false]) async {
  final photo = decodeImage(bytes)!;
  if (!_map.hasImage(name)) {
    _map.addImage(
      name,
      {
        'width': photo.width,
        'height': photo.height,
        'data': photo.getBytes(),
      },
      {'sdf': sdf},
    );
  }
}