flutter_masonry_view 0.0.1 copy "flutter_masonry_view: ^0.0.1" to clipboard
flutter_masonry_view: ^0.0.1 copied to clipboard

A Flutter Masonry Grid Layout.

flutter_masonry_view #

A Flutter Masonry Grid Layout. Simple to use and easy to understand

Getting started #

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

dependencies:
  ...
  flutter_masonry_view: <latest_version>

In your library add the following import:

import 'package:flutter_masonry_view/flutter_masonry_view.dart';

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

Masonry #

This layout facilitates the browsing of uncropped peer content. Container heights are sized based on the widget size.

Example #

Masonry example

class Home extends StatelessWidget {
  Home({Key? key}) : super(key: key);

  final _items = [
    'assets/images/1.jpeg',
    'assets/images/2.jpeg',
    'assets/images/3.jpeg',
    'assets/images/4.jpeg',
    'assets/images/5.jpeg',
    'assets/images/6.jpeg',
    'assets/images/7.jpeg',
    'assets/images/8.jpeg',
    'assets/images/9.jpg',
    'assets/images/10.jpg',
  ];

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Flutter Masonry View'),
      ),
      body: SingleChildScrollView(
        child: MasonryView(
          listOfItem: _items,
          numberOfColumn: 2,
          itemBuilder: (item) {
            return Image.asset(item);
          },
        ),
      ),
    );
  }
}
42
likes
140
points
523
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter Masonry Grid Layout.

Repository (GitHub)
View/report issues

Documentation

API reference

License

GPL-3.0 (license)

Dependencies

flutter

More

Packages that depend on flutter_masonry_view