From bf094136ab1a488aa29dd946cf5e16d9f11ba700 Mon Sep 17 00:00:00 2001 From: Mohammad ALjammal Date: Mon, 1 Jun 2020 15:30:07 +0300 Subject: [PATCH] create vital sign details --- .../patients/vital_sign_details_wideget.dart | 107 +++++++++++++++++- 1 file changed, 106 insertions(+), 1 deletion(-) diff --git a/lib/widgets/patients/vital_sign_details_wideget.dart b/lib/widgets/patients/vital_sign_details_wideget.dart index adb3f1c8..35e85699 100644 --- a/lib/widgets/patients/vital_sign_details_wideget.dart +++ b/lib/widgets/patients/vital_sign_details_wideget.dart @@ -1,6 +1,18 @@ +import 'package:doctor_app_flutter/models/patient/vital_sign_res_model.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; class VitalSignDetailsWidget extends StatefulWidget { + final List vitalList; + final String title1; + final String title2; + final String viewKey; + + VitalSignDetailsWidget({Key key, this.vitalList, this.title1, this.title2,this.viewKey}); + @override _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); } @@ -8,6 +20,99 @@ class VitalSignDetailsWidget extends StatefulWidget { class _VitalSignDetailsWidgetState extends State { @override Widget build(BuildContext context) { - return Container(); + return Container( + decoration: BoxDecoration( + color: Colors.transparent, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), + ), + ), + margin: EdgeInsets.all(20), + child: Container( + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Expanded( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + widget.title1, + color: Colors.white, + ), + ), + height: 60, + ), + ), + Expanded( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topRight: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts(widget.title2, color: Colors.white), + ), + height: 60), + ), + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: widget.vitalList.map((vital) { + return Column( + children: [ + Row( + children: [ + Expanded( + child: Container( + height: 50, + color: Colors.white, + child: Center( + child: Texts( + '${Helpers.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${Helpers.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ', + textAlign: TextAlign.center, + ), + ), + ), + ), + SizedBox( + width: 2, + ), + Expanded( + child: Container( + height: 50, + color: Colors.white, + child: Center( + child: Texts( + '${vital.toJson()[widget.viewKey]}', + textAlign: TextAlign.center, + ), + ), + ), + ), + ], + ), + SizedBox( + height: 2, + ), + ], + ); + }).toList(), + ), + ], + ), + ), + ); } }