- Implemented RawFrameDebugScreen for displaying ECU frame data and diagnostics. - Created DtcScreen to show active Diagnostic Trouble Codes (DTCs) with detailed descriptions. - Added DtcRow widget for individual DTC representation. - Introduced GraphScreen for visualizing sensor data over time with customizable time windows. - Developed SensorListScreen to display available sensors and their current values. - Enhanced SettingsScreen with options for Bluetooth connection, ECU protocol selection, polling interval, and theme settings. - Added AppColors and AppTheme for consistent theming across the application. - Implemented BtStatusChip to show Bluetooth connection status in the app bar. - Created RecordFab for starting and stopping data recording sessions.
56 lines
1.7 KiB
Dart
56 lines
1.7 KiB
Dart
import 'package:flutter/material.dart';
|
|
import '../../core/providers/theme_provider.dart';
|
|
import 'app_colors.dart';
|
|
|
|
class AppTheme {
|
|
static ThemeData build(AppThemeVariant variant) {
|
|
final colors = AppColors.forTheme(variant);
|
|
final isDark = variant.isDark;
|
|
|
|
return ThemeData(
|
|
useMaterial3: true,
|
|
brightness: isDark ? Brightness.dark : Brightness.light,
|
|
scaffoldBackgroundColor: colors.background,
|
|
colorScheme: ColorScheme.fromSeed(
|
|
seedColor: colors.accent,
|
|
brightness: isDark ? Brightness.dark : Brightness.light,
|
|
).copyWith(
|
|
primary: colors.accent,
|
|
surface: colors.surface,
|
|
),
|
|
appBarTheme: AppBarTheme(
|
|
backgroundColor: colors.surface,
|
|
foregroundColor: colors.onSurface,
|
|
elevation: 0,
|
|
surfaceTintColor: Colors.transparent,
|
|
),
|
|
bottomNavigationBarTheme: BottomNavigationBarThemeData(
|
|
backgroundColor: colors.surface,
|
|
selectedItemColor: colors.accent,
|
|
unselectedItemColor: colors.onSurfaceMuted,
|
|
type: BottomNavigationBarType.fixed,
|
|
elevation: 8,
|
|
),
|
|
cardTheme: CardThemeData(
|
|
color: colors.surface,
|
|
elevation: 0,
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(10),
|
|
),
|
|
),
|
|
dividerTheme: DividerThemeData(
|
|
color: colors.surfaceVariant,
|
|
thickness: 1,
|
|
),
|
|
floatingActionButtonTheme: FloatingActionButtonThemeData(
|
|
backgroundColor: colors.accent,
|
|
foregroundColor: isDark ? Colors.black : Colors.white,
|
|
),
|
|
textTheme: TextTheme(
|
|
bodyMedium: TextStyle(color: colors.onSurface),
|
|
bodySmall: TextStyle(color: colors.onSurfaceMuted),
|
|
),
|
|
);
|
|
}
|
|
}
|