flutter_widget_gallery 0.1.2+1

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 67

flutter_widget_gallery #

Widget Gallery Viewer.

It's a gallery, where you can pass all the children you'd like to show. It includes a bottom drawer to show the list of the children that are visible.

Implementation heavily relies on Flutter Gallery Demo / Gridview and Fluttery Cards

Installing #

1. Edit your pubspec.yaml file:

dependencies:
  flutter_widget_gallery: ^0.1.2

2. Install the packages

3. Import the Gallery Widget

import 'package:flutter/material.dart';
import 'package:flutter_widget_gallery/gallery/gallery.dart';


class PhotoViewer extends StatelessWidget {
  final List<Widget> pictures;

  const PhotoViewer({Key key, this.pictures}) : super(key: key);
  
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Gallery(
        children: pictures,
        activeItemColor: Theme.of(context).primaryColor,
        carouselBackgroundColor: Color(0xCCEAEAEA),
        carouselBackgroundItemColor: Color(0xFF000000),
        onChildTap: (index) => print('tapped on $index'),
        onChildLongPress: (index) => print('long press on $index'),
      ),
    );
  }
}

Example 2 #

import 'package:flutter/material.dart';

import 'gallery/gallery.dart';

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

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Flutter Demo',
      theme: new ThemeData(
        // This is the theme of your application.
        //
        // Try running your application with "flutter run". You'll see the
        // application has a blue toolbar. Then, without quitting the app, try
        // changing the primarySwatch below to Colors.green and then invoke
        // "hot reload" (press "r" in the console where you ran "flutter run",
        // or press Run > Flutter Hot Reload in IntelliJ). Notice that the
        // counter didn't reset back to zero; the application is not restarted.
        primarySwatch: Colors.blue,
      ),
      home: new MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        elevation: 0.0,
      ),
      body: Gallery(
        activeItemColor: Color(0xFF6A0AEA),
        backgroundColor: Color(0xFFF3F3F3),
        carouselBackgroundColor: Color(0xAAE3E3E3),
        children: List.generate<Widget>(
          10,
          (index) => Image.network(
                'https://picsum.photos/960/540?image=$index',
                fit: BoxFit.cover,
              ),
        ),
        onChildTap: (index) => print('tapped on $index'),
        onChildLongPress: (index) => print('long press on $index'),
      ),
    );
  }
}

0.1.2+1 #

  • Migrated repo to GitHub
  • Updated README on root
  • Added a more clear example of how to use it

0.1.2 #

  • Added carouselItemBackground color

0.1.1 #

  • Updated file names to comply with Dart naming standards (only letters, underscores, etc.)

0.1.0 #

  • Initial Release

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_widget_gallery: ^0.1.2+1

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:flutter_widget_gallery/gallery/gallery.dart';
import 'package:flutter_widget_gallery/gallery/widgets/thumbnail_item.dart';
import 'package:flutter_widget_gallery/gallery/widgets/thumbnails_carousel.dart';
import 'package:flutter_widget_gallery/gallery/widgets/thumbnails_drawer.dart';
import 'package:flutter_widget_gallery/gallery/widgets/viewer.dart';
import 'package:flutter_widget_gallery/gallery/widgets/viewer_child.dart';
import 'package:flutter_widget_gallery/gallery/widgets/widgets.dart';
import 'package:flutter_widget_gallery/main.dart';
  
Version Uploaded Documentation Archive
0.1.2+1 Jul 27, 2018 Go to the documentation of flutter_widget_gallery 0.1.2+1 Download flutter_widget_gallery 0.1.2+1 archive
0.1.2 Jul 23, 2018 Go to the documentation of flutter_widget_gallery 0.1.2 Download flutter_widget_gallery 0.1.2 archive
0.1.1 Jul 23, 2018 Go to the documentation of flutter_widget_gallery 0.1.1 Download flutter_widget_gallery 0.1.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
62
Health:
Code health derived from static analysis. [more]
74
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
67
Learn more about scoring.

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

  • Dart: 2.1.0
  • pana: 0.12.13
  • Flutter: 1.2.0

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health issues and suggestions

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

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

line 40 col 32: The constructor 'List.generate' does not have type parameters.

Fix lib/gallery/gallery.dart. (-1 points)

Analysis of lib/gallery/gallery.dart reported 2 hints:

line 65 col 74: Avoid using unnecessary statements.

line 70 col 19: Avoid using unnecessary statements.

Fix lib/gallery/widgets/thumbnails_drawer.dart. (-0.50 points)

Analysis of lib/gallery/widgets/thumbnails_drawer.dart reported 1 hint:

line 49 col 17: Avoid using unnecessary statements.

Fix lib/gallery/widgets/viewer.dart. (-0.50 points)

Analysis of lib/gallery/widgets/viewer.dart reported 1 hint:

line 71 col 17: Avoid using unnecessary statements.

Format lib/gallery/widgets/widgets.dart.

Run flutter format to format lib/gallery/widgets/widgets.dart.

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and flutter_widget_gallery.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.20.1 <3.0.0
cupertino_icons ^0.1.2 0.1.2
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test