FLUTTER ECOSYSTEM

ali2236/smart_grid_view

利用可能な水平サイズに基づいて、クロス軸の子要素数を変更するレスポンシブグリッドビュー。

smart_grid_view のプロジェクト画像
Stars
3
Forks
2
最終プッシュ(UTC)
2020/05/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