Last updated:
0 purchases
general image widget
This widget unifies the different methods on loading an image.
Features #
support to load image from network
support to load image from file
support to load image from asset
support soft error handling, displaying a gray box if the path provided is not valid
This widget automatically detects which type of path/url/asset was passed to it.
Getting started #
No prerequisites are required to use this package.
Simply append it to your project.
Usage #
Examples for each type of usage:
Load by path:
ImageWidget(
imagePath: '/path/to/local/file.jpg', // Absolute path to the image on the local file system
width: 100,
height: 100,
fit: BoxFit.fill,
)
copied to clipboard
Load by asset:
ImageWidget(
imagePath: 'assets/images/my_local_image.png', // Path relative to the assets directory
width: 100,
height: 100,
fit: BoxFit.cover,
)
copied to clipboard
Load by url:
ImageWidget(
imagePath: 'https://example.com/image.jpg', // Full URL to the image on the web
width: 100,
height: 100,
fit: BoxFit.scaleDown,
)
copied to clipboard
Additional information #
Feel free to suggest and add modifications to this repository. This repository will be updated on demand.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.