builder method
Implementation
MarginAttribute builder(SpaceProperty prop, int space) {
switch (prop) {
case SpaceProperty.all:
return MarginAttribute(
left: space,
top: space,
right: space,
bottom: space,
);
case SpaceProperty.left:
return MarginAttribute(
left: space,
);
case SpaceProperty.top:
return MarginAttribute(
top: space,
);
case SpaceProperty.right:
return MarginAttribute(
right: space,
);
case SpaceProperty.bottom:
return MarginAttribute(
bottom: space,
);
case SpaceProperty.horizontal:
return MarginAttribute(
left: space,
right: space,
);
case SpaceProperty.vertical:
return MarginAttribute(
top: space,
bottom: space,
);
default:
return MarginAttribute();
}
}