fromBytes static method
- @Deprecated('Switch to using `bytes` method or BytesMapBitmap instead')
Creates a BitmapDescriptor using an array of bytes that must be encoded
as PNG.
On the web, the size
parameter represents the physical size of the
bitmap, regardless of the actual resolution of the encoded PNG.
This helps the browser to render High-DPI images at the correct size.
size
is not required (and ignored, if passed) in other platforms.
Implementation
@Deprecated('Switch to using `bytes` method or BytesMapBitmap instead')
static BitmapDescriptor fromBytes(Uint8List byteData, {Size? size}) {
assert(byteData.isNotEmpty,
'Cannot create BitmapDescriptor with empty byteData');
return BitmapDescriptor._(<Object>[
_fromBytes,
byteData,
if (kIsWeb && size != null)
<Object>[
size.width,
size.height,
]
]);
}