搜索插件、代码仓与 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

所属分类

源码仓库

使用此插件的项目

暂无相关数据。