pi ui accelerometer widget

This commit is contained in:
Mikkeli Matlock
2026-02-04 23:19:24 +09:00
parent 4a830dde91
commit 8044bbde94
6 changed files with 309 additions and 16 deletions

View File

@@ -64,7 +64,7 @@ class WhiskeyMark extends StatelessWidget {
Text(
'Roll: ${_formatAngle(roll)}',
style: TextStyle(
fontSize: fontSize * 0.8,
fontSize: fontSize * 0.5,
fontWeight: FontWeight.w400,
fontFeatures: const [FontFeature.tabularFigures()],
color: theme.foreground,
@@ -74,7 +74,7 @@ class WhiskeyMark extends StatelessWidget {
Text(
'P: ${_formatAngle(pitch)}',
style: TextStyle(
fontSize: fontSize * 0.8,
fontSize: fontSize * 0.5,
fontWeight: FontWeight.w400,
fontFeatures: const [FontFeature.tabularFigures()],
color: theme.subdued,
@@ -101,7 +101,9 @@ class WhiskeyMark extends StatelessWidget {
String _formatAngle(double? angle) {
if (angle == null) return '—°';
return '${angle.round()}°';
return '${
angle.round() > 180 ? angle.round() - 360 : angle.round()
}°';
}
}