Search packages, repositories and app categories

Package detailsv1.0.0

masonry_grid

Flutter Masonry Grid layout to create masonry, staggered items layout.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
715
Likes
45
Pub points
130

Install package

flutter pub add masonry_grid

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

MasonryGrid is a Flutter package that enables developers to create masonry or staggered grid layouts with ease. It allows items of varying heights to be arranged in a visually appealing, non-uniform grid pattern, ideal for photo galleries, product listings, and content feeds. The layout dynamically adjusts to different screen sizes and supports smooth scrolling across all platforms. Built with performance and flexibility in mind, it integrates seamlessly into existing Flutter projects.

Use cases

  • Photo galleries
  • Product listings
  • Content feeds
  • Dynamic item layouts
  • Responsive design

Key features

  • Staggered item arrangement
  • Variable item heights
  • Cross-platform support
  • Smooth scrolling
  • Easy integration

Suitable for

  • Developers building visual content apps
  • Projects requiring dynamic grids
  • Apps targeting multiple platforms
  • Designers seeking flexible layouts

Considerations

  • May require custom height calculations
  • Performance depends on item count
  • Limited built-in customization options
  • Best suited for static or predictable data sets

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

masonry_grid

Flutter Masonry Grid layout to create masonry, staggered items layout.

Getting Started

Install the package, add the dependencies to your pubspec.yaml

dependencies:
  // ... the rest of your dependencies
  masonry_grid: [version]

Usage

Import and use the widget to create your grid

import 'package:masonry_grid/masonry_grid.dart';

class YourPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body: CustomScrollView(
      slivers: [
        SliverToBoxAdapter(
            child: MasonryGrid(
                column: 2,
                children: List.generate(10, (i) =>
                      SizedBox(width: 100, height: 100, child: Text("hello")),
                )))
      ],
    ));
  }
}

Properties

int column  // number of column rendered
List<Widget> children // children widgets that's going to be rendered.
double mainAxisSpacing  // amount of vertical spacing between items
double crossAxisSpacing // amount of horizontal spacing between columns
bool staggered  //  stagger layout to override children order to paint items on the lowest column first
CrossAxisAlignment crossAxisAlignment // cross axis alignment inside of each column

Categories

Source repository

Projects using this package

No data available yet.