image_x 0.0.7
image_x: ^0.0.7 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.
Takes these named paramters:
String pathrequired path to image. It could be [Asset, Path, or Url]double? heightoptional widget height.double? widthoptional widget width.double scaleoptional image scale to the size with default value = 1.BorderRadius borderRadiusoptional borderRadius with default value = [BorderRadius.zero]BoxDecoration? decorationoptional decoration.BoxFit? fitoptional fit with default value = [BoxFit.contain]Widget? loadingWidgetoptional loading widget.Widget? errorWidgetfallback error widget with default value of x iconColor? svgColorin case of [SVG] you can optionally set colorVoidCallback? onPressedoptional onPressed callback function.
Example: #
class MyLogo extends StatelessWidget {
const MyLogo({super.key});
@override
Widget build(BuildContext context) {
return const ImageX(
path: 'assets/images/logo.svg',
height: 200,
width: 200,
scale: .66,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100),
border: Border.all(width: 2, color: Colors.blue),
),
svgColor: Colors.blue,
);
}
}