general_image 1.0.1 copy "general_image: ^1.0.1" to clipboard
general_image: ^1.0.1 copied to clipboard

This Flutter package provides a simple way to show images from the Internet or from assets in one line of code.

This Flutter package provides a simple way to show images from the Internet or from assets. It supports both PNG and SVG images.

Features #

  • Show images from the Internet with a single line of code:
GeneralNetworkImage(url: "url",height: 50, width: 50,matchTextDirection: true,)   
  • Show images from assets with a single line of code:
GeneralImageAssets(path: "assets_path",width: 50,height: 50,color: Colors.red,matchTextDirection: true,boxFit: BoxFit.contain,)
  • Cache images to improve performance
  • Support for both PNG and SVG images in one line

Getting started #

To use the GeneralImage package, simply import it into your project:

import 'package:general_image/general_image.dart';

Usage #

If you want to show the image, in case of "svg" or "png" use this code:

 GeneralNetworkImage(
    url: "url",
    height: 50, width: 50,
    matchTextDirection: true,
    boxFit: BoxFit.fill,
    color: Colors.green,
    failWidget:Icon(Icons.error) ),

If you want to show the image from your assets, in case of "svg" or "png" use this code:

 GeneralImageAssets(
    path: "path",
    width: 50,height: 50,
    color: Colors.red,
    matchTextDirection: true,
    boxFit: BoxFit.contain,)

the package takes the following parameters:

  • url: The URL of the image.

  • height: The height of the image in pixels.

  • width: The width of the image in pixels.

  • matchTextDirection: support RTL.

  • color:The color of the image.

  • boxFit:The way in which the image should be scaled to fit the available space.

Plugins #

  • shimmer: link Pub
  • cached_network_image: link Pub
  • flutter_svg: link Pub

Conclusion #

The GeneralImage package provides a simple way to show images from the Internet or from assets. It supports both PNG and SVG images, and it caches images to improve performance.

Author #

3
likes
130
points
28
downloads

Publisher

unverified uploader

Weekly Downloads

This Flutter package provides a simple way to show images from the Internet or from assets in one line of code.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

cached_network_image, flutter, flutter_svg, shimmer

More

Packages that depend on general_image