buildNavigationRail method

Widget buildNavigationRail(
  1. BuildContext context,
  2. int index
)

Implementation

Widget buildNavigationRail(BuildContext context, int index) => Column(
      mainAxisSize: MainAxisSize.max,
      children: [
        const Gap(5),
        if (Navigator.canPop(context))
          SafeArea(
              top: true,
              child: GhostButton(
                  density: ButtonDensity.icon,
                  child: context.inSheet
                      ? const Icon(Icons.x_bold)
                      : const Icon(Icons.caret_left_bold),
                  onPressed: () => Arcane.pop(context))),
        ...tabs
            .mapIndexed((tab, railIndex) => IconButton(
                  icon: Icon(
                      railIndex == index
                          ? (tab.selectedIcon ?? tab.icon)
                          : tab.icon,
                      color: railIndex == index
                          ? Theme.of(context).colorScheme.primary
                          : null),
                  onPressed: index == railIndex
                      ? null
                      : () => onIndexChanged?.call(railIndex),
                ))
            .toList(),
      ],
    ).padTop(siderailTopPadding);