fluent2ChosenRow function

Widget fluent2ChosenRow({
  1. required Widget row,
  2. required bool chosen,
  3. required Fluent2Colors colors,
  4. required Fluent2Press press,
})

row with the selection indicator at its leading edge while chosen.

Implementation

Widget fluent2ChosenRow({
  required Widget row,
  required bool chosen,
  required Fluent2Colors colors,
  required Fluent2Press press,
}) {
  if (!chosen) return row;
  return Stack(
    children: [
      row,
      PositionedDirectional(
        start: 0,
        top: 0,
        bottom: 0,
        child: Center(
          child: Container(
            width: 3,
            height: 16,
            decoration: BoxDecoration(
              color: press == Fluent2Press.disabled
                  ? colors.neutralForegroundDisabled
                  : colors.compoundBrandStroke,
              borderRadius: BorderRadius.circular(1.5),
            ),
          ),
        ),
      ),
    ],
  );
}