switchable_padding 1.1.0 copy "switchable_padding: ^1.1.0" to clipboard
switchable_padding: ^1.1.0 copied to clipboard

A widget that adds calculated padding to the child according to the given width.

Widget that switches Padding for a given width for Responsive support.

Getting started #

In your library add the following import:

import 'package:switchable_padding/switchable_padding.dart';
copied to clipboard

Place the Widget for which you wish to adjust the Padding to be given as a child element of SwitchablePadding.

SwitchablePadding(
  padding: (width) {
    if (width < 600) {
      return const EdgeInsets.all(0);
    } else {
      return const EdgetInsets.all(16);
    }
  },
  child: Text('Hello World'),
),
copied to clipboard
0
likes
160
points
23
downloads

Publisher

unverified uploader

Weekly Downloads

2024.12.07 - 2025.11.01

A widget that adds calculated padding to the child according to the given width.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on switchable_padding