flutter_widget_gallery 0.1.2+1

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 81

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]
73
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
81
Learn more about scoring.

We analyzed this package on Oct 10, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.4
  • Flutter: 0.9.5

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/gallery/widgets/widgets.dart.

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

Maintenance suggestions

The description is too short. (-20 points)

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use flutter_widget_gallery.dart.

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
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test