margin method

Container margin({
  1. double? all,
  2. double? horizontal,
  3. double? vertical,
  4. double? left,
  5. double? top,
  6. double? right,
  7. double? bottom,
})

Returns a new widget with the given margin.

Implementation

Container margin({
  double? all,
  double? horizontal,
  double? vertical,
  double? left,
  double? top,
  double? right,
  double? bottom,
}) {
  return Container(
    margin: all != null
        ? .all(all)
        : .only(
            left: left ?? (horizontal ?? 0),
            right: right ?? (horizontal ?? 0),
            top: top ?? (vertical ?? 0),
            bottom: bottom ?? (vertical ?? 0),
          ),
    child: this,
  );
}