FLUTTER ECOSYSTEM

ali2236/smart_grid_view

사용 가능한 수평 크기에 따라 교차 축 자식 수를 변경하는 반응형 그리드 뷰입니다.

smart_grid_view 프로젝트 이미지
Stars
3
Forks
2
최근 푸시(UTC)
2020. 5. 21.
프로젝트 상태
활성
Ali Qanbari GitHub avatar
GITHUB User

Ali Qanbari ↗

Flutter Developer/Software Engineer

Iran, Bushehr, Bandar Bushehr공식 웹사이트 ↗
언어DartHTMLSwiftKotlinObjective-C

기술 주제

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 1 개
  • flutter{"sdk":"flutter"}

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

README 펼치기 / 접기

smart_grid_view

A responsive grid view that changes it's cross axis child count based on the available horizontal size.

This widget is great for creating responsive designs as the sized of tiles stays about the same across different screen sizes.

How does it work

Using the width of tiles, SmartGridview will calculate the crossAxisCount for the underlying GridView with maxWidth ~/ tileWidth.

The tileHeight is used with tileWidth to calculate gridChildRatio.

Example

class MyApp extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: Text('Example')),
        body: SmartGridView(
          tileWidth: 128,
          tileHeight: 168,
          children: List.generate(80, (index) => Card(
            child: GridTile(
              child: Text('tile #$index'),
            ),
          )),
        ),
      ),
    );
  }
}
Result

https://raw.githubusercontent.com/ali2236/smart_grid_view/HEAD/pictures/1.jpg https://raw.githubusercontent.com/ali2236/smart_grid_view/HEAD/pictures/2.jpg