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

A Flutter package for loading images from various sources with optional tap handling and customizable error widgets.

MultiImageLoader #

A Flutter package to load and display images from various sources including asset files, network links, memory, files, SVGs, and Lottie animations, with support for directional flipping based on text direction.

Features #

  • Load images from different sources:
    • Assets
    • Network links
    • Memory
    • Files
    • SVG
    • Lottie animations
  • Support for directional flipping based on text direction (RTL/LTR).
  • Customizable image properties like height, width, fit, and more.
  • Optional tap handling with onTap callback.
  • Customizable error widget for handling image load failures.

Installation #

Add this to your package's pubspec.yaml file:

dependencies:
  multi_image_loader: ^1.0.0
  • Then, install the package using the following command: -flutter pub get

Usage #

Import it

  import 'package:multi_type_image_loader/multi_type_image_loader.dart';

Parameters #

  • image: The image source (String for asset/link/file, Uint8List for memory).
  • imageType: The type of image source (Asset, Link, Memory, File, SVG, Lottie).
  • fit: How the image should be inscribed into the space allocated for it.
  • height, width: The height and width of the image.
  • imageBytes: The bytes of the image when imageType is ImageType.memory.
  • onTap: Callback function to handle taps on the image.
  • isDirectionRequired: Flag to indicate whether directional flipping is required. (defaults to true)
  • errorWidget: Widget to display in case of image load failure.

Example Usage #

   MultiImageLoader(
      image: 'path/to/image.jpg', 
      imageType: ImageType.asset,
      fit: BoxFit.cover,
      onTap: () => print('Image tapped!'),
      errorWidget: Icon(Icons.error),
    ),
2
likes
140
points
41
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package for loading images from various sources with optional tap handling and customizable error widgets.

Homepage

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

cached_network_image, flutter, flutter_svg, lottie

More

Packages that depend on multi_image_loader