From ec85a0ea18ff8f576232d9f5549f7a0d32581b3f Mon Sep 17 00:00:00 2001 From: Mohammad ALjammal Date: Wed, 3 Jun 2020 15:58:58 +0300 Subject: [PATCH] change design VitalSignDetailsWidget --- .../patients/vital_sign_details_wideget.dart | 153 +++++++++--------- pubspec.lock | 7 + 2 files changed, 80 insertions(+), 80 deletions(-) diff --git a/lib/widgets/patients/vital_sign_details_wideget.dart b/lib/widgets/patients/vital_sign_details_wideget.dart index 7c91b499..437b4085 100644 --- a/lib/widgets/patients/vital_sign_details_wideget.dart +++ b/lib/widgets/patients/vital_sign_details_wideget.dart @@ -26,11 +26,9 @@ class _VitalSignDetailsWidgetState extends State { color: Colors.transparent, borderRadius: BorderRadius.only( topLeft: Radius.circular(10.0), + topRight: Radius.circular(10.0) ), - border: Border.all( - color: Colors.grey, - width: 0.5 - ), + border: Border.all(color: Colors.grey, width: 1), ), margin: EdgeInsets.all(20), child: Container( @@ -38,86 +36,81 @@ class _VitalSignDetailsWidgetState extends State { 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(), + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 2.0,color: Colors.grey[300]), + ), + children: fullData(), ), ], ), ), ); } + + List fullData(){ + List tableRow = []; + tableRow.add(TableRow(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), + ) + ])); + widget.vitalList.forEach((vital) { + tableRow.add(TableRow(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, + ), + ), + ), + ), + Expanded( + child: Container( + height: 50, + color: Colors.white, + child: Center( + child: Texts( + '${vital.toJson()[widget.viewKey]}', + textAlign: TextAlign.center, + ), + ), + ), + ), + ])); + }); + return tableRow; + } + } diff --git a/pubspec.lock b/pubspec.lock index afe0aa60..20f3bbd9 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -239,6 +239,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.0" + expandable: + dependency: "direct main" + description: + name: expandable + url: "https://pub.dartlang.org" + source: hosted + version: "4.1.4" fixnum: dependency: transitive description: