fluentColorRailAnchor function

Alignment fluentColorRailAnchor({
  1. required bool vertical,
  2. required TextDirection textDirection,
})

The edge a rail's minimum value sits against.

The bottom when vertical — Fluent's vertical sliders put the smallest value at the bottom, which upstream gets from writing-mode: vertical-lr plus direction: rtl on the native input. Otherwise the reading-order start edge, mirrored by textDirection.

The opposite edge is -fluentColorRailAnchor(...), so one call places a gradient, a thumb and a pointer alike.

Implementation

Alignment fluentColorRailAnchor({
  required bool vertical,
  required TextDirection textDirection,
}) => vertical
    ? Alignment.bottomCenter
    : (textDirection == TextDirection.rtl
          ? Alignment.centerRight
          : Alignment.centerLeft);