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

套件詳情v1.0.0

flextras

一組具有額外功能的 Flex 小部件(Columns 和 Rows)。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
9130
喜歡數
143
Pub 分數
150

安裝套件

flutter pub add flextras

套件介紹

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

Flextras 是一個 Flutter 套件,透過額外功能擴展標準 Column 和 Row 小部件的功能,以實現更靈活、更強大的版面管理。它提供對齊、間距和響應式行為的增強控制,讓建立複雜且可適應的 UI 更加容易。專為尋求超越內建 Flex 小部件自訂能力的開發者設計,Flextras 可無縫整合至現有的 Flutter 專案中。該套件支援所有主要平台,包括行動裝置、網頁和桌面端,確保在各種裝置上行為一致。

適用情境

  • 建立響應式版面
  • 使用動態間距構建複雜的使用者介面
  • 提高對齊精度
  • 為多種螢幕尺寸設計可適應的介面
  • 簡化重複的佈局模式

主要特色

  • 擴展對齊選項
  • 動態間距控制
  • 響應式版面輔助工具
  • 跨平台一致性
  • 與現有 Flutter 程式碼的輕鬆整合

適合對象

  • Flutter 開發人員構建複雜佈局
  • 優先考慮跨平台UI一致性
  • 需要對小部件排列進行細粒度控制的項目

使用建議

  • 需要熟悉 Flutter 的佈局系統
  • 可能為簡單佈局增加開銷
  • 最適合具有進階版面需求的專案

原始 README

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

tests

flextras

A collection of Columns and Rows with extra functionality:

  • PaddedColumn / PaddedRow - Wraps a column/row in padding
  • SeparatedColumn / SeparatedRow - Insert any widget between each child
  • ExpandedScrollingColumn / ExpandedScrollingRow - Allow a column to hold Expandable children, while still scrolling if it needs to.

🔨 Installation

dependencies:
  flextras: ^0.0.1
⚙ Import
import 'package:flextras/flextras.dart';

🕹️ Usage

PaddedContainer and PaddedRow

A simple combination of Padding and Column/Row, as is often needed. Very simple, but saves a few lines in your tree:

return PaddedColumn(
    padding: EdgeInsets.all(20),
    children: [ ... ]
)
SeparatedColumn and SeparatedRow

Often you want to place a divider between the elements of a Column or Row. Use the separatorBuilder method to do so easily:

return SeparatedColumn(
    // 10px gap between each element
    separatorBuilder: () => SizedBox(height: 10),
    children: [ ... ]
)
ExpandedScrollingColumn and ExpandedScrollingRow

Solves a common use case where you want to have some expanding content, that can also begin scrolling if it runs out of room.

Normally, if you do something like this it will throw a layout error:

SingleChildScrollView(
    child: Column(
        children: [
            Expanded(child: ...) // This tries to expand to infinity :(
        ]
    )
)

ExpandedScrollingColumn fixes this by using the content's natural height, or the height of the parent view, whichever is greater.

// This will expand vertically to fill the parent, but begin scrolling when it has to
ExpandedScrollingColumn(
    children: [
        Expanded(child: Container(height: 400)),
    ]
)

🐞 Bugs/Requests

If you encounter any problems please open an issue. If you feel the library is missing a feature, please raise a ticket on Github and we'll look into it. Pull request are welcome.

📃 License

MIT License

所屬分類

原始碼儲存庫

使用此套件的專案