apptomate_custom_row 0.0.1 copy "apptomate_custom_row: ^0.0.1" to clipboard
apptomate_custom_row: ^0.0.1 copied to clipboard

A customizable Flutter Row widget with built-in spacing between children and additional layout options.

CustomRow Widget #

A customizable Flutter Row widget with built-in spacing between children and additional layout options.

Features #

  • Consistent spacing between child widgets
  • Optional outer spacing (padding-like behavior)
  • Full control over main and cross axis alignment
  • Runtime validation for negative spacing
  • Demo widget showcasing various configurations
  • Maintains all standard Row functionality

Installation #

Add the dependency to your pubspec.yaml:

dependencies:
  apptomate_custom_row: ^0.0.1

Usage #

Basic Usage #

CustomRow(
  spacing: 12.0,
  children: [
    Icon(Icons.home),
    Text('Home'),
    Icon(Icons.arrow_forward),
  ],
)

Available Parameters #

Parameter Type Default Description
children List required Widgets to display in the row
spacing double 8.0 Space between children (must be ≥ 0)
includeOuterSpacing bool false Adds spacing at row start/end
mainAxisAlignment MainAxisAlignment start Main axis alignment
crossAxisAlignment CrossAxisAlignment center Cross axis alignment
mainAxisSize MainAxisSize max Row's main axis size behavior

Advanced Examples #

With outer spacing:

CustomRow(
  spacing: 16.0,
  includeOuterSpacing: true,
  children: [/*...*/],
)

Space between items:

CustomRow(
  spacing: 12.0,
  mainAxisAlignment: MainAxisAlignment.spaceBetween,
  children: [/*...*/],
)

Demo #

The package includes a CustomRowWidget demo that shows four different configurations:

  1. Default spacing (8.0)
  2. Increased spacing (16.0)
  3. With outer spacing
  4. Space-between layout

To run the demo:

void main() {
  runApp(MaterialApp(
    home: CustomRowWidget(),
  ));
}

Implementation Details #

The widget works by:

  1. Accepting standard Row parameters
  2. Automatically inserting SizedBox widgets between children
  3. Optionally adding leading/trailing spacing
  4. Maintaining all native Row functionality

Best Practices #

  1. Use consistent spacing values throughout your app
  2. Consider includeOuterSpacing for better visual balance
  3. Combine with MainAxisAlignment for advanced layouts
  4. For complex scenarios, nest CustomRow within other layout widgets

Comparison with Flutter's Row #

Feature Flutter Row CustomRow
Child spacing Manual (wrap each child) Automatic
Outer spacing Requires Padding Built-in option
Spacing validation No Yes (non-negative)
Code verbosity High Reduced
0
likes
160
points
23
downloads

Publisher

unverified uploader

Weekly Downloads

A customizable Flutter Row widget with built-in spacing between children and additional layout options.

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on apptomate_custom_row