Skip to main content

low_level_widgets 0.1.2 copy "low_level_widgets: ^0.1.2" to clipboard
low_level_widgets: ^0.1.2 copied to clipboard

Add outer padding and equal spacing between children to a Flutter Column with InsetColumn, without extra layout widgets.

low_level_widgets #

Add padding and equal gaps between children to a Flutter Column with InsetColumn.

pub package Licence: MIT

Quick start #

From your Flutter app:

flutter pub add low_level_widgets
import 'package:flutter/widgets.dart';
import 'package:low_level_widgets/low_level_widgets.dart';

const shoppingList = InsetColumn(
  padding: EdgeInsets.all(16),
  gap: 8,
  children: [Text('Shopping list'), Text('Milk'), Text('Tea')],
);

The same layout with Padding and Column #

This version wraps the Column in Padding and puts a SizedBox between children:

const shoppingList = Padding(
  padding: EdgeInsets.all(16),
  child: Column(
    mainAxisSize: MainAxisSize.min,
    crossAxisAlignment: CrossAxisAlignment.start,
    children: [
      Text('Shopping list'),
      SizedBox(height: 8),
      Text('Milk'),
      SizedBox(height: 8),
      Text('Tea'),
    ],
  ),
);

Layout #

Children line up at the start edge for the current text direction. The gap appears only between children. Use EdgeInsetsDirectional when the leading and trailing padding should swap in a right-to-left layout.

Like a Column, InsetColumn lays out every child and doesn't scroll. Use a ListView.builder for a long scrolling list.

Platform support #

Works wherever Flutter widgets run. Requires Flutter 3.24 or later and Dart 3.5 or later in the Dart 3 series.

Contributing #

Run these checks from the package directory:

flutter pub get
(cd example && flutter pub get)
dart format --output=none --set-exit-if-changed lib test example/lib
flutter analyze
flutter test

To see the shopping list in Chrome:

cd example
flutter run -d chrome

Licence #

MIT

0
likes
160
points
79
downloads
screenshot

Documentation

API reference

Publisher

verified publisherzonilyjame.dev

Weekly Downloads

Add outer padding and equal spacing between children to a Flutter Column with InsetColumn, without extra layout widgets.

Repository (GitHub)
View/report issues

Topics

#flutter #widget #layout

License

MIT (license)

Dependencies

flutter

More

Packages that depend on low_level_widgets