create static method

EdgeInsets create(
  1. Axis axis, {
  2. double mainBegin = 0.0,
  3. double mainEnd = 0.0,
  4. double crossBegin = 0.0,
  5. double crossEnd = 0.0,
})

Creates edge insets given the begin and end extents on the given axis.

Implementation

static EdgeInsets create(
  Axis axis, {
  double mainBegin = 0.0,
  double mainEnd = 0.0,
  double crossBegin = 0.0,
  double crossEnd = 0.0,
}) {
  if (axis == Axis.vertical) {
    return EdgeInsets.only(
      top: mainBegin,
      bottom: mainEnd,
      left: crossBegin,
      right: crossEnd,
    );
  } else {
    return EdgeInsets.only(
      left: mainBegin,
      right: mainEnd,
      top: crossBegin,
      bottom: crossEnd,
    );
  }
}