extra material and simulink creation script
This commit is contained in:
@@ -52,65 +52,90 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
||||
backgroundColor: Colors.black,
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.all(32),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
child: Row(
|
||||
children: [
|
||||
// Header
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'SMART SEROW',
|
||||
style: Theme.of(context).textTheme.titleMedium?.copyWith(
|
||||
color: Colors.teal,
|
||||
letterSpacing: 2,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'${_voltage.toStringAsFixed(1)}V',
|
||||
style: Theme.of(context).textTheme.titleMedium?.copyWith(
|
||||
color: _voltage < 12.0 ? Colors.red : Colors.green,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
const SizedBox(height: 48),
|
||||
|
||||
// Main Pi temperature display
|
||||
// Left side: All dashboard widgets (flex: 2)
|
||||
Expanded(
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
_piTemp != null ? _piTemp!.toStringAsFixed(1) : '—',
|
||||
style: const TextStyle(
|
||||
fontSize: 180,
|
||||
fontWeight: FontWeight.w200,
|
||||
color: Colors.white,
|
||||
height: 1,
|
||||
flex: 2,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
// Header
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'SMART SEROW',
|
||||
style: Theme.of(context).textTheme.titleMedium?.copyWith(
|
||||
color: Colors.teal,
|
||||
letterSpacing: 2,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'${_voltage.toStringAsFixed(1)}V',
|
||||
style: Theme.of(context).textTheme.titleMedium?.copyWith(
|
||||
color: _voltage < 12.0 ? Colors.red : Colors.green,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
const SizedBox(height: 48),
|
||||
|
||||
// Main Pi temperature display
|
||||
Expanded(
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
_piTemp != null ? _piTemp!.toStringAsFixed(1) : '—',
|
||||
style: const TextStyle(
|
||||
fontSize: 180,
|
||||
fontWeight: FontWeight.w200,
|
||||
color: Colors.white,
|
||||
height: 1,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'Pi Temp',
|
||||
style: Theme.of(context).textTheme.headlineSmall?.copyWith(
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'Pi Temp',
|
||||
style: Theme.of(context).textTheme.headlineSmall?.copyWith(
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
// Bottom stats row
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
StatBox(label: 'RPM', value: _rpm.toString()),
|
||||
StatBox(label: 'ENG', value: '$_temp°C'),
|
||||
StatBox(label: 'GEAR', value: '—'),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
// Bottom stats row
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
StatBox(label: 'RPM', value: _rpm.toString()),
|
||||
StatBox(label: 'ENG', value: '$_temp°C'),
|
||||
StatBox(label: 'GEAR', value: '—'),
|
||||
],
|
||||
const SizedBox(width: 32),
|
||||
|
||||
// Right side: Image display (flex: 1)
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
'assets/images/rei_default.png',
|
||||
fit: BoxFit.contain,
|
||||
errorBuilder: (context, error, stackTrace) {
|
||||
// Graceful fallback - empty box if image missing
|
||||
return const SizedBox.shrink();
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user