awesome_padding_margin 2.0.0
awesome_padding_margin: ^2.0.0 copied to clipboard
A collection of Flutter widget extensions for adding padding, margin, and slivers in a cleaner and more expressive way.
📄 CHANGELOG.md #
2.0.0 2025 #
✨ New Features #
This is a major release that transforms the package from a simple padding/margin utility into a comprehensive UI toolkit.
🎨 Decoration Extensions
.backgroundColor(color): Set a background color..borderRadius(radius): Apply a circular border radius..border({color, width}): Add a border to the widget..shadow({color, blurRadius, offset}): Add a box shadow..gradient(gradient): Apply a gradient background..roundedRectangle({color, radius, border, boxShadow, gradient}): A one-stop method for beautifully styled containers.
👆 Gesture Extensions
.onTap(callback): Handle simple tap events..onDoubleTap(callback): Handle double-tap events..onLongPress(callback): Handle long-press events..gestures({...}): A flexible method to handle multiple gesture types at once..inkWell({onTap, borderRadius, ...}): Wrap the widget in a MaterialInkWellfor a ripple effect.
🎭 Animation Extensions
.fadeIn({duration, curve}): Animate the widget's opacity from 0 to 1..slideInFromTop({duration, curve, offset}): Slide the widget in from the top of the screen..slideInFromBottom({duration, curve, offset}): Slide the widget in from the bottom..slideInFromLeft({duration, curve, offset}): Slide the widget in from the left..slideInFromRight({duration, curve, offset}): Slide the widget in from the right..scaleIn({duration, curve, beginScale}): Animate the widget's scale.
📱 Responsive Extensions
.responsive({mobile, tablet, desktop}): Display different widgets based on screen width..visibleOn({mobile, tablet, desktop}): Conditionally show or hide a widget based on the screen size..scaled(context, {baseWidth}): Scale a widget based on the screen width.
👁️ Visibility Extensions
.opacity(value): Set the widget's opacity..visible(bool, {replacement}): Conditionally show a widget or a replacement..clipRect(): Clip the widget with a rectangle..clipOval(): Clip the widget with an oval..clipRRect(borderRadius): Clip the widget with rounded corners.
📍 Positioning Extensions
.positioned({left, top, right, bottom, width, height}): Position a widget inside aStack..positionedTop,.positionedBottom,.positionedLeft,.positionedRight: Convenient shortcuts for common positions..safeArea: Wrap the widget in aSafeArea.
📐 Sizing Extensions
.width(value): Set a specific width..height(value): Set a specific height..size(width, height): Set both width and height..square(size): Create a square with the given size..expand: Wrap the widget in anExpandedwidget..flexible([flex]): Wrap the widget in aFlexiblewidget..constrain({minWidth, maxWidth, ...}): Apply size constraints..aspectRatio(value): Set the widget's aspect ratio.
🎯 Alignment Extensions
.center: Center the widget..alignTop,.alignBottom,.alignLeft,.alignRight: Convenient shortcuts for common alignments..align(alignment): Align the widget with a customAlignment.
🔧 Enhancements #
- Padding Extensions: Added
.padding(EdgeInsets)for custom padding and.responsivePadding()for screen-size-dependent padding. - Margin Extensions: Added
.margin(EdgeInsets)for custom margins and.responsiveMargin()for screen-size-dependent margins. - Sliver Extensions: Added
.sliverPadding(padding)and.sliverOpacity(opacity)to directly create decorated slivers.
📦 Other #
- Added a comprehensive interactive live demo to showcase all features.
- Completely rewrote the
README.mdwith detailed examples and a new look. - Improved inline documentation for all public methods.