flutter_staggered_grid_view 0.1.4

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

flutter_staggered_grid_view

A Flutter staggered grid view which supports multiple columns with rows of varying sizes.

Pub

Screenshot

Features

  • Configurable cross-axis count or max cross-axis extent like the GridView
  • Tiles can have a fixed main-axis extent, or a multiple of the cell's length.
  • Configurable main-axis and cross-axis margins between tiles.
  • SliverStaggeredGrid for using in a CustomScrollView.
  • Staggered and Spannable grid layouts.

Screenshot Screenshot

Getting started

In the pubspec.yaml of your flutter project, add the following dependency:

dependencies:
  ...
  flutter_staggered_grid_view: "^0.1.4"

In your library add the following import:

import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';

For help getting started with Flutter, view the online documentation.

Example

Screenshot_Example

new StaggeredGridView.countBuilder(
  crossAxisCount: 4,
  itemCount: 8,
  itemBuilder: (BuildContext context, int index) => new Container(
      color: Colors.green,
      child: new Center(
        child: new CircleAvatar(
          backgroundColor: Colors.white,
          child: new Text('$index'),
        ),
      )),
  staggeredTileBuilder: (int index) =>
      new StaggeredTile.count(2, index.isEven ? 2 : 1),
  mainAxisSpacing: 4.0,
  crossAxisSpacing: 4.0,
)

You can find more examples in the Example project.

Constructors

The StaggeredGridView follow the same constructors convention than the GridView.
There are two more constructors: countBuilder and extentBuilder. These constructors allow you to define a builder for the layout and a builder for the children.

Changelog

Please see the Changelog page to know what's recently changed.

Contributions

Feel free to contribute to this project.

If you find a bug or want a feature, but don't know how to fix/implement it, please fill an issue.
If you fixed a bug or implemented a new feature, please send a pull request.

0.1.4

  • Add countBuilder and extendBuilder constructors to SliverStaggeredGrid

0.1.3

  • Remove Flutter SDK constraint

0.1.2

  • Remove update Flutter SDK constraint

0.1.1

  • Fix images in readme
  • Add dynamic resizing demo

0.1.0

  • Initial Open Source release

example/lib/main.dart

import 'package:flutter/material.dart';

import 'routes.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'StaggeredGridView Demo',
      theme: new ThemeData(
        primarySwatch: Colors.blue,
      ),
      routes: routes,
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_staggered_grid_view: "^0.1.4"

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_staggered_grid_view/flutter_staggered_grid_view.dart';
  
Version Uploaded Documentation Archive
0.1.4 May 10, 2018 Go to the documentation of flutter_staggered_grid_view 0.1.4 Download flutter_staggered_grid_view 0.1.4 archive
0.1.3 Apr 20, 2018 Go to the documentation of flutter_staggered_grid_view 0.1.3 Download flutter_staggered_grid_view 0.1.3 archive
0.1.2 Mar 12, 2018 Go to the documentation of flutter_staggered_grid_view 0.1.2 Download flutter_staggered_grid_view 0.1.2 archive
0.1.1 Feb 21, 2018 Go to the documentation of flutter_staggered_grid_view 0.1.1 Download flutter_staggered_grid_view 0.1.1 archive
0.1.0 Feb 19, 2018 Go to the documentation of flutter_staggered_grid_view 0.1.0 Download flutter_staggered_grid_view 0.1.0 archive

Analysis

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

  • Dart: 2.0.0-dev.54.0
  • pana: 0.11.1
  • Flutter: 0.4.4

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
90 / 100
Health:
Code health derived from static analysis. [more]
100 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
95
Learn more about scoring.

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Suggestions

  • The description is too short.

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

  • Package is pre-v1 release.

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

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 4 hints.

    Run flutter format to format lib/src/sliver_staggered_grid.dart.

    Run flutter format to format lib/src/staggered_grid_view.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.19.0 <2.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.6 1.14.9
meta 1.1.5
sky_engine 0.0.99
typed_data 1.1.5
vector_math 2.0.6 2.0.7
Dev dependencies
flutter_test
test ^0.12.0