Jonny Borges
Committed by GitHub

Update widget_extensions.dart

import 'package:flutter/widgets.dart';
/// add Padding Property to widget
extension WidgetPaddingX on Widget {
Widget paddingAll(double padding) =>
Padding(padding: EdgeInsets.all(padding), child: this);
... ... @@ -24,6 +25,7 @@ extension WidgetPaddingX on Widget {
Widget get paddingZero => Padding(padding: EdgeInsets.zero, child: this);
}
/// Add margin property to widget
extension WidgetMarginX on Widget {
Widget marginAll(double margin) =>
Container(margin: EdgeInsets.all(margin), child: this);
... ... @@ -33,14 +35,14 @@ extension WidgetMarginX on Widget {
margin:
EdgeInsets.symmetric(horizontal: horizontal, vertical: vertical),
child: this);
Widget marginOnly({
double left = 0.0,
double top = 0.0,
double right = 0.0,
double bottom = 0.0,
}) =>
Container(
Padding(
margin: EdgeInsets.only(
top: top, left: left, right: right, bottom: bottom),
child: this);
... ... @@ -48,6 +50,7 @@ extension WidgetMarginX on Widget {
Widget get marginZero => Container(margin: EdgeInsets.zero, child: this);
}
/// Allows you to insert widgets inside a CustomScrollView
extension WidgetSliverBoxX on Widget {
Widget get sliverBox => SliverToBoxAdapter(child: this);
}
... ...