dispose method Null safety

void dispose()

Implementation

void dispose() {
  for (var resource in _resourceMap.values.toList(growable: false)) {
    if (resource.kind == 'BitmapData') {
      removeBitmapData(resource.name);
    } else if (resource.kind == 'TextureAtlas') {
      removeTextureAtlas(resource.name);
    } else {
      _removeResource(resource.kind, resource.name);
    }
  }
}