다양한 사용자 정의 가능한 그리드 레이아웃(스태거드, 메이슨리, 퀼트, 웨븐 디자인 등)을 제공하는 플러터 패키지입니다. 표준 GridView 기능을 확장하여 비정형 아이템 크기와 동적 배열을 지원하며, 사진 갤러리나 제품 목록과 같은 시각적으로 매력적인 콘텐츠 표시에 이상적입니다. 이 패키지는 가볍고 잘 문서화되어 있으며 모든 주요 플랫폼과 호환됩니다.
사용 사례
사진 갤러리 인터페이스
제품 목록 레이아웃
동적 콘텐츠 격자
크리에이티브한 UI 디자인
소셜 미디어 피드 레이아웃
주요 기능
스테거드 및 메이슨리 레이아웃을 지원합니다
사용자 정의 가능한 항목 치수
스무스 스크롤 성능
크로스 플랫폼 호환성
유연한 그리드 구성
내장 애니메이션 지원
적합한 대상
시각적으로 부담이 큰 앱을 개발하는 개발자
독특한 그리드 패턴을 찾는 디자이너
반응형 콘텐츠 레이아웃을 요구하는 앱
변동 크기의 항목을 가진 프로젝트
UI 마무리에 중점을 두는 팀
고려 사항
작은 화면에서 정밀한 레이아웃 테스트가 필요할 수 있습니다
매우 큰 데이터 세트에서는 성능이 저하될 수 있습니다
제한된 내장 항목 간격 제어
간단한 균일 격자에 적합하지 않습니다
사용자 정의 레이아웃 원칙에 대한 이해가 필요합니다
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
flutter_staggered_grid_view
Provides a collection of Flutter grids layouts.
Getting started
In the pubspec.yaml of your flutter project, add the following dependency:
For help getting started with Flutter, view the online documentation.
Layouts
This package contains various grid layouts. In the following section, you'll discover each one of them.
The explanation of the layout will always considered a top-to-bottom and left-to-right directions to simplify the description. However it is possible to change these directions in the code.
Staggered
This layout is intended for a small number of items.
I didn't find, for the moment, a performant algorithm which would work in a Sliver context, that's why this is not a GridView and therefore there are no SliverStaggeredGrid.
Grid properties
Evenly divided in n columns
Small number of items
Not scrollable
Tile properties
Must occupy 1 to n columns
Placement algorithm
Top-most and then left-most
Example
Below you'll find the code to create this grid layout:
This layout facilitates the browsing of uncropped peer content. Container heights are sized based on the widget size.
This is a complete separate grid and not a SliverGridDelegate for performance reasons. The SliverGrid is great but it needs to have a layout which does not depends on the size of its children. Otherwise we have to compute the size to all children before the end of the cache, which is really not performant for a masonry layout.
Grid properties
Evenly divided in n columns
Tile properties
Must occupy 1 column only
Placement algorithm
Top-most and then left-most
Example
Below you'll find the code to create this grid layout:
This layout is also called CSS Grid. This is a common grid layout on the web, where each item within a track has the maximum cross axis extent of its siblings.
Grid properties
Evenly divided in n columns
The rows can have differents heights
Tile properties
Must occupy 1 column only
Each tile has the same height as the tallest one of the row.
Placement algorithm
Top-most and then left-most
Example
Below you'll find the code to create this grid layout:
I'm working on my packages on my free-time, but I don't have as much time as I would. If this package or any other package I created is helping you, please consider to sponsor me so that I can take time to read the issues, fix bugs, merge pull requests and add features to these packages.
Sponsors
I want to thank Tommy for sponsoring this package. Thanks to him, I took the time to investigate in the previous performance issues and refactor this library to make it how is it today.
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 feature, please send a pull request.