USideMenuTheme.from constructor

USideMenuTheme.from(
  1. BuildContext context
)

Implementation

factory USideMenuTheme.from(BuildContext context) {
  final ColorScheme cs = Theme.of(context).colorScheme;
  final Color bg = cs.primary;
  final Color on = cs.onPrimary;
  return USideMenuTheme(
    backgroundColor: bg,
    backgroundGradient: LinearGradient(
      begin: Alignment.topCenter,
      end: Alignment.bottomCenter,
      colors: <Color>[
        Color.alphaBlend(Colors.white.withValues(alpha: 0.04), bg),
        Color.alphaBlend(Colors.black.withValues(alpha: 0.16), bg),
      ],
    ),
    selectedItemColor: on.withValues(alpha: 0.16),
    hoverColor: on.withValues(alpha: 0.08),
    indicatorColor: on,
    selectedTextColor: on,
    unselectedTextColor: on.withValues(alpha: 0.74),
    selectedIconColor: on,
    unselectedIconColor: on.withValues(alpha: 0.74),
    headerTextStyle: TextStyle(
      color: on.withValues(alpha: 0.5),
      fontSize: 11,
      fontWeight: FontWeight.w700,
      letterSpacing: 1.2,
    ),
    shadow: <BoxShadow>[
      BoxShadow(color: Colors.black.withValues(alpha: 0.18), blurRadius: 24, offset: const Offset(0, 8)),
    ],
    scrimColor: Colors.black.withValues(alpha: 0.5),
    dividerColor: on.withValues(alpha: 0.12),
  );
}