dynamicPadding method
Implementation
Widget dynamicPadding({
double? all,
double? horizontal,
double? vertical,
double? top,
double? bottom,
double? left,
double? right,
BuildContext? context,
}) {
double width = 0;
double height = 0;
if (context != null) {
width = MediaQuery.of(context).size.width;
height = MediaQuery.of(context).size.height;
}
return Padding(
padding: EdgeInsets.only(
top: top != null
? height * top
: (vertical != null
? height * vertical
: (all != null ? height * all : 0)),
bottom: bottom != null
? height * bottom
: (vertical != null
? height * vertical
: (all != null ? height * all : 0)),
left: left != null
? width * left
: (horizontal != null
? width * horizontal
: (all != null ? width * all : 0)),
right: right != null
? width * right
: (horizontal != null
? width * horizontal
: (all != null ? width * all : 0)),
),
child: this,
);
}