151 lines
4.6 KiB
Dart
151 lines
4.6 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class AppTheme {
|
|
// Colors
|
|
static const Color primaryColor = Color(0xFF2196F3);
|
|
static const Color secondaryColor = Color(0xFF03DAC6);
|
|
static const Color backgroundColor = Color(0xFFF5F5F5);
|
|
static const Color surfaceColor = Colors.white;
|
|
static const Color errorColor = Color(0xFFB00020);
|
|
static const Color successColor = Color(0xFF4CAF50);
|
|
static const Color warningColor = Color(0xFFFFC107);
|
|
|
|
// Status Colors
|
|
static const Color pendingColor = Color(0xFFFF9800);
|
|
static const Color inProgressColor = Color(0xFF2196F3);
|
|
static const Color completedColor = Color(0xFF4CAF50);
|
|
static const Color failedColor = Color(0xFFB00020);
|
|
|
|
// Text Colors
|
|
static const Color textPrimaryColor = Color(0xFF212121);
|
|
static const Color textSecondaryColor = Color(0xFF757575);
|
|
static const Color textHintColor = Color(0xFFBDBDBD);
|
|
|
|
static ThemeData get lightTheme {
|
|
return ThemeData(
|
|
primaryColor: primaryColor,
|
|
scaffoldBackgroundColor: backgroundColor,
|
|
colorScheme: const ColorScheme.light(
|
|
primary: primaryColor,
|
|
secondary: secondaryColor,
|
|
surface: surfaceColor,
|
|
error: errorColor,
|
|
),
|
|
appBarTheme: const AppBarTheme(
|
|
backgroundColor: primaryColor,
|
|
foregroundColor: Colors.white,
|
|
elevation: 2,
|
|
centerTitle: true,
|
|
titleTextStyle: TextStyle(
|
|
fontSize: 20,
|
|
fontWeight: FontWeight.bold,
|
|
color: Colors.white,
|
|
),
|
|
),
|
|
cardTheme: CardTheme(
|
|
elevation: 2,
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(12),
|
|
),
|
|
margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
|
),
|
|
elevatedButtonTheme: ElevatedButtonThemeData(
|
|
style: ElevatedButton.styleFrom(
|
|
backgroundColor: primaryColor,
|
|
foregroundColor: Colors.white,
|
|
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(8),
|
|
),
|
|
textStyle: const TextStyle(
|
|
fontSize: 16,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
),
|
|
floatingActionButtonTheme: const FloatingActionButtonThemeData(
|
|
backgroundColor: primaryColor,
|
|
foregroundColor: Colors.white,
|
|
),
|
|
inputDecorationTheme: InputDecorationTheme(
|
|
filled: true,
|
|
fillColor: Colors.white,
|
|
border: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(8),
|
|
borderSide: const BorderSide(color: Colors.grey),
|
|
),
|
|
enabledBorder: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(8),
|
|
borderSide: const BorderSide(color: Colors.grey),
|
|
),
|
|
focusedBorder: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(8),
|
|
borderSide: const BorderSide(color: primaryColor, width: 2),
|
|
),
|
|
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
|
),
|
|
textTheme: const TextTheme(
|
|
displayLarge: TextStyle(
|
|
fontSize: 32,
|
|
fontWeight: FontWeight.bold,
|
|
color: textPrimaryColor,
|
|
),
|
|
displayMedium: TextStyle(
|
|
fontSize: 28,
|
|
fontWeight: FontWeight.bold,
|
|
color: textPrimaryColor,
|
|
),
|
|
displaySmall: TextStyle(
|
|
fontSize: 24,
|
|
fontWeight: FontWeight.bold,
|
|
color: textPrimaryColor,
|
|
),
|
|
headlineMedium: TextStyle(
|
|
fontSize: 20,
|
|
fontWeight: FontWeight.w600,
|
|
color: textPrimaryColor,
|
|
),
|
|
titleLarge: TextStyle(
|
|
fontSize: 18,
|
|
fontWeight: FontWeight.w600,
|
|
color: textPrimaryColor,
|
|
),
|
|
titleMedium: TextStyle(
|
|
fontSize: 16,
|
|
fontWeight: FontWeight.w500,
|
|
color: textPrimaryColor,
|
|
),
|
|
bodyLarge: TextStyle(
|
|
fontSize: 16,
|
|
color: textPrimaryColor,
|
|
),
|
|
bodyMedium: TextStyle(
|
|
fontSize: 14,
|
|
color: textSecondaryColor,
|
|
),
|
|
bodySmall: TextStyle(
|
|
fontSize: 12,
|
|
color: textSecondaryColor,
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
static Color getStatusColor(String status) {
|
|
switch (status.toLowerCase()) {
|
|
case 'pending':
|
|
case 'notstartedCamel':
|
|
return pendingColor;
|
|
case 'inprogress':
|
|
return inProgressColor;
|
|
case 'completed':
|
|
return completedColor;
|
|
case 'failed':
|
|
case 'cancelled':
|
|
return failedColor;
|
|
default:
|
|
return textSecondaryColor;
|
|
}
|
|
}
|
|
}
|