From 34cd96b1f0046514005012a2e925b1820319f9be Mon Sep 17 00:00:00 2001 From: Lars Refsgaard <1552887+LarsRefsgaard@users.noreply.github.com> Date: Wed, 19 Jul 2023 16:48:10 +0200 Subject: [PATCH] Fix analyze errors --- lib/ui/pages/message_details_page.dart | 4 ++-- lib/ui/pages/study_page.dart | 4 ++-- lib/view_models/cards/heart_rate_data_model.dart | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/ui/pages/message_details_page.dart b/lib/ui/pages/message_details_page.dart index a72dea39..7f643cf3 100644 --- a/lib/ui/pages/message_details_page.dart +++ b/lib/ui/pages/message_details_page.dart @@ -20,7 +20,7 @@ class MessageDetailsPage extends StatelessWidget { subTitle: 'Unknown message', type: MessageType.announcement, timestamp: DateTime.now(), - imagePath: './assets/images/kids.png'); + image: './assets/images/kids.png'); }); return Scaffold( @@ -44,7 +44,7 @@ class MessageDetailsPage extends StatelessWidget { Flexible( child: CustomScrollView( slivers: [ - DetailsBanner(message.title!, message.imagePath), + DetailsBanner(message.title!, message.image), SliverToBoxAdapter( child: Padding( padding: const EdgeInsets.symmetric(horizontal: 30), diff --git a/lib/ui/pages/study_page.dart b/lib/ui/pages/study_page.dart index c90738c5..ca487f68 100644 --- a/lib/ui/pages/study_page.dart +++ b/lib/ui/pages/study_page.dart @@ -59,7 +59,7 @@ class StudyPageState extends State { timeago.setLocaleMessages('da', timeago.DaMessages()); timeago.setLocaleMessages('es', timeago.EsMessages()); - Image messageImage = widget.model.getMessageImage(message.imagePath); + Image messageImage = widget.model.getMessageImage(message.image); return Card( semanticContainer: true, @@ -78,7 +78,7 @@ class StudyPageState extends State { mainAxisAlignment: MainAxisAlignment.center, children: [ Row(children: [ - message.imagePath != null + message.image != null ? Expanded( child: Container( height: 150.0, diff --git a/lib/view_models/cards/heart_rate_data_model.dart b/lib/view_models/cards/heart_rate_data_model.dart index c480211e..53bbdf9d 100644 --- a/lib/view_models/cards/heart_rate_data_model.dart +++ b/lib/view_models/cards/heart_rate_data_model.dart @@ -28,7 +28,7 @@ class HeartRateCardViewModel extends SerializableViewModel { heartRateEvents?.listen( (heartRateDataPoint) { - PolarHR? heartRate = heartRateDataPoint.data as PolarHR; + PolarHRSample? heartRate = heartRateDataPoint.data as PolarHRSample; double hr = heartRate.hr.toDouble(); if (!(hr > 0)) {