搜尋套件、儲存庫與 APP 分類

wolt_responsive_layout_grid 封面
套件詳情v0.0.3

wolt_responsive_layout_grid

Wolt 響應式佈局網格庫幫助您建立動態、自適應的網格佈局,能順暢調整至各種螢幕尺寸。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
5640
喜歡數
131
Pub 分數
150

安裝套件

flutter pub add wolt_responsive_layout_grid

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

Wolt Responsive Layout Grid 是一個 Flutter 套件,旨在簡化跨多個平台自動適應不同螢幕尺寸的動態自適應網格佈局的建立。它讓開發者能夠建立具有一致間距與對齊方式的響應式使用者介面,確保在 Android、iOS、Web、macOS、Windows 與 Linux 上實現最佳視覺呈現。該程式庫提供直觀的 API,可根據斷點與限制條件定義靈活的網格結構,減少手動佈局管理的工作量。適用於需要流暢響應性的複雜 UI,可提升開發效率,同時維持設計一致性。

適用情境

  • 構建響應式儀表板
  • 建立適應性產品網格
  • 設計跨平台佈局
  • 實現流體卡片排列
  • 開發可擴展的管理面板

主要特色

  • 自動螢幕尺寸適應
  • 靈活的網格定義
  • 基於斷点的佈局更改
  • 跨平台支援
  • 一致的間距和對齊
  • 簡單 API 結合

適合對象

  • 專注於響應式UI開發人員
  • 建構多平台應用的團隊
  • 需要動態網格佈局的項目
  • 具有自適應組件的設計系統
  • 複雜的儀表板或目錄介面

使用建議

  • 需要理解響應式設計原則
  • 可能需要針對高度特定的佈局進行自訂
  • 最佳搭配 Flutter 的佈局組件使用
  • 在非常大的網格中的性能影響
  • 除了基本範例外,文件有限

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

pub package package publisher

WoltResponsiveLayoutGrid

Creating responsive grid layouts in Flutter applications can be a challenging task. Developers often struggle with achieving consistent and adaptive designs across various screen sizes and orientations. With the Wolt Responsive Layout Grid library, building responsive grid layouts becomes much simpler.

Wolt Responsive Layout Grid library introduces the Flutter implementation of Material Design's responsive layout grid. It provides a unified, multi-platform grid system that ensures consistency and visual integrity regardless of the device or operating system being used.

An animated image of the sample app

Features

The Wolt Responsive Layout Grid library offers the following key features:

Responsive Grid Layout: The WoltResponsiveLayoutGrid widget enables the creation of responsive grid layouts that adapt to different screen sizes and orientations.

Material Design Adaptation: The library implements Material Design's responsive layout grid, guaranteeing consistency and adhering to established design principles.

Customizable Spacing: By adjusting the gutter and margin properties of the WoltResponsiveLayoutGrid widget, developers have full control over the spacing, allowing developers to create layouts that match the design requirements.

Screen Width Adaptation: The WoltScreenWidthAdaptiveWidget allows developers to adapt the child widget based on the screen width, dynamically adjusting the layout and content presentation. By providing different child widgets for small and large screens, the WoltScreenWidthAdaptiveWidget automatically switches between them based on the screen width, ensuring a seamless user experience across various devices.

Overlay for Visual Debugging: During development, it's often helpful to have a visual representation of the grid layout to fine-tune and verify its structure. The Wolt Responsive Layout Grid library includes an overlay feature that enables you to visualize the grid layout. This overlay renders colored boxes for each column and gutter, making it easier to debug and ensure proper alignment. The overlay can be enabled or disabled based on debugging needs.

Getting started

To use this plugin, add wolt_responsive_layout_grid as a dependency in your pubspec.yaml file.

Usage

WoltResponsiveLayoutGrid

The WoltResponsiveLayoutGrid widget is the centerpiece of the library. By utilizing a list of WoltColumnSpanCell objects, you can define the content and column spans for each cell. This allows for the grouping of one or more columns to create sections or content within the available space.

WoltResponsiveLayoutGrid(
  isOverlayVisible: true,
  gutter: 16,
  margin: 32,
  columnSpanCells: [
    WoltColumnSpanCell(
      columnCellWidget: Placeholder(color: Colors.blue, strokeWidth: 4),
      columnSpan: 4,
    ),
    WoltColumnSpanCell(
      columnCellWidget: Placeholder(color: Colors.red, strokeWidth: 4),
      columnSpan: 6,
    ),
    WoltColumnSpanCell(
      columnCellWidget: Placeholder(color: Colors.green, strokeWidth: 4),
      columnSpan: 2,
    ),
  ],
)

\

Centered Constructor

WoltResponsiveLayoutGrid widget provides a factory constructor centered that simplifies the creation of centered layouts with a child widget and specified column counts. This constructor takes the following parameters:

child: The child widget to be centered within the grid layout.

centerWidgetColumnCount: The number of columns that the child widget should occupy.

paddedColumnCountPerSide: The number of padded columns to be added on each side of the child widget. These padded columns create empty spaces around the centered widget, resulting in a visually balanced and appealing layout.

WoltResponsiveLayoutGrid.centered(
  centerWidgetColumnCount: 3,
  paddedColumnCountPerSide: 2,
  margin: 32,
  gutter: 16,
  isOverlayVisible: true,
  child: DecoratedBox(
    decoration: BoxDecoration(border: Border.all(color: Colors.black, width: 2)),
    child: Text(
      'Center Widget',
      style: Theme.of(context).textTheme.displayLarge,
      textAlign: TextAlign.center,
    ),
  ),
),
Tablet - Portrait Tablet - Landscape
WoltScreenWidthAdaptiveWidget

The WoltScreenWidthAdaptiveWidget is designed to provide adaptive rendering based on the screen width. It allows developers to define two child widgets: one for small screens and another for large screens. The widget automatically switches between the child widgets based on the screen width, ensuring that the interface adapts seamlessly to different device sizes.


WoltScreenWidthAdaptiveWidget(
  smallScreenWidthChild: Icon(Icons.store, size: 16, color: Colors.black),
  largeScreenWidthChild: Text(isOnline ? 'Online' : 'Offline'),
),

Additional information

To learn more, you can check the following blog posts:

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。