dali 0.0.10

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 75

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

Container(
  height: 200,
  width: 200,
  child: Dali(
    'https://homepages.cae.wisc.edu/~ece533/images/airplane.png',
  ),
)

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

Dali(
  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(
  image: DaliImageProvider(
    'https://homepages.cae.wisc.edu/~ece533/images/airplane.png',
    width: 90,
    height: 90,
  ),
  fit: BoxFit.cover,
)

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

[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.

example/example.dart

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


const images = [
  'https://homepages.cae.wisc.edu/~ece533/images/airplane.png',
  'https://homepages.cae.wisc.edu/~ece533/images/arctichare.png',
  'https://homepages.cae.wisc.edu/~ece533/images/baboon.png',
  'https://homepages.cae.wisc.edu/~ece533/images/barbara.bmp',
  'https://homepages.cae.wisc.edu/~ece533/images/barbara.png',
  'https://homepages.cae.wisc.edu/~ece533/images/boat.png',
  'https://homepages.cae.wisc.edu/~ece533/images/cameraman.tif',
  'https://homepages.cae.wisc.edu/~ece533/images/cat.png',
  'https://homepages.cae.wisc.edu/~ece533/images/fruits.png',
  'https://homepages.cae.wisc.edu/~ece533/images/frymire.png',
  'https://homepages.cae.wisc.edu/~ece533/images/girl.png',
  'https://homepages.cae.wisc.edu/~ece533/images/goldhill.png',
  'https://homepages.cae.wisc.edu/~ece533/images/lena.png',
  'https://homepages.cae.wisc.edu/~ece533/images/monarch.png',
  'https://homepages.cae.wisc.edu/~ece533/images/mountain.png',
  'https://homepages.cae.wisc.edu/~ece533/images/peppers.png',
  'https://homepages.cae.wisc.edu/~ece533/images/pool.png',
  'https://homepages.cae.wisc.edu/~ece533/images/sails.bmp',
  'https://homepages.cae.wisc.edu/~ece533/images/serrano.png',
  'https://homepages.cae.wisc.edu/~ece533/images/tulips.png',
  'https://homepages.cae.wisc.edu/~ece533/images/watch.png',
  'https://homepages.cae.wisc.edu/~ece533/images/zelda.png',
];

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  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(
                  images[index],
                  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:


dependencies:
  dali: ^0.0.10

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support flutter packages 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';
  
Version Uploaded Documentation Archive
0.0.10 Jan 12, 2019 Go to the documentation of dali 0.0.10 Download dali 0.0.10 archive
0.0.9 Jan 12, 2019 Go to the documentation of dali 0.0.9 Download dali 0.0.9 archive
0.0.8 Jan 4, 2019 Go to the documentation of dali 0.0.8 Download dali 0.0.8 archive
0.0.7 Jan 1, 2019 Go to the documentation of dali 0.0.7 Download dali 0.0.7 archive
0.0.6 Dec 24, 2018 Go to the documentation of dali 0.0.6 Download dali 0.0.6 archive
0.0.5 Dec 24, 2018 Go to the documentation of dali 0.0.5 Download dali 0.0.5 archive
0.0.4 Dec 23, 2018 Go to the documentation of dali 0.0.4 Download dali 0.0.4 archive
0.0.3 Dec 23, 2018 Go to the documentation of dali 0.0.3 Download dali 0.0.3 archive
0.0.2 Dec 19, 2018 Go to the documentation of dali 0.0.2 Download dali 0.0.2 archive
0.0.1 Dec 17, 2018 Go to the documentation of dali 0.0.1 Download dali 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
54
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
75
Learn more about scoring.

We analyzed this package on Jan 15, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.10
  • Flutter: 1.1.7

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/cached_image.dart.

Run flutter format to format lib/cached_image.dart.

Format lib/dali.dart.

Run flutter format to format lib/dali.dart.

Format lib/dali_cache_manager.dart.

Run flutter format to format lib/dali_cache_manager.dart.

Format lib/dali_image_provider.dart.

Run flutter format to format lib/dali_image_provider.dart.

Format lib/site.dart.

Run flutter format to format lib/site.dart.

Maintenance suggestions

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

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

Dependencies

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.0.5
path_provider ^0.4.1 0.4.1
Transitive dependencies
archive 2.0.5
args 1.5.1
charcode 1.1.2
collection 1.14.11
convert 2.1.1
crypto 2.0.6
meta 1.1.6 1.1.7
path 1.6.2
petitparser 2.1.0
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
xml 3.2.5
Dev dependencies
flutter_test