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

flutter_wall_layout 封面
套件詳情v2.1.2

flutter_wall_layout

一個佈局小部件,以垂直或水平清單形式顯示一組磚塊(具有不同形狀的小部件),就像一堵牆一樣……

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
2570
喜歡數
133
Pub 分數
150

安裝套件

flutter pub add flutter_wall_layout

套件介紹

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

一個 Flutter 套件,提供一個靈活的佈局小部件,用於在垂直或水平列表中排列磚塊(形狀各異的小部件),類似於一堵牆。它支援動態大小和定位,非常適合建立具有不規則形狀元素的視覺吸引力網格。該佈局可適應不同螢幕尺寸和方向,確保跨平台的響應式設計。特別適用於相片圖庫、儀表板和需要非均勻佈局的創意介面。

適用情境

  • 帶有混合長寬比的照片畫廊
  • 儀表板小部件具有不同尺寸
  • 具有不規則形狀的創意UI佈局
  • 響應式網格在多個平台顯示
  • 互動式牆狀介面

主要特色

  • 支援不同形狀與大小的磚塊
  • 垂直與水平方向選項
  • 響應式與自適應版面
  • 跨平台相容性
  • 與現有 Flutter widget 的輕鬆整合

適合對象

  • 尋求視覺多樣性的設計師
  • 開發動態網格的開發者
  • 需要非均勻佈局的應用程式
  • 針對多個平台的專案
  • 具有複雜排列的UI密集型應用

使用建議

  • 效能可能會隨著磚塊數量增加而有所變化
  • 需要仔細處理磚塊大小限制
  • 有限的內建動畫
  • 最適合靜態或低動態內容
  • 可能需要自訂邏輯來處理複雜互動

原始 README

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

flutter_wall_layout - Layout child having different shape into a vertical or horizontal list

This library provides a unique widget, WallLayout, rendering into a list children having different shapes.

There is two main classes: WallLayout and Stone.

  • A wall is composed by a set of stones, arranged in a certain way.
  • A stone is a component defining its shape by a width and a height.
Wall Layout Widget

This component has been inspired by the ListView widget, in which you can choose scroll direction and the way. Added to that, you can also define how many rows or column have the wall, if you want to create a responsive design.

WallLayout(
  stones: _buildStonesList(),
  layersCount: 3,
  scrollDirection: Axis.vertical,
  reverse: false,
);
Wall Layout Widget Properties
Parameter Description Default value
stones List of Stone widgets, representing wall layout's children. -
layersCount Define the number of layers the wall have. Must be higher or equal to 2. When direction is Axis.vertical, it defines the number of columns the wall has. When direction is Axis.horizontal, it defines the number of rows. -
wallBuilder Define how the wall is built: where each stone is positioned within the wall.The wall builder is allowed to use less stones than provided, and can create new stones (see ./example for more details). WallBuilder.standard()
stonePadding Padding between stones. 16.0
primaryAxisStoneSize Optional. If specified, indicates the exact size of each stone in the direction of the primary scroll axis. If not specified, each stone will be exactly square. -
scrollController Same as [ListView.scrollController]: "control the position to which this scroll view is scrolled". -
physics Same as [ListView.physics]: "How the scroll view should respond to user input". -
restorationId Same as [ListView.restorationId]: used "to save and restore the scroll offset of the scrollable". -
dragStartBehavior Same as [ListView.dragStartBehavior]: "Determines the way that drag start behavior is handled". DragStartBehavior.start
clipBehavior Same as [ListView.clipBehavior]: "ways to clip a widget's content". Clip.hardEdge
primary Same as [ListView.primary]: "Whether this is the primary scroll view associated with the parent [PrimaryScrollController]" false
scrollDirection Same as [ListView.scrollDirection]: "axis along which the scroll view scrolls". Axis.vertical
reverse Same as [ListView.reverse property]: "whether the scroll view scrolls in the reading direction". false
Stone Widget

A Stone Widget is a widget proxy defining stone's size (width and height). It's rendered object is optimized thanks to it's id property.

Stone(
    id: 7,
    width: 2,
    height: 2,
    child: Container(
      color: Colors.red,
      child: Center(child: Text("2x2")),
    ),
);
Stone Widget Properties
Parameter Description Default value
width Stone width (relative to the number of wall divisions). Must be higher or equal to 1. -
height Stone height (relative to the number of wall divisions). Must be higher or equal to 1. -
id Proxy layout identifier: must be unique. -
child Widget to render, where its size will be constrained by the stone width and height. -

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。