|
|
|
|
@ -1,25 +1,34 @@
|
|
|
|
|
import 'dart:developer';
|
|
|
|
|
|
|
|
|
|
import 'package:diplomaticquarterapp/config/size_config.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/medical/my_trackers/ble_device_type_screens/checkme_ecg_info_screen.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/medical/my_trackers/ble_models/checkmepro_all_in_one_models/checkme_bp_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/medical/my_trackers/ble_models/checkmepro_all_in_one_models/checkme_ecg_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/medical/my_trackers/ble_models/checkmepro_all_in_one_models/checkme_glucose_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/medical/my_trackers/ble_models/checkmepro_all_in_one_models/checkme_oxi_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/medical/my_trackers/ble_models/checkmepro_all_in_one_models/checkme_temperature_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/medical/my_trackers/ble_models/smart_ring_models.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/medical/my_trackers/my_trackers_view_model/my_trackers_view_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:intl/intl.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
class SmartRingInfoScreen extends StatelessWidget {
|
|
|
|
|
class SmartRingInfoScreen extends StatefulWidget {
|
|
|
|
|
final SmartRingOperationsEnum smartRingOperationsEnum;
|
|
|
|
|
|
|
|
|
|
const SmartRingInfoScreen(this.smartRingOperationsEnum);
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
State<SmartRingInfoScreen> createState() => _SmartRingInfoScreenState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _SmartRingInfoScreenState extends State<SmartRingInfoScreen> {
|
|
|
|
|
MyTrackersViewModel myTrackersViewModel;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
myTrackersViewModel = context.read<MyTrackersViewModel>();
|
|
|
|
|
super.initState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void dispose() {
|
|
|
|
|
myTrackersViewModel.stopSportsModeDataSmartRing();
|
|
|
|
|
super.dispose();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String getTrackerNameByEnum(SmartRingOperationsEnum typeEnum) {
|
|
|
|
|
switch (typeEnum) {
|
|
|
|
|
case SmartRingOperationsEnum.Temperature:
|
|
|
|
|
@ -28,10 +37,10 @@ class SmartRingInfoScreen extends StatelessWidget {
|
|
|
|
|
case SmartRingOperationsEnum.BloodOxygen:
|
|
|
|
|
return "Blood Oxygen";
|
|
|
|
|
|
|
|
|
|
case SmartRingOperationsEnum.HeartRateDynamic:
|
|
|
|
|
case SmartRingOperationsEnum.RealTimeHeartRate:
|
|
|
|
|
return "HeartRate Dynamic";
|
|
|
|
|
|
|
|
|
|
case SmartRingOperationsEnum.HeartRateStatic:
|
|
|
|
|
case SmartRingOperationsEnum.HeartRate:
|
|
|
|
|
return "HeartRate Static";
|
|
|
|
|
|
|
|
|
|
case SmartRingOperationsEnum.HRV:
|
|
|
|
|
@ -39,6 +48,12 @@ class SmartRingInfoScreen extends StatelessWidget {
|
|
|
|
|
|
|
|
|
|
case SmartRingOperationsEnum.BatteryLevel:
|
|
|
|
|
return "Battery Level";
|
|
|
|
|
|
|
|
|
|
case SmartRingOperationsEnum.TotalStepCount:
|
|
|
|
|
return "Total Step Count";
|
|
|
|
|
|
|
|
|
|
case SmartRingOperationsEnum.SportsMode:
|
|
|
|
|
return "Sports Mode";
|
|
|
|
|
}
|
|
|
|
|
return "Battery Level";
|
|
|
|
|
}
|
|
|
|
|
@ -47,17 +62,21 @@ class SmartRingInfoScreen extends StatelessWidget {
|
|
|
|
|
switch (smartRingOperationsEnum) {
|
|
|
|
|
case SmartRingOperationsEnum.Temperature:
|
|
|
|
|
return buildTemperatureWidget(myTrackersVm, context);
|
|
|
|
|
case SmartRingOperationsEnum.HeartRateStatic:
|
|
|
|
|
case SmartRingOperationsEnum.HeartRate:
|
|
|
|
|
return buildHeartRateStaticWidget(myTrackersVm, context);
|
|
|
|
|
case SmartRingOperationsEnum.HeartRateDynamic:
|
|
|
|
|
case SmartRingOperationsEnum.RealTimeHeartRate:
|
|
|
|
|
return buildHeartRateDynamicWidget(myTrackersVm, context);
|
|
|
|
|
case SmartRingOperationsEnum.TotalStepCount:
|
|
|
|
|
return buildTotalStepCountHistoryWidget(myTrackersVm, context);
|
|
|
|
|
case SmartRingOperationsEnum.HRV:
|
|
|
|
|
return buildHrvWidget(myTrackersVm, context);
|
|
|
|
|
case SmartRingOperationsEnum.BloodOxygen:
|
|
|
|
|
// TODO: Handle this case.
|
|
|
|
|
break;
|
|
|
|
|
return buildBloodOxygenWidget(myTrackersVm, context);
|
|
|
|
|
case SmartRingOperationsEnum.BatteryLevel:
|
|
|
|
|
return buildBatteryLevelWidget(myTrackersVm, context);
|
|
|
|
|
case SmartRingOperationsEnum.SportsMode:
|
|
|
|
|
return buildRtSportsDataSmartRingWidget(myTrackersVm, context);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return getNoDataWidget(context);
|
|
|
|
|
}
|
|
|
|
|
@ -167,6 +186,64 @@ class SmartRingInfoScreen extends StatelessWidget {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget buildRtSportsDataSmartRingWidget(MyTrackersViewModel myTrackersVm, BuildContext context) {
|
|
|
|
|
if (myTrackersVm.filesLoader) {
|
|
|
|
|
return Center(child: CircularProgressIndicator());
|
|
|
|
|
} else if (myTrackersVm.rtSportDataSmartRingModel != null) {
|
|
|
|
|
return Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
mHeight(24.0),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
|
|
|
children: [
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
Text("Step", style: TextStyle(fontSize: 20)),
|
|
|
|
|
Text(myTrackersViewModel.rtSportDataSmartRingModel.step.toString(), style: TextStyle(fontSize: 50, fontWeight: FontWeight.bold)),
|
|
|
|
|
Text("", style: TextStyle(fontSize: 10)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
Text("Calories", style: TextStyle(fontSize: 20)),
|
|
|
|
|
Text(myTrackersViewModel.rtSportDataSmartRingModel.calories.toString(), style: TextStyle(fontSize: 50, fontWeight: FontWeight.bold)),
|
|
|
|
|
Text("kCal", style: TextStyle(fontSize: 10)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
Text("♥︎", style: TextStyle(fontSize: 20)),
|
|
|
|
|
Text(myTrackersViewModel.rtSportDataSmartRingModel.heartRate.toString(), style: TextStyle(fontSize: 50, fontWeight: FontWeight.bold)),
|
|
|
|
|
Text("/min", style: TextStyle(fontSize: 10)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
mHeight(30.0),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
Text("Time", style: TextStyle(fontSize: 20)),
|
|
|
|
|
Text(myTrackersViewModel.rtSportDataSmartRingModel.exerciseTime.toString(), style: TextStyle(fontSize: 50, fontWeight: FontWeight.bold)),
|
|
|
|
|
Text("seconds", style: TextStyle(fontSize: 10)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
// buildStatusForBP(myTrackersViewModel.bpRtResultModel.result),
|
|
|
|
|
// mHeight(24.0),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
return getNoDataWidget(context);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget buildHrvWidget(MyTrackersViewModel myTrackersVm, BuildContext context) {
|
|
|
|
|
if (myTrackersVm.filesLoader) {
|
|
|
|
|
return Center(child: CircularProgressIndicator());
|
|
|
|
|
@ -187,6 +264,8 @@ class SmartRingInfoScreen extends StatelessWidget {
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Text("Date: ${smartRingHrvModel.date}"),
|
|
|
|
|
mHeight(4.0),
|
|
|
|
|
Text("highBP: ${smartRingHrvModel.highBP}"),
|
|
|
|
|
mHeight(4.0),
|
|
|
|
|
Text("lowBP: ${smartRingHrvModel.lowBP}"),
|
|
|
|
|
@ -210,189 +289,104 @@ class SmartRingInfoScreen extends StatelessWidget {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget buildBatteryLevelWidget(MyTrackersViewModel myTrackersVm, BuildContext context) {
|
|
|
|
|
Widget buildTotalStepCountHistoryWidget(MyTrackersViewModel myTrackersVm, BuildContext context) {
|
|
|
|
|
if (myTrackersVm.filesLoader) {
|
|
|
|
|
return Center(child: CircularProgressIndicator());
|
|
|
|
|
} else if (myTrackersVm.smartRingBatteryLevel != null && myTrackersVm.smartRingBatteryLevel.isNotEmpty) {
|
|
|
|
|
return Center(
|
|
|
|
|
child: Text("Battery Level: ${myTrackersVm.smartRingBatteryLevel}"),
|
|
|
|
|
} else if (myTrackersVm.smartRingStepCountHistory != null && myTrackersVm.smartRingStepCountHistory.isNotEmpty) {
|
|
|
|
|
return Expanded(
|
|
|
|
|
child: ListView.separated(
|
|
|
|
|
itemCount: myTrackersVm.smartRingStepCountHistory.length,
|
|
|
|
|
separatorBuilder: (context, index) => SizedBox(height: 14),
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
reverse: false,
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
SmartRingStepCountModel smartRingStepCountModel = myTrackersVm.smartRingStepCountHistory[index];
|
|
|
|
|
return InkWell(
|
|
|
|
|
onTap: () => Navigator.pop(context),
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration: cardRadius(12),
|
|
|
|
|
padding: EdgeInsets.all(12.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Text("date: ${smartRingStepCountModel.date}"),
|
|
|
|
|
mHeight(4.0),
|
|
|
|
|
Text("calories: ${smartRingStepCountModel.calories}"),
|
|
|
|
|
mHeight(4.0),
|
|
|
|
|
Text("distance: ${smartRingStepCountModel.distance}"),
|
|
|
|
|
mHeight(4.0),
|
|
|
|
|
Text("exerciseMinutes: ${smartRingStepCountModel.exerciseMinutes}"),
|
|
|
|
|
mHeight(4.0),
|
|
|
|
|
Text("exerciseTime: ${smartRingStepCountModel.exerciseTime}"),
|
|
|
|
|
mHeight(4.0),
|
|
|
|
|
Text("distance: ${smartRingStepCountModel.distance}"),
|
|
|
|
|
mHeight(4.0),
|
|
|
|
|
Text("goal: ${smartRingStepCountModel.goal}"),
|
|
|
|
|
mHeight(4.0),
|
|
|
|
|
Text("step: ${smartRingStepCountModel.step}"),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
return getNoDataWidget(context);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget buildECGWidget(MyTrackersViewModel myTrackersVm, BuildContext context) {
|
|
|
|
|
return Column(
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
children: [
|
|
|
|
|
if (myTrackersVm.filesLoader) ...[
|
|
|
|
|
Center(child: CircularProgressIndicator())
|
|
|
|
|
] else if (myTrackersVm.checkMeEcg != null && myTrackersVm.checkMeEcg.isNotEmpty) ...[
|
|
|
|
|
Material(
|
|
|
|
|
child: ListView.separated(
|
|
|
|
|
itemCount: myTrackersVm.checkMeEcg.length,
|
|
|
|
|
separatorBuilder: (context, index) => SizedBox(height: 14),
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
reverse: false,
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
CheckMeECGModel checkMeECGModel = myTrackersVm.checkMeEcg[index];
|
|
|
|
|
return InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
myTrackersVm.getEcgWaveDataFromCheckMePro(checkMeECGModel.timeString);
|
|
|
|
|
// Navigator.push(context, MaterialPageRoute(builder: (context) => CheckMeECGInfoScreen(SmartRingOperationsEnum.ECGTracker)));
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration: cardRadius(12),
|
|
|
|
|
padding: EdgeInsets.all(12.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Text("Date: ${checkMeECGModel.date}"),
|
|
|
|
|
mHeight(8),
|
|
|
|
|
Text("TimeString: ${checkMeECGModel.timeString}"),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
] else ...[
|
|
|
|
|
getNoDataWidget(context),
|
|
|
|
|
]
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget buildOxiWidget(MyTrackersViewModel myTrackersVm, BuildContext context) {
|
|
|
|
|
return Column(
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
children: [
|
|
|
|
|
if (myTrackersVm.filesLoader) ...[
|
|
|
|
|
Center(child: CircularProgressIndicator())
|
|
|
|
|
] else if (myTrackersVm.checkMeOxi != null && myTrackersVm.checkMeOxi.isNotEmpty) ...[
|
|
|
|
|
Material(
|
|
|
|
|
child: ListView.separated(
|
|
|
|
|
itemCount: myTrackersVm.checkMeOxi.length,
|
|
|
|
|
separatorBuilder: (context, index) => SizedBox(height: 14),
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
reverse: false,
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
CheckMeOxiModel checkMeOxiModel = myTrackersVm.checkMeOxi[index];
|
|
|
|
|
return InkWell(
|
|
|
|
|
onTap: () => Navigator.pop(context),
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration: cardRadius(12),
|
|
|
|
|
padding: EdgeInsets.all(12.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Text("PR: ${checkMeOxiModel.pr} PI: ${checkMeOxiModel.pi}"),
|
|
|
|
|
mHeight(4.0),
|
|
|
|
|
Text("Oxi: ${checkMeOxiModel.oxy}"),
|
|
|
|
|
mHeight(4.0),
|
|
|
|
|
Text("Date: ${checkMeOxiModel.date}"),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
] else ...[
|
|
|
|
|
getNoDataWidget(context),
|
|
|
|
|
]
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget buildBPWidget(MyTrackersViewModel myTrackersVm, BuildContext context) {
|
|
|
|
|
return Column(
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
children: [
|
|
|
|
|
if (myTrackersVm.filesLoader) ...[
|
|
|
|
|
Center(child: CircularProgressIndicator())
|
|
|
|
|
] else if (myTrackersVm.checkMeBP != null && myTrackersVm.checkMeBP.isNotEmpty) ...[
|
|
|
|
|
Material(
|
|
|
|
|
child: ListView.separated(
|
|
|
|
|
itemCount: myTrackersVm.checkMeBP.length,
|
|
|
|
|
separatorBuilder: (context, index) => SizedBox(height: 14),
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
reverse: false,
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
CheckMeBPModel checkMeBPModel = myTrackersVm.checkMeBP[index];
|
|
|
|
|
return InkWell(
|
|
|
|
|
onTap: () => Navigator.pop(context),
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration: cardRadius(12),
|
|
|
|
|
padding: EdgeInsets.all(12.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Text("DIA: ${checkMeBPModel.dia} SYS: ${checkMeBPModel.sys}"),
|
|
|
|
|
mHeight(4.0),
|
|
|
|
|
Text("PR: ${checkMeBPModel.pr}"),
|
|
|
|
|
mHeight(4.0),
|
|
|
|
|
Text("Date: ${checkMeBPModel.date}"),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
] else ...[
|
|
|
|
|
getNoDataWidget(context),
|
|
|
|
|
]
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
Widget buildBloodOxygenWidget(MyTrackersViewModel myTrackersVm, BuildContext context) {
|
|
|
|
|
if (myTrackersVm.filesLoader) {
|
|
|
|
|
return Center(child: CircularProgressIndicator());
|
|
|
|
|
} else if (myTrackersVm.smartRingBloodOxygenHistory != null && myTrackersVm.smartRingBloodOxygenHistory.isNotEmpty) {
|
|
|
|
|
return Expanded(
|
|
|
|
|
child: ListView.separated(
|
|
|
|
|
itemCount: myTrackersVm.smartRingBloodOxygenHistory.length,
|
|
|
|
|
separatorBuilder: (context, index) => SizedBox(height: 14),
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
reverse: false,
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
SmartRingGenericModel smartRingGenericModel = myTrackersVm.smartRingBloodOxygenHistory[index];
|
|
|
|
|
return InkWell(
|
|
|
|
|
onTap: () => Navigator.pop(context),
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration: cardRadius(12),
|
|
|
|
|
padding: EdgeInsets.all(12.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Text("Date: ${smartRingGenericModel.date}"),
|
|
|
|
|
mHeight(4.0),
|
|
|
|
|
Text("BloodOxygen: ${smartRingGenericModel.value}"),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
return getNoDataWidget(context);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget buildGlucoseWidget(MyTrackersViewModel myTrackersVm, BuildContext context) {
|
|
|
|
|
return Column(
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
children: [
|
|
|
|
|
if (myTrackersVm.filesLoader) ...[
|
|
|
|
|
Center(child: CircularProgressIndicator())
|
|
|
|
|
] else if (myTrackersVm.checkMeGlucose != null && myTrackersVm.checkMeGlucose.isNotEmpty) ...[
|
|
|
|
|
Material(
|
|
|
|
|
child: ListView.separated(
|
|
|
|
|
itemCount: myTrackersVm.checkMeGlucose.length,
|
|
|
|
|
separatorBuilder: (context, index) => SizedBox(height: 14),
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
reverse: false,
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
CheckMeGlucoseModel checkMeGlucoseModel = myTrackersVm.checkMeGlucose[index];
|
|
|
|
|
return InkWell(
|
|
|
|
|
onTap: () => null,
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration: cardRadius(12),
|
|
|
|
|
padding: EdgeInsets.all(12.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Text("Glucose: ${checkMeGlucoseModel.glu}"),
|
|
|
|
|
mHeight(4.0),
|
|
|
|
|
Text("Date: ${checkMeGlucoseModel.date}"),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
] else ...[
|
|
|
|
|
getNoDataWidget(context),
|
|
|
|
|
]
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
Widget buildBatteryLevelWidget(MyTrackersViewModel myTrackersVm, BuildContext context) {
|
|
|
|
|
if (myTrackersVm.filesLoader) {
|
|
|
|
|
return Center(child: CircularProgressIndicator());
|
|
|
|
|
} else if (myTrackersVm.smartRingBatteryLevel != null && myTrackersVm.smartRingBatteryLevel.isNotEmpty) {
|
|
|
|
|
return Center(
|
|
|
|
|
child: Text("Battery Level: ${myTrackersVm.smartRingBatteryLevel}"),
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
return getNoDataWidget(context);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return AppScaffold(
|
|
|
|
|
appBarTitle: "${getTrackerNameByEnum(smartRingOperationsEnum)}",
|
|
|
|
|
appBarTitle: "${getTrackerNameByEnum(widget.smartRingOperationsEnum)}",
|
|
|
|
|
showNewAppBar: true,
|
|
|
|
|
isShowDecPage: false,
|
|
|
|
|
showNewAppBarTitle: true,
|
|
|
|
|
@ -403,7 +397,7 @@ class SmartRingInfoScreen extends StatelessWidget {
|
|
|
|
|
children: [
|
|
|
|
|
Consumer(
|
|
|
|
|
builder: (BuildContext context, MyTrackersViewModel myTrackersVm, Widget child) {
|
|
|
|
|
return getAllInOneOperationWidgets(myTrackersVm, smartRingOperationsEnum, context);
|
|
|
|
|
return getAllInOneOperationWidgets(myTrackersVm, widget.smartRingOperationsEnum, context);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
|