borderRadiusMap top-level property

Map<String, Object> borderRadiusMap
final

Implementation

final borderRadiusMap = {
  "zero": BorderRadius.zero,
  "circular": (Object value) {
    return BorderRadius.circular(parseDouble(value) ?? 0);
  },
  "all": (Object value) {
    return BorderRadius.all(value as Radius);
  },
  "horizontal": ({Object? left, Object? right}) {
    Radius left_ = Radius.zero;
    Radius right_ = Radius.zero;
    if (left is Radius) {
      left_ = left;
    }
    if (right is Radius) {
      right_ = right;
    }
    return BorderRadius.horizontal(
      left: left_,
      right: right_,
    );
  },
  "vertical": ({Object? top, Object? bottom}) {
    Radius top_ = Radius.zero;
    Radius bottom_ = Radius.zero;
    if (top is Radius) {
      top_ = top;
    }
    if (bottom is Radius) {
      bottom_ = bottom;
    }
    return BorderRadius.vertical(
      top: top_,
      bottom: bottom_,
    );
  },
  "only": (
      {Object? topLeft,
      Object? topRight,
      Object? bottomRight,
      Object? bottomLeft}) {
    Radius topLeft_ = Radius.zero;
    Radius topRight_ = Radius.zero;
    Radius bottomRight_ = Radius.zero;
    Radius bottomLeft_ = Radius.zero;
    if (topLeft is Radius) {
      topLeft_ = topLeft;
    }
    if (topRight is Radius) {
      topRight_ = topRight;
    }
    if (bottomRight is Radius) {
      bottomRight_ = bottomRight;
    }
    if (bottomLeft is Radius) {
      bottomLeft_ = bottomLeft;
    }

    return BorderRadius.only(
      topLeft: topLeft_,
      topRight: topRight_,
      bottomRight: bottomRight_,
      bottomLeft: bottomLeft_,
    );
  }
};