dali 0.0.12

Dalí #

An image loading and caching library for flutter focused on speed and memory efficiency.

Supports iOS and Android.

Dalí saves the downloaded image in memory in case the same image is requested in the future. Only a resized version with the desired size will be loaded in memory instead of loading the full size in order to preserve RAM memory.

Images are also saved in the cache directory of the app.

Getting Started #

Use the Dali widget

The easier way is to use the Dali widget. It will get the dimensions of his container and load a resized image

  height: 200,
  width: 200,
  child: Dali(

You have the option to set a loading widget while the image is being loaded, and also an error widget if it occurs

  imageUrl: 'https://homepages.cae.wisc.edu/~ece533/images/airplane.png',
  fit: BoxFit.cover,
  placeholder: Icon(Icons.timer),
  errorWidget: Icon(Icons.error),

Use the DaliImageProvider

Alternatively you can use the DaliImageProvider in combination with the Image widget

  image: DaliImageProvider(
    width: 90,
    height: 90,
  fit: BoxFit.cover,

Remember it is always better to set the width and height of the image

[0.0.12] - 25/4/2019

  • Fix androidx problem

[0.0.11] - 16/4/2019

  • Formatted files

[0.0.10] - 12/1/2019

  • Scale parameter

[0.0.8] - 4/1/2019

  • Manage non supported format errors

[0.0.7] - 24/12/2018

  • Some classes have been renamed
  • Updated readme file

[0.0.6] - 24/12/2018

  • Bug fixing

[0.0.5] - 24/12/2018

  • Simplified set up of the library

[0.0.4] - 23/12/2018

  • Error detection to show errorWidget
  • Added BoxFit param to Dali class

[0.0.3] - 23/12/2018

  • Bug fixing
  • Unit tests

[0.0.2] - 19/12/2018

  • Bug fixing

[0.0.1] - 16/12/2018

  • Initial release.


import 'package:dali/dali.dart';
import 'package:flutter/material.dart';

const images = [

void main() {

class MyApp extends StatelessWidget {
  Widget build(BuildContext context) {

    return MaterialApp(
      title: 'Dali Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      home: Scaffold(
        body: ListView.builder(
            itemCount: images.length,
            itemBuilder: (context, index) {
              return Container(
                height: 200,
                child: Dali(
                  placeholder: Icon(Icons.timer),
                  errorWidget: Icon(Icons.error),

Use this package as a library

1. Depend on it

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

  dali: ^0.0.12

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:dali/dali.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Feb 21, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5
  • Flutter: 1.12.13+hotfix.7

Health issues and suggestions

Fix lib/cached_image.dart. (-57.81 points)

Analysis of lib/cached_image.dart failed with 3 errors:

line 186 col 38: The argument type 'void Function(ImageInfo, bool)' can't be assigned to the parameter type 'ImageStreamListener'.

line 187 col 32: The argument type 'void Function(ImageInfo, bool)' can't be assigned to the parameter type 'ImageStreamListener'.

line 197 col 34: The argument type 'void Function(ImageInfo, bool)' can't be assigned to the parameter type 'ImageStreamListener'.

Fix lib/dali_image_provider.dart. (-44.03 points)

Analysis of lib/dali_image_provider.dart failed with 2 errors, 1 hint:

line 43 col 24: 'DaliImageProvider.load' ('ImageStreamCompleter Function(DaliKey)') isn't a valid override of 'ImageProvider.load' ('ImageStreamCompleter Function(DaliKey, Future

line 49 col 11: The argument type 'Null Function(StringBuffer)' can't be assigned to the parameter type 'Iterable

line 49 col 33: This function has a return type of 'Iterable

Fix lib/dali_cache_manager.dart. (-25 points)

Analysis of lib/dali_cache_manager.dart failed with 1 error:

line 93 col 25: Too many positional arguments: 1 expected, but 2 found.

Maintenance issues and suggestions

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (path_provider).

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
image ^2.0.4 2.1.12
path_provider ^0.5.0+1 0.5.0+1 1.6.1
Transitive dependencies
archive 2.0.13
args 1.5.2
charcode 1.1.3
collection 1.14.11 1.14.12
convert 2.1.1
crypto 2.1.4
meta 1.1.8
path 1.6.4
petitparser 3.0.1
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
xml 3.7.0
Dev dependencies