dali 0.0.6

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

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 saved in the cache directory of the app. This means the OS can delete the files any time.

Getting Started #

Then you can load an image in a container:

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

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

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or 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]
64
Health:
Code health derived from static analysis. [more]
50
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
61
Learn more about scoring.

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

  • Dart: 2.1.0
  • pana: 0.12.13+1
  • Flutter: 1.2.1

Platforms

Detected platforms:

Error(s) prevent platform classification:

Error(s) in lib/old/image_cache_impl.dart: 'ImageCacheImpl.putIfAbsent' ('(Object, () → ImageStreamCompleter) → ImageStreamCompleter') isn't a valid override of 'ImageCache.putIfAbsent' ('(Object, () → ImageStreamCompleter, {onError: (dynamic, StackTrace) → void}) → ImageStreamCompleter').

Health issues and suggestions

Fix lib/old/image_cache_impl.dart. (-25 points)

Analysis of lib/old/image_cache_impl.dart failed with 1 error:

line 20 col 3: 'ImageCacheImpl.putIfAbsent' ('(Object, () → ImageStreamCompleter) → ImageStreamCompleter') isn't a valid override of 'ImageCache.putIfAbsent' ('(Object, () → ImageStreamCompleter, {onError: (dynamic, StackTrace) → void}) → ImageStreamCompleter').

Format lib/cached_image.dart.

Run flutter format to format lib/cached_image.dart.

Format lib/cached_image_provider.dart.

Run flutter format to format lib/cached_image_provider.dart.

Fix additional 4 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/dali.dart (Run flutter format to format lib/dali.dart.)
  • lib/dali_cache_manager.dart (Run flutter format to format lib/dali_cache_manager.dart.)
  • lib/old/dali_cache_binding.dart (Run flutter format to format lib/old/dali_cache_binding.dart.)
  • lib/site.dart (Run flutter format to format lib/site.dart.)

Maintenance issues and suggestions

Fix platform conflicts. (-20 points)

Error(s) prevent platform classification:

Error(s) in lib/old/image_cache_impl.dart: 'ImageCacheImpl.putIfAbsent' ('(Object, () → ImageStreamCompleter) → ImageStreamCompleter') isn't a valid override of 'ImageCache.putIfAbsent' ('(Object, () → ImageStreamCompleter, {onError: (dynamic, StackTrace) → void}) → ImageStreamCompleter').

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.

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.7
path_provider ^0.4.1 0.4.1 0.5.0+1
Transitive dependencies
archive 2.0.8
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.1
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
xml 3.3.1
Dev dependencies
flutter_test