lightTheme function

ThemeData lightTheme()

Implementation

ThemeData lightTheme() {
  final base = ThemeData.light(useMaterial3: true);
  final colorScheme = base.colorScheme.maslowColorScheme;

  return base.copyWith(
    splashFactory: null,
    dividerColor: Colors.transparent,
    splashColor: Colors.transparent,
    highlightColor: Colors.transparent,
    hoverColor: Colors.transparent,
    scaffoldBackgroundColor: colorScheme.surface,
    textTheme: base.textTheme.sora.maslowTextTheme,
    colorScheme: colorScheme,
    primaryColor: colorScheme.primary,
    dividerTheme: base.dividerTheme.copyWith(
      color: colorScheme.outline.withOpacity(0.4),
      thickness: 1,
      space: 0,
    ),
    bottomSheetTheme: base.bottomSheetTheme.copyWith(elevation: 0),
    dialogTheme: base.dialogTheme.copyWith(elevation: 0),
    appBarTheme: base.appBarTheme.copyWith(
      centerTitle: false,
      scrolledUnderElevation: 0,
      shape: LinearBorder(
        side: BorderSide(color: colorScheme.outline.withOpacity(0.4)),
        bottom: const LinearBorderEdge(),
      ),
    ),
    cardTheme: base.cardTheme.copyWith(
      margin: EdgeInsets.zero,
      color: colorScheme.surface,
      elevation: 0,
      shape: RoundedRectangleBorder(
        borderRadius: BorderRadius.circular(10),
      ),
    ),
    navigationBarTheme: base.navigationBarTheme.copyWith(
      labelTextStyle: MaterialStateTextStyle.resolveWith((states) {
        final labelSmall = base.textTheme.labelSmall!;

        if (states.contains(MaterialState.selected)) {
          return labelSmall.copyWith(color: base.colorScheme.primary);
        }

        return labelSmall.copyWith(color: base.colorScheme.onSurface);
      }),
    ),
  );
}