image_x 0.0.2
image_x: ^0.0.2 copied to clipboard
Lazy image widget for any path [Asset, Path, Url] for all image types.
ImageX #
Just a lazy image widget that accepts any path of [Asset, Path, Url] to load all image types including SVG.
=> Returns a statless widget
Takes these named paramters:
String pathrequired path to image. It could be [Asset, Path, or Url]double? heightoptional height.double? widthoptional width.BoxDecoration? decorationoptional decoration.Clip clipBehavioroptional clipBehavior with default value = Clip.hardEdgeBoxFit? fitoptional fit with default value = BoxFit.containWidget? loadingWidgetoptional loading widget.Widget? errorWidgetfallback error widget with default value of x iconColor? svgColorin case of [SVG] you can optionally set color
Example: #
class MyLogo extends StatelessWidget {
const MyLogo({super.key});
@override
Widget build(BuildContext context) {
return const ImageX(
path: 'assets/images/logo.svg',
fit: BoxFit.fitWidth,
svgColor: Colors.blue,
);
}
}