bitmap_texture: ^0.0.2 copied to clipboard
BitMap is an alternative to Image.file, achieving higher performance image display.
BitMap is an alternative to
Image.file, achieving higher performance image display.
Use the native texture and texture caching mechanism to render images to achieve the ultimate optimization of image rendering performance. Compared with flutter's native
Image.file, users can display images more efficiently and concisely.
BitMap instead of
Image.file, you will get:
- No longer worry about the problem that pictures cannot be displayed in time when the album is sliding at high speed.
|width||double||the width of the image to be displayed||-|
|height||double||the height of the image to be displayed||-|
|fit||BoxFit||image filling method||BoxFit.cover|
- How to use
BitMap( path: path, width: width.toDouble(), height: height.toDouble(), fit: BoxFit.cover, )
BitMap will cache part of the texture during use. After
BitMap is used, you can choose whether to call
BitMapNaive.dispose to destroy the cached texture. If it is not destroyed, it will be used next time you use
BitMap Cached texture, so as to achieve the ultimate optimization of rendering performance.
In some extreme cases,
BitMapNaive.dispose may not actually destroy all textures.
- When a certain texture in a BitMap is not loaded, call BitMapNaive.dispose, then the image texture in BitMap will not be destroyed, you can only call BitMapNaive.dispose again after it is loaded To really destroy it
BitMapNaive.disposewhen each texture is being used by
BitMap, then the texture will not be destroyed
- [ ]
BitMapNaive.disposedestroys all created textures
- [ ] Optimized the judgment conditions of
_BitMapState.didUpdateWidget, and unnecessary rendering after taking out the parent node and calling