flutter_image_gallery 1.0.6

  • Readme
  • Changelog
  • Example
  • Installing
  • 82

A Flutter Image Gallery plugin.

Flutter plugin that allows you to display images located locally on iOS and Android.

Key Features #

  • Display multiple images in your galleries (any views)
  • Native performance
  • Thumbnail support
  • Read image meta data

flutter_image_gallery - Flutter image gallery plugin

Usage #

 Future<void> loadImageList() async {
    List allImageTemp;
      allImageTemp = await FlutterImageGalleryPlugin.getAllImages;


    setState(() {
      this.allImage = allImageTemp;
    });
  }


Support #

If this plugin has assisted you in any way and saved you time, please donate below:

Donate
Bitcoin Address: 1DttBdf6PWLUPXJLWVTRGWyeXvEMmWjM5p

License #

MIT

GitHub @rgodlontonshaw  ·  Twitter @rgodlontonshaw

1.0.6n #

example/lib/main.dart

import 'dart:collection';

import 'package:flutter/material.dart';
import 'dart:io';
import 'dart:async';
import 'package:flutter/services.dart';
import 'package:flutter_image_gallery/flutter_image_gallery.dart';

void main() => runApp(new MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => new _MyAppState();
}

class _MyAppState extends State<MyApp> {
  Map<dynamic, dynamic> allImageInfo = new HashMap();
  List allImage = new List();

  @override
  void initState() {
    super.initState();
    loadImageList();
  }

  Future<void> loadImageList() async {
    Map<dynamic, dynamic> allImageTemp;
    allImageTemp = await FlutterImageGallery.getAllImages;
    print(" call $allImageTemp.length");

    setState(() {
      this.allImage = allImageTemp['URIList'] as List;
    });
  }

  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      debugShowCheckedModeBanner: false,
      home: new Scaffold(
        appBar: new AppBar(
          title: const Text('Image Gallery'),
        ),
        body: _buildGrid(),
      ),
    );
  }

  Widget _buildGrid() {
    return GridView.extent(
        maxCrossAxisExtent: 150.0,
        padding: const EdgeInsets.all(4.0),
        mainAxisSpacing: 4.0,
        crossAxisSpacing: 4.0,
        children: _buildGridTileList(allImage.length));
  }

  List<Container> _buildGridTileList(int count) {
    return List<Container>.generate(
        count,
        (int index) => Container(
                child: new Column(
              mainAxisSize: MainAxisSize.max,
              crossAxisAlignment: CrossAxisAlignment.center,
              children: <Widget>[
                Image.file(
                  File(allImage[index].toString()),
                  width: 96.0,
                  height: 96.0,
                  fit: BoxFit.contain,
                ),
              ],
            )));
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_image_gallery: ^1.0.6

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:flutter_image_gallery/flutter_image_gallery.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
64
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
82
Learn more about scoring.

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

  • Dart: 2.8.4
  • pana: 0.13.14
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform linux

Because:

  • package:flutter_image_gallery/flutter_image_gallery.dart that declares support for platforms: android, ios

Package does not support Flutter platform macos

Because:

  • package:flutter_image_gallery/flutter_image_gallery.dart that declares support for platforms: android, ios

Package does not support Flutter platform web

Because:

  • package:flutter_image_gallery/flutter_image_gallery.dart that declares support for platforms: android, ios

Package does not support Flutter platform windows

Because:

  • package:flutter_image_gallery/flutter_image_gallery.dart that declares support for platforms: android, ios

Package not compatible with SDK dart

Because:

  • flutter_image_gallery that is a package requiring null.

Health issues and suggestions

Document public APIs. (-1 points)

4 out of 4 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.1
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
Dev dependencies
flutter_test