Skip to content

Commit

Permalink
Merge pull request #6 from mospolytech-solar-regatta/SR
Browse files Browse the repository at this point in the history
Sr
  • Loading branch information
PaderGIN authored Apr 22, 2024
2 parents 9b1038e + c7e7bee commit d95468c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
4 changes: 3 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ class WidgetBlock extends StatelessWidget {
child: Column(
children: <Widget>[
Expanded(
flex: 5,
child: TelemetryWidget([
TelemetryProperty(('position_lat'), TextStyle(fontSize: 30.sp, color: const Color(0xFFFFFFFF), fontWeight: FontWeight.bold,fontFamily: 'Inter',), TextStyle(fontSize: 30.sp, color: const Color(0xFF72BBFF), fontWeight: FontWeight.bold,fontFamily: 'Inter',)),
TelemetryProperty(('position_lng'),TextStyle(fontSize: 30.sp, color: const Color(0xFFFFFFFF), fontWeight: FontWeight.bold,fontFamily: 'Inter',), TextStyle(fontSize: 30.sp, color: const Color(0xFF72BBFF), fontWeight: FontWeight.bold,fontFamily: 'Inter',)),
Expand All @@ -129,6 +130,7 @@ class WidgetBlock extends StatelessWidget {
]),
),
Expanded(
flex: 4,
child: TelemetryWidget([
TelemetryProperty(('speed'),TextStyle(fontSize: 96.sp, color: const Color(0xFFFFFFFF), fontWeight: FontWeight.bold,), TextStyle(fontSize: 40.sp, color: const Color(0xFF72BBFF), fontWeight: FontWeight.bold,))
]),
Expand Down Expand Up @@ -156,7 +158,7 @@ class TelemetryButton extends StatelessWidget {

@override
Widget build(BuildContext context) {
const double width = 255 * 0.85;
const double width = 220 * 0.85;
const double height = 114 * 0.75;

return SizedBox(
Expand Down
3 changes: 3 additions & 0 deletions lib/store/dataModels.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ class TelemetryMetric {
if (name == 'motor_temp') {
return motorTemp.toStringAsFixed(1);
}
if (name == 'speed') {
return speed.toStringAsFixed(1);
}
return model[name];
}

Expand Down
20 changes: 4 additions & 16 deletions lib/telemetryWidget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ class _TelemetryWidgetState extends State<TelemetryWidget> {
],
);
break;

case 'speed':
subtitle = Column(
crossAxisAlignment: CrossAxisAlignment.center,
Expand Down Expand Up @@ -194,7 +193,6 @@ class _TelemetryWidgetState extends State<TelemetryWidget> {
],
);
break;

case 'motor_temp':
subtitle = Stack(
children: [
Expand All @@ -216,10 +214,8 @@ class _TelemetryWidgetState extends State<TelemetryWidget> {
],
),
Positioned(
left: 230.w,
// Позиция слева от левого края Row
bottom: 20,
// Позиция снизу на 10 пикселей
left: 290.w,
bottom: 25,
child: Text(
'°C',
style: TextStyle(
Expand All @@ -239,12 +235,10 @@ class _TelemetryWidgetState extends State<TelemetryWidget> {
children: [
Image.asset(
'assets/images/controller.png',
// путь к изображению
width: 93.w,
height: 93.h,
),
SizedBox(width: 15.w),
// Добавьте отступ между картинкой и текстом
Text(
'$value',
style: textStyle,
Expand All @@ -253,10 +247,8 @@ class _TelemetryWidgetState extends State<TelemetryWidget> {
],
),
Positioned(
left: 225.w,
// Позиция слева от левого края Row
left: 290.w,
bottom: 10,
// Позиция снизу на 10 пикселей
child: Text(
'B',
style: TextStyle(
Expand All @@ -276,12 +268,10 @@ class _TelemetryWidgetState extends State<TelemetryWidget> {
children: [
Image.asset(
'assets/images/batary.png',
// путь к изображению
width: 108.w,
height: 105.h,
),
SizedBox(width: 15.w),
// Добавьте отступ между картинкой и текстом
Text(
'$value',
style: textStyle,
Expand All @@ -290,10 +280,8 @@ class _TelemetryWidgetState extends State<TelemetryWidget> {
],
),
Positioned(
left: 240.w,
// Позиция слева от левого края Row
left: 290.w,
bottom: 10,
// Позиция снизу на 10 пикселей
child: Text(
'Min',
style: TextStyle(
Expand Down

0 comments on commit d95468c

Please sign in to comment.