create<T extends SpaceAttribute> static method
Create instance a class of SpaceeAttrtibute
Implementation
static T create<T extends SpaceAttribute>({
final double? left,
final double? top,
final double? right,
final double? bottom,
}) {
assert(T != SpaceAttribute);
switch (T) {
case MarginAttribute:
return MarginAttribute(
left: left,
top: top,
right: right,
bottom: bottom,
) as T;
case PaddingAttribute:
return PaddingAttribute(
left: left,
top: top,
right: right,
bottom: bottom,
) as T;
default:
throw Exception('Cannot create SpaceAttribute of $T');
}
}