direction static method
EdgeInsets
direction(
- AxisDirection direction, {
- double mainBegin = 0.0,
- double mainEnd = 0.0,
- double crossBegin = 0.0,
- double crossEnd = 0.0,
Creates edge insets towards direction
.
Implementation
static EdgeInsets direction(AxisDirection direction, {
double mainBegin = 0.0, double mainEnd = 0.0,
double crossBegin = 0.0, double crossEnd = 0.0,
}) {
if (direction == AxisDirection.up) {
return EdgeInsets.only(
bottom: mainBegin,
top: mainEnd,
right: crossBegin,
left: crossEnd,
);
} else if (direction == AxisDirection.right) {
return EdgeInsets.only(
left: mainBegin,
right: mainEnd,
top: crossBegin,
bottom: crossEnd,
);
} else if (direction == AxisDirection.down) {
return EdgeInsets.only(
top: mainBegin,
bottom: mainEnd,
left: crossBegin,
right: crossEnd,
);
} else {
return EdgeInsets.only(
right: mainBegin,
left: mainEnd,
bottom: crossBegin,
top: crossEnd,
);
}
}