DGHub Studio

Buy Me a Coffee

Buy Me A Coffee

Pub

What is

A flutter package to cache network image fastly without native dependencies, with loader, error builder, and smooth fade transitions. You can also add beautiful loaders and percentage indicators with the total and download size of the image.

See for example this or this answer on previous posted issues.

Installation

In the dependencies: section of your pubspec.yaml, add the following line:

dependencies:
  dghub_image: <latest_version>

Import package

import 'package:dghub_image/dghub_image.dart';

Example - Install

  await DGHubImage.init();

Example - Auto load image

   DGHubImage(
                width: 200,
                height: 200,
                autoLoad:'Auto load url,file,asset,avatar');

Example - Network

   DGHubImage.network(
                width: 200,
                height: 200,
                load:
                    'https://st2.depositphotos.com/2001755/8564/i/450/depositphotos_85647140-stock-photo-beautiful-landscape-with-birds.jpg');

Example - File

   DGHubImage.file(
                width: 200,
                height: 200,
                load:
                    'your file path');

Example - Asset

   DGHubImage.asset(
                width: 200,
                height: 200,
                load:
                    'your asset path');

Example - Byte

   DGHubImage.byte(
                width: 200,
                height: 200,
                load:
                    'your image byte');

Example - Avatar

   DGHubImage.avatar(
                width: 200,
                height: 200,
                load:
                    'your name');

Importants Methods and propriets

  • Table by antonio-nicolau
Methods Mean
DGHubImage.init For install
DGHubImage.clearCache For clean
DGHubImage.network For url image
DGHubImage.file For file image
DGHubImage.asset For asset image
DGHubImage.byte For byte image
DGHubImage.avatar For avatar
  • Package created by Min Thant Htet

Libraries

dghub_image