Space

A lightweight Flutter package that provides clean and reusable widgets for adding horizontal and vertical spacing in your UI.
Stop writing SizedBox(height: 20) everywhere โ€” simply use VerticalSpace(20) or HorizontalSpace(20) to keep your widget tree clean and readable.


โœจ Features

  • ๐Ÿš€ Ultra-lightweight (zero dependencies)
  • ๐Ÿ“ Simple vertical & horizontal spacing widgets
  • ๐Ÿงน Cleaner widget tree with meaningful UI structure
  • ๐ŸŽจ Improves readability and consistency across layouts
  • ๐Ÿ’ผ Works with any Flutter widget (Row, Column, ListView, etc.)

๐Ÿ“ฆ Installation

Add this to your pubspec.yaml:

dependencies:
  space: ^1.0.0

Import the package:

import 'package:space/space.dart';

๐Ÿ“˜ Usage

โžค Vertical Space

VerticalSpace(20); // 20px height

โžค Horizontal Space

HorizontalSpace(16); // 16px width

๐Ÿงฑ Examples

Column Example

Column(
  crossAxisAlignment: CrossAxisAlignment.start,
  children: [
    Text("Top Section"),
    VerticalSpace(24),
    Text("Bottom Section"),
  ],
);

Row Example

Row(
  children: [
    Icon(Icons.star),
    HorizontalSpace(12),
    Text("Starred Item"),
  ],
);

๐Ÿ”ง Optional Helper Functions (if included)

h(12); // horizontal 12px
v(20); // vertical 20px

๐Ÿ“‚ Example App

A complete usage example is available inside the /example folder of this package.


๐Ÿงฉ Why Use This Package?

  • No need to create your own SizedBox repeatedly
  • More readable and declarative UI
  • Standardized spacing across your project
  • Extremely small and dependency-free

๐Ÿ“„ License

MIT License


โญ Support This Package

If you like this package:

  • โญ Star it on GitHub
  • ๐Ÿ‘ Like it on pub.dev
  • ๐Ÿ”„ Share it with other Flutter developers

Libraries

empty_space