- 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.
20 lines
585 B
Dart
20 lines
585 B
Dart
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
|
|
// Default sensor IDs for the 6 dashboard tile slots
|
|
const _defaultSlots = ['vss', 'map', 'tps', 'ect', 'iat', 'bat'];
|
|
|
|
class DashboardSlotsNotifier extends StateNotifier<List<String>> {
|
|
DashboardSlotsNotifier() : super(List.from(_defaultSlots));
|
|
|
|
void setSlot(int index, String sensorId) {
|
|
final next = List<String>.from(state);
|
|
next[index] = sensorId;
|
|
state = next;
|
|
}
|
|
}
|
|
|
|
final dashboardSlotsProvider =
|
|
StateNotifierProvider<DashboardSlotsNotifier, List<String>>(
|
|
(ref) => DashboardSlotsNotifier(),
|
|
);
|