Implement light minimalistic tech redesign with Material 3
Complete transformation from dark to light theme with a professional, tech-forward design system featuring: - Material 3 theming with cyan-based color palette (#0891B2 primary) - Inter font family integration via Google Fonts - Comprehensive theme system (colors, spacing, typography, shadows) - Responsive component redesign across all screens - Enhanced UX with hover animations, Hero transitions, and shimmer loading - Accessibility features (reduced motion support, high contrast) - Clean architecture with zero hardcoded values Theme System: - Created app_colors.dart with semantic color constants - Created app_spacing.dart with 8px base spacing scale - Created app_theme.dart with complete Material 3 configuration - Added shimmer_loading.dart for image loading states UI Components Updated: - Book cards with hover effects and Hero animations - Bottom navigation with refined styling - All screens migrated to theme-based colors and typography - Forms and inputs using consistent design system Documentation: - Added REDESIGN_SUMMARY.md with complete implementation overview - Added IMPLEMENTATION_CHECKLIST.md with detailed task completion status All components now use centralized theme with no hardcoded values, ensuring consistency and easy future customization. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
34
books_flutter/lib/theme/app_colors.dart
Normal file
34
books_flutter/lib/theme/app_colors.dart
Normal file
@@ -0,0 +1,34 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// Semantic color constants for the light minimalistic tech theme
|
||||
class AppColors {
|
||||
// Primary colors
|
||||
static const primary = Color(0xFF0891B2); // Cyan-600
|
||||
static const secondary = Color(0xFF22D3EE); // Cyan-400
|
||||
|
||||
// CTA and success
|
||||
static const success = Color(0xFF22C55E); // Green-500
|
||||
static const error = Color(0xFFEF4444); // Red-500
|
||||
|
||||
// Background colors
|
||||
static const background = Color(0xFFECFEFF); // Cyan-50
|
||||
static const surface = Color(0xFFFFFFFF); // White
|
||||
static const surfaceVariant = Color(0xFFF5F5F5); // Gray-100
|
||||
|
||||
// Text colors
|
||||
static const textPrimary = Color(0xFF164E63); // Cyan-900
|
||||
static const textSecondary = Color(0xFF0E7490); // Cyan-800
|
||||
static const textTertiary = Color(0xFF06B6D4); // Cyan-500
|
||||
|
||||
// Border colors
|
||||
static const outline = Color(0xFFE5E7EB); // Gray-200
|
||||
static const outlineVariant = Color(0xFFF3F4F6); // Gray-100
|
||||
|
||||
// Shadow colors
|
||||
static const shadow = Color(0x0D000000); // rgba(0,0,0,0.05)
|
||||
static const shadowMedium = Color(0x12000000); // rgba(0,0,0,0.07)
|
||||
static const shadowLarge = Color(0x14000000); // rgba(0,0,0,0.08)
|
||||
static const shadowXLarge = Color(0x1A000000); // rgba(0,0,0,0.1)
|
||||
|
||||
AppColors._();
|
||||
}
|
||||
24
books_flutter/lib/theme/app_spacing.dart
Normal file
24
books_flutter/lib/theme/app_spacing.dart
Normal file
@@ -0,0 +1,24 @@
|
||||
/// Spacing and border radius constants for consistent layout
|
||||
class AppSpacing {
|
||||
// Spacing scale (8px base)
|
||||
static const double xs = 4.0;
|
||||
static const double sm = 8.0;
|
||||
static const double md = 16.0;
|
||||
static const double lg = 24.0;
|
||||
static const double xl = 32.0;
|
||||
static const double xxl = 48.0;
|
||||
static const double xxxl = 64.0;
|
||||
|
||||
// Border radius
|
||||
static const double radiusSmall = 6.0;
|
||||
static const double radiusMedium = 12.0;
|
||||
static const double radiusLarge = 16.0;
|
||||
static const double radiusPill = 8.0;
|
||||
|
||||
// Special constants
|
||||
static const double cardPadding = md;
|
||||
static const double screenPadding = lg;
|
||||
static const double gridSpacing = md;
|
||||
|
||||
AppSpacing._();
|
||||
}
|
||||
294
books_flutter/lib/theme/app_theme.dart
Normal file
294
books_flutter/lib/theme/app_theme.dart
Normal file
@@ -0,0 +1,294 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'app_colors.dart';
|
||||
import 'app_spacing.dart';
|
||||
|
||||
class AppTheme {
|
||||
// Shadow helpers
|
||||
static List<BoxShadow> get shadowSm => [
|
||||
const BoxShadow(
|
||||
color: AppColors.shadow,
|
||||
blurRadius: 2,
|
||||
offset: Offset(0, 1),
|
||||
),
|
||||
];
|
||||
|
||||
static List<BoxShadow> get shadowMd => [
|
||||
const BoxShadow(
|
||||
color: AppColors.shadowMedium,
|
||||
blurRadius: 6,
|
||||
offset: Offset(0, 4),
|
||||
),
|
||||
];
|
||||
|
||||
static List<BoxShadow> get shadowLg => [
|
||||
const BoxShadow(
|
||||
color: AppColors.shadowLarge,
|
||||
blurRadius: 15,
|
||||
offset: Offset(0, 10),
|
||||
),
|
||||
];
|
||||
|
||||
static List<BoxShadow> get shadowXl => [
|
||||
const BoxShadow(
|
||||
color: AppColors.shadowXLarge,
|
||||
blurRadius: 25,
|
||||
offset: Offset(0, 20),
|
||||
),
|
||||
];
|
||||
|
||||
static ThemeData lightTheme() {
|
||||
final colorScheme = ColorScheme.light(
|
||||
primary: AppColors.primary,
|
||||
secondary: AppColors.secondary,
|
||||
error: AppColors.error,
|
||||
surface: AppColors.surface,
|
||||
surfaceContainerHighest: AppColors.surfaceVariant,
|
||||
onPrimary: Colors.white,
|
||||
onSecondary: AppColors.textPrimary,
|
||||
onError: Colors.white,
|
||||
onSurface: AppColors.textPrimary,
|
||||
outline: AppColors.outline,
|
||||
outlineVariant: AppColors.outlineVariant,
|
||||
shadow: AppColors.shadow,
|
||||
primaryContainer: AppColors.secondary.withValues(alpha: 0.2),
|
||||
onPrimaryContainer: AppColors.primary,
|
||||
);
|
||||
|
||||
final textTheme = GoogleFonts.interTextTheme(
|
||||
TextTheme(
|
||||
// Display styles (32px, 28px)
|
||||
displayLarge: TextStyle(
|
||||
fontSize: 32,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: colorScheme.onSurface,
|
||||
height: 1.2,
|
||||
),
|
||||
displayMedium: TextStyle(
|
||||
fontSize: 28,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: colorScheme.onSurface,
|
||||
height: 1.2,
|
||||
),
|
||||
|
||||
// Headline styles (24px, 20px)
|
||||
headlineLarge: TextStyle(
|
||||
fontSize: 24,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: colorScheme.onSurface,
|
||||
height: 1.3,
|
||||
),
|
||||
headlineMedium: TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: colorScheme.onSurface,
|
||||
height: 1.3,
|
||||
),
|
||||
|
||||
// Title styles (18px, 16px, 14px)
|
||||
titleLarge: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: colorScheme.onSurface,
|
||||
height: 1.4,
|
||||
),
|
||||
titleMedium: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: colorScheme.onSurface,
|
||||
height: 1.4,
|
||||
),
|
||||
titleSmall: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: colorScheme.onSurface,
|
||||
height: 1.4,
|
||||
),
|
||||
|
||||
// Body styles (16px, 14px, 12px)
|
||||
bodyLarge: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: colorScheme.onSurface,
|
||||
height: 1.5,
|
||||
),
|
||||
bodyMedium: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: colorScheme.onSurface,
|
||||
height: 1.5,
|
||||
),
|
||||
bodySmall: TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: colorScheme.onSurface,
|
||||
height: 1.5,
|
||||
),
|
||||
|
||||
// Label styles (14px, 12px, 10px)
|
||||
labelLarge: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: colorScheme.onSurface,
|
||||
height: 1.4,
|
||||
),
|
||||
labelMedium: TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: colorScheme.onSurface,
|
||||
height: 1.4,
|
||||
),
|
||||
labelSmall: TextStyle(
|
||||
fontSize: 10,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: colorScheme.onSurface,
|
||||
height: 1.4,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
return ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: colorScheme,
|
||||
textTheme: textTheme,
|
||||
scaffoldBackgroundColor: AppColors.background,
|
||||
|
||||
// AppBar theme
|
||||
appBarTheme: AppBarTheme(
|
||||
backgroundColor: AppColors.surface,
|
||||
foregroundColor: colorScheme.onSurface,
|
||||
elevation: 0,
|
||||
centerTitle: false,
|
||||
titleTextStyle: textTheme.headlineLarge,
|
||||
),
|
||||
|
||||
// Card theme
|
||||
cardTheme: CardThemeData(
|
||||
color: AppColors.surface,
|
||||
elevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(AppSpacing.radiusMedium),
|
||||
side: BorderSide(color: colorScheme.outline, width: 1),
|
||||
),
|
||||
margin: const EdgeInsets.all(AppSpacing.sm),
|
||||
),
|
||||
|
||||
// Input decoration theme
|
||||
inputDecorationTheme: InputDecorationTheme(
|
||||
filled: true,
|
||||
fillColor: AppColors.surface,
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
horizontal: AppSpacing.md,
|
||||
vertical: AppSpacing.md,
|
||||
),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(AppSpacing.radiusMedium),
|
||||
borderSide: BorderSide(color: colorScheme.outline),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(AppSpacing.radiusMedium),
|
||||
borderSide: BorderSide(color: colorScheme.outline),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(AppSpacing.radiusMedium),
|
||||
borderSide: BorderSide(color: colorScheme.primary, width: 2),
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(AppSpacing.radiusMedium),
|
||||
borderSide: BorderSide(color: colorScheme.error),
|
||||
),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(AppSpacing.radiusMedium),
|
||||
borderSide: BorderSide(color: colorScheme.error, width: 2),
|
||||
),
|
||||
labelStyle: textTheme.labelMedium,
|
||||
hintStyle: textTheme.bodyMedium?.copyWith(
|
||||
color: colorScheme.onSurface.withValues(alpha: 0.5),
|
||||
),
|
||||
),
|
||||
|
||||
// Elevated button theme
|
||||
elevatedButtonTheme: ElevatedButtonThemeData(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: AppColors.success,
|
||||
foregroundColor: Colors.white,
|
||||
elevation: 0,
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: AppSpacing.lg,
|
||||
vertical: AppSpacing.md,
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(AppSpacing.radiusMedium),
|
||||
),
|
||||
textStyle: textTheme.labelLarge,
|
||||
),
|
||||
),
|
||||
|
||||
// Outlined button theme
|
||||
outlinedButtonTheme: OutlinedButtonThemeData(
|
||||
style: OutlinedButton.styleFrom(
|
||||
foregroundColor: colorScheme.primary,
|
||||
side: BorderSide(color: colorScheme.outline),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: AppSpacing.lg,
|
||||
vertical: AppSpacing.md,
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(AppSpacing.radiusMedium),
|
||||
),
|
||||
textStyle: textTheme.labelLarge,
|
||||
),
|
||||
),
|
||||
|
||||
// Text button theme
|
||||
textButtonTheme: TextButtonThemeData(
|
||||
style: TextButton.styleFrom(
|
||||
foregroundColor: colorScheme.primary,
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: AppSpacing.md,
|
||||
vertical: AppSpacing.sm,
|
||||
),
|
||||
textStyle: textTheme.labelLarge,
|
||||
),
|
||||
),
|
||||
|
||||
// FAB theme
|
||||
floatingActionButtonTheme: FloatingActionButtonThemeData(
|
||||
backgroundColor: AppColors.success,
|
||||
foregroundColor: Colors.white,
|
||||
elevation: 4,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(AppSpacing.radiusMedium),
|
||||
),
|
||||
),
|
||||
|
||||
// Bottom navigation bar theme
|
||||
bottomNavigationBarTheme: BottomNavigationBarThemeData(
|
||||
backgroundColor: AppColors.surface,
|
||||
selectedItemColor: colorScheme.primary,
|
||||
unselectedItemColor: colorScheme.onSurface.withValues(alpha: 0.6),
|
||||
selectedLabelStyle: textTheme.labelSmall,
|
||||
unselectedLabelStyle: textTheme.labelSmall,
|
||||
type: BottomNavigationBarType.fixed,
|
||||
elevation: 0,
|
||||
),
|
||||
|
||||
// Icon theme
|
||||
iconTheme: IconThemeData(color: colorScheme.onSurface, size: 24),
|
||||
|
||||
// Divider theme
|
||||
dividerTheme: DividerThemeData(
|
||||
color: colorScheme.outline,
|
||||
thickness: 1,
|
||||
space: 1,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// Placeholder for dark theme
|
||||
static ThemeData darkTheme() {
|
||||
return lightTheme(); // TODO: Implement dark theme in future
|
||||
}
|
||||
|
||||
AppTheme._();
|
||||
}
|
||||
Reference in New Issue
Block a user