import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:trainhub_flutter/core/theme/app_colors.dart'; import 'package:trainhub_flutter/core/constants/ui_constants.dart'; class AppTheme { AppTheme._(); static final ThemeData dark = ThemeData( useMaterial3: true, brightness: Brightness.dark, colorScheme: const ColorScheme.dark( primary: AppColors.accent, onPrimary: AppColors.zinc950, secondary: AppColors.zinc200, onSecondary: AppColors.zinc950, surface: AppColors.surface, onSurface: AppColors.zinc50, surfaceContainer: AppColors.surfaceContainer, error: AppColors.destructive, onError: AppColors.zinc50, outline: AppColors.border, outlineVariant: AppColors.zinc700, ), scaffoldBackgroundColor: AppColors.surface, textTheme: GoogleFonts.interTextTheme(ThemeData.dark().textTheme) .copyWith( displayLarge: GoogleFonts.chakraPetch(fontWeight: FontWeight.w700), displayMedium: GoogleFonts.chakraPetch(fontWeight: FontWeight.w700), displaySmall: GoogleFonts.chakraPetch(fontWeight: FontWeight.w700), headlineLarge: GoogleFonts.chakraPetch(fontWeight: FontWeight.w700), headlineMedium: GoogleFonts.chakraPetch(fontWeight: FontWeight.w600), headlineSmall: GoogleFonts.chakraPetch(fontWeight: FontWeight.w600), ) .apply( bodyColor: AppColors.textPrimary, displayColor: AppColors.textPrimary, ), cardTheme: CardThemeData( color: AppColors.surfaceContainer, elevation: 0, shape: RoundedRectangleBorder( borderRadius: UIConstants.cardBorderRadius, side: const BorderSide(color: AppColors.border, width: 1), ), margin: EdgeInsets.zero, ), dividerTheme: const DividerThemeData( color: AppColors.border, thickness: 1, space: 1, ), iconTheme: const IconThemeData(color: AppColors.textSecondary, size: 20), navigationRailTheme: NavigationRailThemeData( backgroundColor: AppColors.surfaceContainer, selectedIconTheme: const IconThemeData(color: AppColors.accent), unselectedIconTheme: const IconThemeData(color: AppColors.textMuted), selectedLabelTextStyle: GoogleFonts.inter( fontSize: 12, fontWeight: FontWeight.w500, color: AppColors.textPrimary, ), unselectedLabelTextStyle: GoogleFonts.inter( fontSize: 12, fontWeight: FontWeight.w400, color: AppColors.textMuted, ), indicatorColor: AppColors.accentMuted, ), inputDecorationTheme: InputDecorationTheme( filled: true, fillColor: AppColors.surfaceContainer, contentPadding: const EdgeInsets.symmetric(horizontal: 12, vertical: 12), border: OutlineInputBorder( borderRadius: UIConstants.smallCardBorderRadius, borderSide: const BorderSide(color: AppColors.border), ), enabledBorder: OutlineInputBorder( borderRadius: UIConstants.smallCardBorderRadius, borderSide: const BorderSide(color: AppColors.border), ), focusedBorder: OutlineInputBorder( borderRadius: UIConstants.smallCardBorderRadius, borderSide: const BorderSide(color: AppColors.accent, width: 1), ), hintStyle: GoogleFonts.inter(color: AppColors.textMuted, fontSize: 14), labelStyle: GoogleFonts.inter( color: AppColors.textSecondary, fontSize: 14, ), ), dialogTheme: DialogThemeData( backgroundColor: AppColors.surfaceContainer, shape: RoundedRectangleBorder( borderRadius: UIConstants.cardBorderRadius, side: const BorderSide(color: AppColors.border), ), titleTextStyle: GoogleFonts.inter( fontSize: 18, fontWeight: FontWeight.w600, color: AppColors.textPrimary, ), ), filledButtonTheme: FilledButtonThemeData( style: FilledButton.styleFrom( backgroundColor: AppColors.accent, foregroundColor: AppColors.zinc950, shape: RoundedRectangleBorder( borderRadius: UIConstants.smallCardBorderRadius, ), padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10), textStyle: GoogleFonts.chakraPetch( fontSize: 14, fontWeight: FontWeight.w600, letterSpacing: 0.8, ), ), ), outlinedButtonTheme: OutlinedButtonThemeData( style: OutlinedButton.styleFrom( foregroundColor: AppColors.textPrimary, side: const BorderSide(color: AppColors.border), shape: RoundedRectangleBorder( borderRadius: UIConstants.smallCardBorderRadius, ), padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10), textStyle: GoogleFonts.inter(fontSize: 14, fontWeight: FontWeight.w500), ), ), textButtonTheme: TextButtonThemeData( style: TextButton.styleFrom( foregroundColor: AppColors.textSecondary, shape: RoundedRectangleBorder( borderRadius: UIConstants.smallCardBorderRadius, ), padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8), textStyle: GoogleFonts.inter(fontSize: 14, fontWeight: FontWeight.w500), ), ), tabBarTheme: TabBarThemeData( labelColor: AppColors.textPrimary, unselectedLabelColor: AppColors.textMuted, indicatorColor: AppColors.accent, dividerColor: AppColors.border, labelStyle: GoogleFonts.chakraPetch( fontSize: 13, fontWeight: FontWeight.w600, letterSpacing: 1, ), unselectedLabelStyle: GoogleFonts.chakraPetch( fontSize: 13, fontWeight: FontWeight.w500, letterSpacing: 1, ), ), snackBarTheme: SnackBarThemeData( backgroundColor: AppColors.surfaceContainer, contentTextStyle: GoogleFonts.inter( color: AppColors.textPrimary, fontSize: 14, ), shape: RoundedRectangleBorder( borderRadius: UIConstants.smallCardBorderRadius, side: const BorderSide(color: AppColors.border), ), behavior: SnackBarBehavior.floating, ), bottomSheetTheme: const BottomSheetThemeData( backgroundColor: AppColors.surfaceContainer, shape: RoundedRectangleBorder( borderRadius: BorderRadius.vertical(top: Radius.circular(16)), ), ), dropdownMenuTheme: DropdownMenuThemeData( inputDecorationTheme: InputDecorationTheme( filled: true, fillColor: AppColors.surfaceContainer, border: OutlineInputBorder( borderRadius: UIConstants.smallCardBorderRadius, borderSide: const BorderSide(color: AppColors.border), ), ), ), checkboxTheme: CheckboxThemeData( fillColor: WidgetStateProperty.resolveWith((states) { if (states.contains(WidgetState.selected)) { return AppColors.accent; } return Colors.transparent; }), checkColor: WidgetStateProperty.all(AppColors.zinc950), side: const BorderSide(color: AppColors.zinc400), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(4)), ), tooltipTheme: TooltipThemeData( decoration: BoxDecoration( color: AppColors.zinc800, borderRadius: BorderRadius.circular(6), border: Border.all(color: AppColors.zinc700), ), textStyle: GoogleFonts.inter(color: AppColors.textPrimary, fontSize: 12), ), ); }