You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
223 lines
6.7 KiB
Dart
223 lines
6.7 KiB
Dart
import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/BloodPressureResult.dart';
|
|
import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart';
|
|
import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart';
|
|
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
|
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:charts_flutter/flutter.dart' as charts;
|
|
import 'package:hexcolor/hexcolor.dart';
|
|
|
|
class BloodPressureWeeklyPage extends StatelessWidget {
|
|
final List<charts.Series<WeekChartDate, DateTime>> data;
|
|
final List<BloodPressureResult> diabtecPatientResult;
|
|
|
|
const BloodPressureWeeklyPage({Key key, this.data, this.diabtecPatientResult})
|
|
: super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return AppScaffold(
|
|
body: ListView(
|
|
children: [
|
|
Container(
|
|
width: double.maxFinite,
|
|
height: 180,
|
|
color: Colors.white,
|
|
child: charts.TimeSeriesChart(
|
|
data,
|
|
dateTimeFactory: const charts.LocalDateTimeFactory(),
|
|
),
|
|
),
|
|
SizedBox(
|
|
height: 12,
|
|
),
|
|
Padding(
|
|
padding: const EdgeInsets.all(8.0),
|
|
child: Texts('Details'),
|
|
),
|
|
Container(
|
|
padding: EdgeInsets.all(10),
|
|
color: Colors.transparent,
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: <Widget>[
|
|
Table(
|
|
border: TableBorder.symmetric(
|
|
inside: BorderSide(width: 2.0, color: Colors.grey[300]),
|
|
),
|
|
children: fullData(),
|
|
),
|
|
],
|
|
),
|
|
)
|
|
],
|
|
),
|
|
);
|
|
}
|
|
|
|
List<TableRow> fullData() {
|
|
List<TableRow> tableRow = [];
|
|
tableRow.add(
|
|
TableRow(
|
|
children: [
|
|
Container(
|
|
child: Container(
|
|
decoration: BoxDecoration(
|
|
color: HexColor('#515B5D'),
|
|
borderRadius: BorderRadius.only(
|
|
topLeft: Radius.circular(10.0),
|
|
),
|
|
),
|
|
child: Center(
|
|
child: Texts(
|
|
'Date',
|
|
color: Colors.white,
|
|
fontSize: 15,
|
|
),
|
|
),
|
|
height: 40,
|
|
),
|
|
),
|
|
Container(
|
|
child: Container(
|
|
decoration: BoxDecoration(
|
|
color: HexColor('#515B5D'),
|
|
),
|
|
child: Center(
|
|
child: Texts(
|
|
'Time',
|
|
color: Colors.white,
|
|
fontSize: 15,
|
|
),
|
|
),
|
|
height: 40),
|
|
),
|
|
Container(
|
|
child: Container(
|
|
decoration: BoxDecoration(
|
|
color: HexColor('#515B5D'),
|
|
),
|
|
child: Center(
|
|
child: Texts(
|
|
'Measured',
|
|
color: Colors.white,
|
|
fontSize: 15,
|
|
),
|
|
),
|
|
height: 40),
|
|
),
|
|
Container(
|
|
child: Container(
|
|
decoration: BoxDecoration(
|
|
color: HexColor('#515B5D'),
|
|
),
|
|
child: Center(
|
|
child: Texts(
|
|
'Value',
|
|
color: Colors.white,
|
|
fontSize: 15,
|
|
),
|
|
),
|
|
height: 40),
|
|
),
|
|
Container(
|
|
child: Container(
|
|
decoration: BoxDecoration(
|
|
color: HexColor('#515B5D'),
|
|
borderRadius: BorderRadius.only(
|
|
topRight: Radius.circular(10.0),
|
|
),
|
|
),
|
|
child: Center(
|
|
child: Texts(
|
|
'Edit',
|
|
color: Colors.white,
|
|
fontSize: 15,
|
|
),
|
|
),
|
|
height: 40),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
diabtecPatientResult.forEach(
|
|
(diabtec) {
|
|
tableRow.add(
|
|
TableRow(
|
|
children: [
|
|
Container(
|
|
child: Container(
|
|
height: 70,
|
|
padding: EdgeInsets.all(10),
|
|
color: Colors.white,
|
|
child: Center(
|
|
child: Texts(
|
|
'${DateUtil.getMonthDayYearDateFormatted(diabtec.bloodPressureDate)} ',
|
|
textAlign: TextAlign.center,
|
|
fontSize: 12,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
height: 70,
|
|
padding: EdgeInsets.all(10),
|
|
color: Colors.white,
|
|
child: Center(
|
|
child: Texts(
|
|
'${diabtec.bloodPressureDate.hour}:${diabtec.bloodPressureDate.minute}',
|
|
textAlign: TextAlign.center,
|
|
fontSize: 12,
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
child: Container(
|
|
height: 70,
|
|
padding: EdgeInsets.all(10),
|
|
color: Colors.white,
|
|
child: Center(
|
|
child: Texts(
|
|
'${diabtec.measuredArmDesc}',
|
|
textAlign: TextAlign.center,
|
|
fontSize: 12,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
child: Container(
|
|
height: 70,
|
|
padding: EdgeInsets.all(10),
|
|
color: Colors.white,
|
|
child: Center(
|
|
child: Texts(
|
|
'${diabtec.systolicePressure}/${diabtec.diastolicPressure}',
|
|
textAlign: TextAlign.center,
|
|
fontSize: 12,
|
|
color: Colors.red,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
child: Container(
|
|
height: 70,
|
|
padding: EdgeInsets.all(10),
|
|
color: Colors.white,
|
|
child: Center(
|
|
child: Icon(Icons.edit),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
},
|
|
);
|
|
return tableRow;
|
|
}
|
|
}
|