mProps property

Map<String, String> get mProps

Converts margin attributes to a CSS style map.

Implementation

Map<String, String> get mProps => {
  if (top != null &&
      top == right &&
      bottom == left &&
      top == bottom &&
      right == left) ...{
    'margin': top!.cssText,
  } else if (top != null &&
      right != null &&
      top == bottom &&
      right == left) ...{
    'margin': '${top!.cssText} ${right!.cssText}',
  } else ...{
    'margin-top': ?top?.cssText,
    'margin-right': ?right?.cssText,
    'margin-bottom': ?bottom?.cssText,
    'margin-left': ?left?.cssText,
  },
};