Hybrid Image

Wraps flutter_svg and the Flutter SDK image providers and picks the right widget based on the file extension

Features

As of right now it’s possible to use three widgets:

  • HybridAssetImage
  • HybridNetworkImage
  • HybridFileImage

Memory image isn’t supported as of right now, because it’s not possible to distinct between svg images and regular images

Getting started

Since it’s a wrapper for flutter_svg and the normal image constructors, there’s not special usage to be mentioned. Pick the right widget for your use case whether it’s network, asset or file.

Usage

final file = File('your/path.png');
HybridFileImage(file, width: 50, height: 50),

HybridAssetImage('assets/my_image.svg', width: 50, height: 50),

HybridNetworkImage('https://my.website.com/this_image.jpg', width: 50, height: 50),

Additional information

This package has been made for convenience, if you have any good additions feel free to open a pull request on Github ?

GitHub

View Github