Positioned.directional constructor
Positioned.directional({})
Creates a widget that controls where a child of a Stack is positioned.
Implementation
factory Positioned.directional({
required TextDirection textDirection,
double? start,
double? top,
double? end,
double? bottom,
required Widget child,
}) {
double? left;
double? right;
switch (textDirection) {
case TextDirection.rtl:
left = end;
right = start;
break;
case TextDirection.ltr:
left = start;
right = end;
break;
}
return Positioned(
left: left,
top: top,
right: right,
bottom: bottom,
child: child,
);
}