hondavert-dev/lib/ui/screens/datalog/datalog_playback_bar.dart
metatroncubeswdev e4bcfb57a6 Meet Requrements.pdf: selectable dashboard, units, list/graph, light mode, playback
Dashboard
- Selectable main sensor (gauge) + sub sensor, 10 selectable values
  (landscape 5 left + 5 right, portrait 2x5 on one screen) and 4
  selectable flags; long-press to change; persisted.
- Flags: the requirement examples (MIL, FAN Out, VTEC Out, Knock, WBO /
  IAT / CLT Error - errors derived from the stored DTC bits) plus the
  other S300 status bits (cuts, launch, closed loop, VTP, AC, brake).
- Record button moved to the app bar; debug screen moved to Settings.

Sensor list: 1 column on phone portrait, 2 on tablet/landscape; name,
unit, min/max, segmented bar and value.
Graph: auto-scaled Y, window max/min, current value, seconds axis and a
touch cursor; RPM/MAP/TPS/ECT by default.
Units: km/h|mph, degC|degF, kPa|bar|psi (display only), persisted.
Light/dark: palette is a ThemeExtension used by every screen; theme
persisted. SafeArea keeps content off the side navigation bar.
Datalog playback now drives the dashboard, list, graph and DTC screen,
with the playback bar on the main screen and seek updating the displays.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 23:24:28 -04:00

92 lines
3.2 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import '../../../core/datalog/datalog_player.dart';
import '../../../core/providers/datalog_provider.dart';
import '../../theme/app_colors.dart';
class DatalogPlaybackBar extends ConsumerWidget {
final PlaybackState state;
const DatalogPlaybackBar({super.key, required this.state});
@override
Widget build(BuildContext context, WidgetRef ref) {
final notifier = ref.read(playbackProvider.notifier);
final isPlaying = state.status == PlaybackStatus.playing;
final c = AppColors.of(context);
return Container(
color: c.surface,
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
// Progress slider
SliderTheme(
data: SliderTheme.of(context).copyWith(
trackHeight: 3,
thumbShape:
const RoundSliderThumbShape(enabledThumbRadius: 6),
overlayShape:
const RoundSliderOverlayShape(overlayRadius: 12),
),
child: Slider(
value: state.progress,
onChanged: (v) =>
notifier.seek((v * state.total).round()),
),
),
// Controls row
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
// Frame counter
Text(
'${state.position} / ${state.total}',
style:
TextStyle(color: c.onSurfaceMuted, fontSize: 11),
),
// Play / Pause / Stop
Row(
children: [
IconButton(
icon: Icon(
isPlaying ? Icons.pause : Icons.play_arrow,
size: 22,
),
onPressed: isPlaying ? notifier.pause : notifier.play,
padding: const EdgeInsets.all(4),
constraints: const BoxConstraints(),
),
const SizedBox(width: 8),
IconButton(
icon: const Icon(Icons.stop, size: 22),
onPressed: () async => notifier.stop(),
padding: const EdgeInsets.all(4),
constraints: const BoxConstraints(),
),
],
),
// Speed selector
DropdownButton<double>(
value: state.speed,
isDense: true,
underline: const SizedBox(),
style: TextStyle(color: c.onSurface, fontSize: 12),
items: const [
DropdownMenuItem(value: 0.5, child: Text('0.5×')),
DropdownMenuItem(value: 1.0, child: Text('1×')),
DropdownMenuItem(value: 2.0, child: Text('2×')),
DropdownMenuItem(value: 5.0, child: Text('5×')),
],
onChanged: (v) {
if (v != null) notifier.setSpeed(v);
},
),
],
),
],
),
);
}
}