hussam

feat: add REdgeInsetsDirectional

@@ -79,3 +79,52 @@ class REdgeInsets extends EdgeInsets { @@ -79,3 +79,52 @@ class REdgeInsets extends EdgeInsets {
79 top: top.r, 79 top: top.r,
80 ); 80 );
81 } 81 }
  82 +
  83 +class REdgeInsetsDirectional extends EdgeInsetsDirectional {
  84 + /// Creates insets where all the offsets are `value`.
  85 + ///
  86 + /// {@tool snippet}
  87 + ///
  88 + /// Adapt eight-pixel margin on all sides:
  89 + ///
  90 + /// ```dart
  91 + /// const REdgeInsetsDirectional.all(8.0)
  92 + /// ```
  93 + /// {@end-tool}
  94 + REdgeInsetsDirectional.all(double value) : super.all(value.r);
  95 +
  96 + /// Creates insets with only the given values non-zero.
  97 + ///
  98 + /// {@tool snippet}
  99 + ///
  100 + /// Adapt margin indent of 40 pixels on the leading side:
  101 + ///
  102 + /// ```dart
  103 + /// const REdgeInsetsDirectional.only(start: 40.0)
  104 + /// ```
  105 + /// {@end-tool}
  106 + REdgeInsetsDirectional.only({
  107 + double bottom = 0,
  108 + double end = 0,
  109 + double start = 0,
  110 + double top = 0,
  111 + }) : super.only(
  112 + bottom: bottom.r,
  113 + start: start.r,
  114 + end: end.r,
  115 + top: top.r,
  116 + );
  117 +
  118 + /// Creates adapt insets from offsets from the start, top, end, and bottom.
  119 + REdgeInsetsDirectional.fromSTEB(
  120 + double start,
  121 + double top,
  122 + double end,
  123 + double bottom,
  124 + ) : super.fromSTEB(
  125 + start.r,
  126 + top.r,
  127 + end.r,
  128 + bottom.r,
  129 + );
  130 +}