getBorder method

Border? getBorder(
  1. InheritedProperties resolved
)

Calculates Border.

Implementation

Border? getBorder(InheritedProperties resolved) {
  final isRtl = resolved.isRtl;
  final bottom = CssBorderSide._copyWith(_all, _bottom)?._getValue(resolved);
  final left = CssBorderSide._copyWith(
    _all,
    _left ?? (isRtl ? _inlineEnd : _inlineStart),
  )?._getValue(resolved);
  final right = CssBorderSide._copyWith(
    _all,
    _right ?? (isRtl ? _inlineStart : _inlineEnd),
  )?._getValue(resolved);
  final top = CssBorderSide._copyWith(_all, _top)?._getValue(resolved);
  if (bottom == null && left == null && right == null && top == null) {
    return null;
  }

  return Border(
    bottom: bottom ?? BorderSide.none,
    left: left ?? BorderSide.none,
    right: right ?? BorderSide.none,
    top: top ?? BorderSide.none,
  );
}