import 'package:sysfarma_mobile/src/core/theme/app_tokens.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; class AppTheme { const AppTheme._(); static ThemeData light() { final colorScheme = ColorScheme.fromSeed( seedColor: AppTokens.primary, brightness: Brightness.light, ).copyWith( primary: AppTokens.primary, onPrimary: Colors.white, secondary: AppTokens.secondary, onSecondary: Colors.white, error: AppTokens.danger, onError: Colors.white, surface: AppTokens.surface, onSurface: AppTokens.textPrimary, surfaceTint: AppTokens.primary, ); final base = ThemeData( useMaterial3: true, colorScheme: colorScheme, scaffoldBackgroundColor: AppTokens.background, cardColor: AppTokens.surface, canvasColor: AppTokens.surface, ); final roboto = GoogleFonts.robotoTextTheme(base.textTheme); final textTheme = roboto.copyWith( headlineSmall: GoogleFonts.rubik( textStyle: roboto.headlineSmall, fontWeight: FontWeight.w700, color: AppTokens.textPrimary, ), titleLarge: GoogleFonts.rubik( textStyle: roboto.titleLarge, fontWeight: FontWeight.w700, color: AppTokens.textPrimary, ), titleMedium: GoogleFonts.rubik( textStyle: roboto.titleMedium, fontWeight: FontWeight.w600, color: AppTokens.textPrimary, ), headlineMedium: GoogleFonts.rubik( textStyle: roboto.headlineMedium, fontWeight: FontWeight.w700, color: AppTokens.textPrimary, ), bodyLarge: roboto.bodyLarge?.copyWith(color: AppTokens.textPrimary, height: 1.5), bodyMedium: roboto.bodyMedium?.copyWith(color: AppTokens.textPrimary, height: 1.5), labelLarge: roboto.labelLarge?.copyWith(fontWeight: FontWeight.w600), ); return base.copyWith( textTheme: textTheme, appBarTheme: AppBarTheme( elevation: 0, backgroundColor: Colors.transparent, surfaceTintColor: Colors.transparent, foregroundColor: AppTokens.textPrimary, titleTextStyle: textTheme.titleLarge, ), cardTheme: CardThemeData( elevation: 0, color: AppTokens.surface, surfaceTintColor: AppTokens.surface, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(AppTokens.radiusMedium), side: const BorderSide(color: AppTokens.border), ), ), inputDecorationTheme: InputDecorationTheme( filled: true, fillColor: Colors.white, labelStyle: textTheme.bodyMedium?.copyWith(color: AppTokens.textSecondary), hintStyle: textTheme.bodyMedium?.copyWith(color: AppTokens.textSecondary.withValues(alpha: 0.80)), border: OutlineInputBorder( borderRadius: BorderRadius.circular(AppTokens.radiusSmall), borderSide: const BorderSide(color: AppTokens.border), ), enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(AppTokens.radiusSmall), borderSide: const BorderSide(color: AppTokens.border), ), focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(AppTokens.radiusSmall), borderSide: const BorderSide(color: AppTokens.primary, width: 1.3), ), errorBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(AppTokens.radiusSmall), borderSide: const BorderSide(color: AppTokens.danger, width: 1.3), ), focusedErrorBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(AppTokens.radiusSmall), borderSide: const BorderSide(color: AppTokens.danger, width: 1.3), ), errorStyle: textTheme.bodySmall?.copyWith(color: AppTokens.danger), contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16), ), floatingActionButtonTheme: const FloatingActionButtonThemeData( backgroundColor: AppTokens.cta, foregroundColor: Colors.white, ), bottomSheetTheme: const BottomSheetThemeData( backgroundColor: AppTokens.surface, surfaceTintColor: AppTokens.surface, showDragHandle: true, ), dividerTheme: DividerThemeData( color: AppTokens.border.withValues(alpha: 0.72), thickness: 1, space: 24, ), listTileTheme: const ListTileThemeData( contentPadding: EdgeInsets.zero, iconColor: AppTokens.primary, ), navigationBarTheme: NavigationBarThemeData( backgroundColor: Colors.white, indicatorColor: AppTokens.primary.withValues(alpha: 0.12), labelTextStyle: WidgetStateProperty.resolveWith( (states) => textTheme.labelMedium?.copyWith( color: states.contains(WidgetState.selected) ? AppTokens.primary : AppTokens.textSecondary, fontWeight: states.contains(WidgetState.selected) ? FontWeight.w700 : FontWeight.w600, ), ), ), chipTheme: ChipThemeData( backgroundColor: Colors.white, disabledColor: AppTokens.border, selectedColor: AppTokens.primary.withValues(alpha: 0.12), secondarySelectedColor: AppTokens.primary.withValues(alpha: 0.12), padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 6), labelStyle: textTheme.labelMedium?.copyWith(color: AppTokens.textPrimary), secondaryLabelStyle: textTheme.labelMedium?.copyWith(color: AppTokens.primary), side: const BorderSide(color: AppTokens.border), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(999), ), ), snackBarTheme: SnackBarThemeData( behavior: SnackBarBehavior.floating, backgroundColor: AppTokens.textPrimary, contentTextStyle: textTheme.bodyMedium?.copyWith(color: Colors.white), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(AppTokens.radiusSmall), ), ), filledButtonTheme: FilledButtonThemeData( style: FilledButton.styleFrom( minimumSize: const Size(88, 52), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(AppTokens.radiusSmall), ), ), ), outlinedButtonTheme: OutlinedButtonThemeData( style: OutlinedButton.styleFrom( minimumSize: const Size(88, 48), foregroundColor: AppTokens.primary, side: const BorderSide(color: AppTokens.border), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(AppTokens.radiusSmall), ), ), ), ); } }