カテゴリー・パッケージ・リポジトリを検索

パッケージ詳細v1.1.0

design_grid

デザイナーの意図したとおりにデザインを実装します。クラシックなレスポンシブデザイングリッドアプローチを使用するか、Material Designレイアウトに進みます。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
71
いいね数
36
Pub ポイント
160

パッケージをインストール

flutter pub add design_grid

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Design Grid は、デザイナーの意図通りにデザインを正確に実装するのを支援する Flutter パッケージです。従来のレスポンシブグリッドレイアウトと Material Design のレイアウトシステムの両方をサポートしており、UI の構築において柔軟性を提供します。直感的な API を用いることで、プラットフォーム間での配置、余白、応答性の挙動を簡単に扱えます。デザインマックアップと最終的なアプリインターフェースの間に視覚的一貫性を保ちたいチームに最適です。このパッケージはすべての主要な Flutter プラットフォームと互換性があり、クロスプラットフォームでの信頼性を確保しています。

用途

  • Figma や Sketch からのピクセル単位の正確なデザインの実装
  • 複数の画面サイズ向けに応答性のあるレイアウトを構築する
  • カスタムUIにMaterial Designガイドラインを統合する
  • ウィジェット間で一貫した余白と配置を作成する
  • マルチプラットフォームアプリにおけるデザインの忠実度を確保する

主な機能

  • クラシックなレスポンシブグリッドをサポート
  • 組み込みの Material Design レイアウトサポート
  • クロスプラットフォーム互換性
  • 柔軟なスペースと配置ツール
  • 既存のFlutterプロジェクトとの簡単な統合

適している対象

  • デザイナーと密接に連携するフロントエンド開発者
  • デザインの正確性を重視するチーム
  • デバイス間で一貫したUIを必要とするプロジェクト
  • Material Design の原則を使用する開発者
  • 複数のプラットフォームをターゲットにするアプリ

注意事項

  • グリッドシステムの理解が必要です
  • 複雑なレイアウトには追加のスタイリングが必要になる場合があります
  • デザインシステムのドキュメントと併用するのが最適です
  • 完全なUIフレームワークではない—既存のウィジェットを補完する
  • グリッド構造を超えるカスタマイズは限られている

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Build Status

Implement designs just like in Figma. Arrange your widgets in a grid and make your designer happy.

Design Grid streamlines your workflow and saves time. Easily configure multiple devices and screen sizes while reducing boilerplate code. Its user-friendly design makes integration effortless, allowing you to focus on your project's core.

The classic use-case of implementing a colum-based design. Use ResponsiveDesignGrid to implement a bootstrap-like design system where every element has a different column-span based on breakpoints.

Need to implement a design based on the strict rules of Material Layout? Use the MaterialDesignGrid to get an exact implementation of the Material Design Layout guide.

🔗 Table of Contents

✨ Features

Responsive Design Grid

Implement a column-based design with different column-spans for every breakpoint. Responsive design grid widgets can be indefinitely nested. Create small and clean widgets that use ResponsiveDesignGrid for layout. They will fit, no matter how deeply nested you use them.

You can customize:

  • Breakpoints
  • Column-spacing
  • Row-spacing
  • Grid-padding
  • Amount of columns

Material Design Grid

Implement a design based on the Material Design guidelines. Material Design Grid is not meant to be used nested.

You can customize:

  • Breakpoints
  • Column-spacing
  • Row-spacing
  • Grid-padding
  • Amount of columns per breakpoint

🎉 Getting started

Decide whether you need to use the ResponsiveDesignGrid or the MaterialDesignGrid. Speak with your designer to build a common understanding.

🏗️ Usage

Responsive Design Grid

ResponsiveDesignGridConfig is required only once in your app, it provides the ResponsiveDesignGridTheme. You can however always add an extra ResponsiveDesignGridTheme widget if you really need to. Beware, that this is not recommended.

You can nest design grids indefinitely. To keep performance high, make sure to nest them directly in a ResponsiveDesignGridItem. If you get any errors, you might have to pass the parameter shouldCalculateLayout: true to the ResponsiveDesignGrid widget. This might happen most likely when the design grid does not get the full width of the app, or if you nested it inside another ResponsiveDesignGridItem and it doesn't get the full width there.

ResponsiveDesignGridRow widget will wrap its children, your rows should have as little children as possible. Avoid large Rows since this will impact performance.

Basic Usage
@override
Widget build(BuildContext context){
    return ResponsiveDesignGridConfig(
        child: ResponsiveDesignGrid(
            children: [
                ResponsiveDesignGridRow(
                    children: [
                        ResponsiveDesignGridItem(
                            columns: ResponsiveDesignGridColumns(
                                small: 12,
                                medium: 10,
                                large: 8,
                                extraLarge: 6,
                            ),
                            child: Placeholder(),
                        ),
                    ],
                )
            ],
        ),
    );
}
Adjusting Breakpoints

To change the default breakpoints values, you can use the breakpoints property in ResponsiveDesignGridConfig constructor which takes an instance of ResponsiveDesignGridBreakpoints class.

@override
Widget build(BuildContext context){
    return ResponsiveDesignGridConfig(
            breakpoints: const ResponsiveDesignGridBreakpoints(
            small: 375,
            medium: 768,
            large: 1280,
            extraLarge: 1920,
        ),
        child: ResponsiveDesignGrid(
            children: [
                ResponsiveDesignGridRow(
                    children: [
                        ResponsiveDesignGridItem(
                            columns: ResponsiveDesignGridColumns(
                                small: 12,
                                medium: 10,
                                large: 8,
                                extraLarge: 6,
                            ),
                            child: Placeholder(),
                        ),
                    ],
                )
            ],
        ),
    );
}
Customizing the grid

To change the amount of columns, the column spacing, the row spacing or the grid padding, you can use the theme property in ResponsiveDesignGridConfig constructor which takes an instance of ResponsiveDesignGridThemeData class.

@override
Widget build(BuildContext context){
    return ResponsiveDesignGridConfig(
        theme: ResponsiveDesignGridThemeData(
            columns: 12,
            columnSpacing: 16.0,
            rowSpacing: 16.0,
            gridPadding:16.0,
        ),
        child: ResponsiveDesignGrid(
            children: [
                ResponsiveDesignGridRow(
                    children: [
                        ResponsiveDesignGridItem(
                            columns: ResponsiveDesignGridColumns(
                                small: 12,
                                medium: 10,
                                large: 8,
                                extraLarge: 6,
                            ),
                            child: Placeholder(),
                        ),
                    ],
                )
            ],
        ),
    );
}
Material Design Grid

MaterialDesignGridTheme is required only once in your app, above the MaterialDesignGrid widget.

MaterialDesignGrid is not meant to be used nested due to material specifications.

MaterialDesignGridRow widget will wrap its children, you should size your rows as small as possible. Avoid large Rows since this will impact performance.

@override
Widget build(BuildContext context) {
    return MaterialDesignGridTheme(
        child: MaterialDesignGrid(
            children: [
                MaterialDesignGridRow(
                    children: [
                        MaterialDesignGridItem(
                            columns: 4,
                            child: Placeholder(),
                        ),
                    ],
                )
            ],
        ),
    );
}

📚 Additional information

All classes and exposed properties are well documented. If you find the documentation to be lacking, please create an issue 😊

Implementing a custom design grid approach

The base widgets used for both the ResponsiveDesignGrid as well as the MaterialDesignGrid can be found in lib/src/widgets. You can extend those to create your super-fancy very own custom design grid implementation 🥳.

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。