flutter_custom_image 1.0.2 copy "flutter_custom_image: ^1.0.2" to clipboard
flutter_custom_image: ^1.0.2 copied to clipboard

This package is used for displaying images with assets, SVGs, and network images.

πŸ‘‰ A versatile Flutter package for displaying images with various sources, including assets, SVGs, and
network images. The `ImageViewer` widget simplifies the integration of different image types,
providing customization options for dimensions, error handling, and border-radius.

πŸ‘‰ Parameters

imagePath Path to the image, either an asset, SVG, or network URL βœ…
imageType Type of the image (ImageType.asset, ImageType.svg, ImageType.network) βœ…
width and height Dimensions of the image ❌
boxFit BoxFit for the image ❌
errorIcon Icon to display in case of loading errors ❌
imageColor Color to apply to the image ❌
alignment Alignment of the image within its container ❌ 

topLeftRadius, 

topRightRadius, 

bottomLeftRadius, 

bottomRightRadius

Border radiius for clipping ❌

πŸ‘‰ Show me the code πŸ‘€

enum ImageType { asset, svg, network }
ImageViewer(
  imagePath: 'your_image_path',
  imageType: ImageType.asset, // Change to your desired ImageType
  // Add other optional parameters for customization
)
class MenuExample extends StatefulWidget {
  @override
  _MenuExampleState createState() => _MenuExampleState();
}
class _MenuExampleState extends State<MenuExample> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: ImageViewer(
          imagePath: 'http://via.placeholder.com/200x200',
          imageType: ImageType.network,
          width: 200,
          height: 200,
          boxFit: BoxFit.cover,
          errorIcon: Icons.error_outline,
          errorIconColor: Colors.blueGrey,
          imageColor: Colors.blue,
          alignment: Alignment.center,
          topLeftRadius: 10,
          topRightRadius: 20,
          bottomLeftRadius: 30,
          bottomRightRadius: 40,
        ),
      ),
    );
  }
}
21
likes
160
points
31
downloads

Publisher

unverified uploader

Weekly Downloads

This package is used for displaying images with assets, SVGs, and network images.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

cached_network_image, flutter, flutter_svg

More

Packages that depend on flutter_custom_image