v1.0.0
masonry_grid
Flutter 메이슨리 그리드 레이아웃을 사용하여 메이슨리, 겹쳐진 항목 레이아웃을 만듭니다.
45좋아요 71530일 다운로드130Pub 점수
AndroidiOSWebmacOSWindowsLinux
Flutter 메이슨리 그리드 구현
아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
Flutter Masonry Grid layout to create masonry, staggered items layout.
Install the package, add the dependencies to your pubspec.yaml
dependencies:
// ... the rest of your dependencies
masonry_grid: [version]
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")),
)))
],
));
}
}
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
의존성 목록 3 개
{"sdk":"flutter"}{"sdk":"flutter"}^1.10.0사용 목적에 따라 검색하고 개발 활동을 비교한 뒤 원본 저장소에서 요구 사항을 확인하세요.
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗