|
|
|
@ -2,8 +2,10 @@ import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-
|
|
|
|
|
import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/date-utils.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/charts/app_time_series_chart.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
import 'package:charts_flutter/flutter.dart' as charts;
|
|
|
|
@ -29,8 +31,8 @@ class VitalSingChartAndDetials extends StatelessWidget {
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
generateData();
|
|
|
|
|
return Column(
|
|
|
|
|
generateData();
|
|
|
|
|
return timeSeriesData.length != 0 ? Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppExpandableNotifier(
|
|
|
|
|
// isExpand: true,
|
|
|
|
@ -43,6 +45,12 @@ class VitalSingChartAndDetials extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
) : Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
height: MediaQuery.of(context).size.height,
|
|
|
|
|
child: Center(
|
|
|
|
|
child: AppText(TranslationBase.of(context).vitalSignDetailEmpty),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -50,14 +58,14 @@ class VitalSingChartAndDetials extends StatelessWidget {
|
|
|
|
|
if (vitalList.length > 0) {
|
|
|
|
|
vitalList.reversed.toList().forEach(
|
|
|
|
|
(element) {
|
|
|
|
|
DateTime elementDate = DateUtils.getDateTimeFromServerFormat(element.createdOn);
|
|
|
|
|
if( element.toJson()[viewKey]!=null && element.toJson()[viewKey]?.toInt()!=0)
|
|
|
|
|
timeSeriesData.add(
|
|
|
|
|
TimeSeriesSales2(
|
|
|
|
|
new DateTime(elementDate.year, elementDate.month, elementDate.day),
|
|
|
|
|
element.toJson()[viewKey].toDouble(),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
DateTime elementDate = DateUtils.getDateTimeFromServerFormat(element.createdOn);
|
|
|
|
|
if(element.toJson()[viewKey]!=null && element.toJson()[viewKey]?.toInt()!=0)
|
|
|
|
|
timeSeriesData.add(
|
|
|
|
|
TimeSeriesSales2(
|
|
|
|
|
new DateTime(elementDate.year, elementDate.month, elementDate.day),
|
|
|
|
|
element.toJson()[viewKey].toDouble(),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|