Flask backend and ui tweaks

This commit is contained in:
Mikkeli Matlock
2026-01-26 11:35:17 +09:00
parent 38229543af
commit 60a1c1811e
10 changed files with 221 additions and 43 deletions

View File

@@ -76,21 +76,31 @@ class _DashboardScreenState extends State<DashboardScreen> {
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Text(
'CHASSIS VOLTAGE ',
style: Theme.of(context).textTheme.titleMedium?.copyWith(
fontSize: 80,
color: theme.subdued,
letterSpacing: 1,
Expanded(
flex: 3,
child: Container(),
),
Expanded(
flex: 3,
child: Text(
'Chassis voltage ',
style: Theme.of(context).textTheme.titleMedium?.copyWith(
fontSize: 60,
color: theme.subdued,
letterSpacing: 1,
),
),
),
Text(
'${_voltage.toStringAsFixed(1)}V',
style: Theme.of(context).textTheme.titleMedium?.copyWith(
fontSize: 80,
color: _voltage < 11.9 ? theme.highlight : theme.foreground,
Expanded(
flex: 1,
child: Text(
'${_voltage.toStringAsFixed(1)}V',
style: Theme.of(context).textTheme.titleMedium?.copyWith(
fontSize: 80,
color: _voltage < 11.9 ? theme.highlight : theme.foreground,
),
),
),
)
],
),
@@ -125,7 +135,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
// Bottom stats row
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
StatBox(label: 'RPM', value: _rpm.toString()),
StatBox(label: 'ENG', value: '$_temp°C'),

View File

@@ -20,13 +20,15 @@ class SplashScreen extends StatelessWidget {
children: [
Icon(
Icons.terrain,
size: 120,
size: 240,
color: theme.subdued,
// replace with custom logo later
),
const SizedBox(height: 24),
Text(
'Smart Serow',
style: Theme.of(context).textTheme.headlineLarge?.copyWith(
fontSize: 160,
color: theme.foreground,
fontWeight: FontWeight.bold,
),
@@ -35,6 +37,7 @@ class SplashScreen extends StatelessWidget {
Text(
status,
style: Theme.of(context).textTheme.bodyLarge?.copyWith(
fontSize: 80,
color: theme.subdued,
),
),

View File

@@ -30,7 +30,7 @@ class TestFlipFlopService {
_timer = Timer.periodic(const Duration(seconds: 2), (_) {
// Toggle theme
ThemeService.instance.toggle();
// ThemeService.instance.toggle();
// Surprise the navigator
if (navigatorKey.currentState?.emotion == 'surprise') {

View File

@@ -13,24 +13,27 @@ class StatBox extends StatelessWidget {
Widget build(BuildContext context) {
final theme = AppTheme.of(context);
return Column(
children: [
Text(
value,
style: Theme.of(context).textTheme.headlineMedium?.copyWith(
fontSize: 100,
color: theme.foreground,
return Expanded(
flex: 1,
child: Column(
children: [
Text(
value,
style: Theme.of(context).textTheme.headlineMedium?.copyWith(
fontSize: 100,
color: theme.foreground,
),
),
),
Text(
label,
style: Theme.of(context).textTheme.bodySmall?.copyWith(
fontSize: 80,
color: theme.subdued,
letterSpacing: 1,
Text(
label,
style: Theme.of(context).textTheme.bodySmall?.copyWith(
fontSize: 80,
color: theme.subdued,
letterSpacing: 1,
),
),
),
],
],
)
);
}
}