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

套件詳情v0.0.9

equal_space

一個用於建立均勻間距列和欄的Flutter套件。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
41
喜歡數
11
Pub 分數
150

安裝套件

flutter pub add equal_space

套件介紹

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

Equal_Space 是一個 Flutter 套件,旨在簡化均勻間距的行列創建。它確保佈局中子項之間的間距一致,無需複雜的計算或自訂組件。適用於需要統一對齊的 UI,支援所有主要平台,包括 Android、iOS、Web、macOS、Windows 和 Linux。該套件可透過簡單的 pub add 命令無縫整合到現有的 Flutter 專案中。它增強了佈局的一致性,並減少排列元素時所需的重複程式碼。

適用情境

  • 建立統一的網格版面
  • 設計響應式表單
  • 構建一致的卡片排列
  • 對齊圖示或按鈕以保持均勻
  • 實現對稱的UI組件

主要特色

  • 自動均勻間距
  • 支援行與列
  • 跨平台相容性
  • 所需的設定最少
  • 無額外依賴

適合對象

  • 尋求佈局簡潔的UI開發人員
  • 需要一致間距的項目
  • 初學者學習Flutter佈局
  • 具有重複視覺模式的應用程式
  • 響應式設計實現

使用建議

  • 超出間距之外的自訂功能有限
  • 不適合複雜的動態佈局
  • 可能需要在嵌套結構中添加額外的約束
  • 不支援每個子項的可變間距
  • 最適合靜態或可預測的佈局

原始 README

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

Equal Space

Learn More

About

Equal Space is a Flutter package that allows you stop using SizedBox for spacing between widgets. it simplifies the process of creating evenly spaced rows and columns in your Flutter applications. This package provides custom widgets, SpacedRow and SpacedColumn, which make it easy to manage spacing and alignment of child widgets.

Features

  • Customizable Spacing: Easily adjust the space between child widgets.
  • Flexible Alignment: Support for main axis and cross axis alignment.
  • Simplified Code: Reduces boilerplate code for spacing in rows and columns.

Learn More

SpacedColumn Example
class MyWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return SpacedColumn(
      space: 26.0,
      mainAxisAlignment: MainAxisAlignment.center,
      mainAxisSize: MainAxisSize.min,
      crossAxisAlignment: CrossAxisAlignment.end,
      textDirection: TextDirection.rtl,
      verticalDirection: VerticalDirection.down,
      textBaseline: TextBaseline.alphabetic,
      children: [
        Container(width: 50, height: 50, color: Colors.red),
        Container(width: 50, height: 50, color: Colors.green),
        Container(width: 50, height: 50, color: Colors.blue),
      ],
    );
  }
}
SpacedRow Example
class MyWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return SpacedRow(
       space: 26.0,
       mainAxisAlignment: MainAxisAlignment.center,
       mainAxisSize: MainAxisSize.min,
       crossAxisAlignment: CrossAxisAlignment.end,
       textDirection: TextDirection.rtl,
       verticalDirection: VerticalDirection.down,
       textBaseline: TextBaseline.alphabetic,
       children: [
         Container(width: 50, height: 50, color: Colors.red),
         Container(width: 50, height: 50, color: Colors.green),
         Container(width: 50, height: 50, color: Colors.blue),
       ],
    );
  }
}
Installation
flutter pub add equal_space
import 'package:equal_space/equal_space.dart';

Learn More

Explanation
  • Overview: Stop using SizedBox for adding up space in your widgets.
  • Features: You can user mainAxis * crossAxisAligments with one more propery space.
  • Benigit: Examples SpacedRow and SpacedColumn widgets shows how effective this package is.
  • Example: Instructions to run the example app.
  • Contributions: Feel free to fork the repo.
  • License: MIT License.
  • Connect with Us: Click below to visit my YouTube channel & Github.

Learn More Learn More

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。