Package selection guidance compiled from public package information, community data, and project usage.
The spaces package provides globally defined spacing constants to ensure consistent and responsive spacing throughout Flutter applications. By offering predefined, scalable values for margins, padding, and gaps, it simplifies UI development across different screen sizes and platforms. The package is designed to be used with responsive layouts, enabling developers to maintain visual harmony without hardcoding values. It supports all major Flutter platforms, making it ideal for cross-platform projects that require uniform spacing behavior.
Use cases
Building responsive layouts
Maintaining consistent UI spacing
Cross-platform app development
Simplifying margin and padding management
Creating scalable design systems
Key features
Predefined spacing constants
Responsive spacing support
Platform-agnostic design
Easy integration via pub
Clean, reusable spacing values
Suitable for
Design system implementation
Cross-platform Flutter apps
UI consistency-focused teams
Developers prioritizing maintainability
Projects requiring scalable spacing
Considerations
Requires adherence to predefined spacing scale
Limited customization of spacing values
Best suited for projects using a consistent design language
Not intended for highly dynamic or variable spacing needs
Depends on proper configuration in theme or app structure
Original README
Original README snapshot from the linked source repository. Visit the repository for the latest content.
Spaces
Defining global spacing constants for building consistent and responsive apps.
A Spacing widget should declare a global spacing configuration for your application.
returnMaterialApp(
builder: (context, child) => Spacing.fixed(
data: SpacingData.generate(10.0), // This generates a set of spacing constants for your apps, from a base space of `10.0`.
child: child,
),
/// ...
)
Generate
By calling the Spacing.generate constructor, a set of constants are automatically generated from a single base value.
The generated values are :
extraSmall : value * 0.2
small : value * 0.4
semiSmall : value * 0.6
normal : value
semiBig : value * 1.5
big : value * 2.5
extraBig : value * 5.0
SpacingData.generate(10.0)
From spaces
If you want to define the various spacing values, you can use the