Merge remote-tracking branch 'origin/development_new_design_2.0' into development_new_design_2.0

merge-requests/390/head
Mirza.Shafique 5 years ago
commit e91cf4762a

@ -818,6 +818,7 @@ const Map localizedValues = {
"SpecialResult": {"en": " Special Result", "ar": "نتيجة خاصة"}, "SpecialResult": {"en": " Special Result", "ar": "نتيجة خاصة"},
"GeneralResult": {"en": "General Result", "ar": "نتيجة عامة"}, "GeneralResult": {"en": "General Result", "ar": "نتيجة عامة"},
"show-more-btn": {"en": "Flow Chart", "ar": "النتائج التراكمية"}, "show-more-btn": {"en": "Flow Chart", "ar": "النتائج التراكمية"},
"view_flow_chart": {"en": "View Flowchart", "ar": "النتائج التراكمية"},
"value": {"en": "Value", "ar": "القيمة"}, "value": {"en": "Value", "ar": "القيمة"},
"range": {"en": "Range", "ar": "المدى"}, "range": {"en": "Range", "ar": "المدى"},
@ -944,6 +945,7 @@ const Map localizedValues = {
"insur-cards": {"en": "Insurance Cards", "ar": "بطاقات التأمين"}, "insur-cards": {"en": "Insurance Cards", "ar": "بطاقات التأمين"},
'labResult': {"en": "Lab results", "ar": "نتائج التحاليل المخبرية"}, 'labResult': {"en": "Lab results", "ar": "نتائج التحاليل المخبرية"},
'details': {'en': 'Details', 'ar': 'التفاصيل'}, 'details': {'en': 'Details', 'ar': 'التفاصيل'},
'graph-details': {'en': 'Graph Details', 'ar': 'التفاصيل الرسم البياني'},
"age": {"en": "Age", "ar": "العمر"}, "age": {"en": "Age", "ar": "العمر"},
"active-insurence": {"en": "Active", "ar": "نشطة"}, "active-insurence": {"en": "Active", "ar": "نشطة"},
"not-active": {"en": "Not Active", "ar": "غير نشط"}, "not-active": {"en": "Not Active", "ar": "غير نشط"},

@ -2,5 +2,5 @@ extension CapExtension on String {
String get toCamelCase => "${this[0].toUpperCase()}${this.substring(1)}"; String get toCamelCase => "${this[0].toUpperCase()}${this.substring(1)}";
String get inCaps => '${this[0].toUpperCase()}${this.substring(1)}'; String get inCaps => '${this[0].toUpperCase()}${this.substring(1)}';
String get allInCaps => this.toUpperCase(); String get allInCaps => this.toUpperCase();
String get capitalizeFirstofEach => this.split(" ").map((str) => str.inCaps).join(" "); String get capitalizeFirstofEach => this.length > 0 ? this.split(" ").map((str) => str.inCaps).join(" ") : "";
} }

@ -35,6 +35,7 @@ class _LaboratoryResultPageState extends State<LaboratoryResultPage> {
backgroundColor: Color(0xffF8F8F8), backgroundColor: Color(0xffF8F8F8),
body: ListView.builder( body: ListView.builder(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
padding: EdgeInsets.only(bottom: 12),
itemBuilder: (context, index) => LaboratoryResultWidget( itemBuilder: (context, index) => LaboratoryResultWidget(
onTap: () async { onTap: () async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);

@ -57,7 +57,7 @@ class DateUtil {
} }
static String formatDateToTime(DateTime date) { static String formatDateToTime(DateTime date) {
return DateFormat('kk:mm a').format(date); return DateFormat('hh:mm a').format(date);
} }
static String yearMonthDay(DateTime dateTime) { static String yearMonthDay(DateTime dateTime) {

@ -1202,6 +1202,8 @@ class TranslationBase {
String get showMoreBtn => localizedValues['show-more-btn'][locale.languageCode]; String get showMoreBtn => localizedValues['show-more-btn'][locale.languageCode];
String get viewFlowChart => localizedValues['view_flow_chart'][locale.languageCode];
String get value => localizedValues['value'][locale.languageCode]; String get value => localizedValues['value'][locale.languageCode];
String get range => localizedValues['range'][locale.languageCode]; String get range => localizedValues['range'][locale.languageCode];
@ -1414,6 +1416,8 @@ class TranslationBase {
String get details => localizedValues['details'][locale.languageCode]; String get details => localizedValues['details'][locale.languageCode];
String get graphDetails => localizedValues['graph-details'][locale.languageCode];
String get age => localizedValues['age'][locale.languageCode]; String get age => localizedValues['age'][locale.languageCode];
String get activeInsurence => localizedValues['active-insurence'][locale.languageCode]; String get activeInsurence => localizedValues['active-insurence'][locale.languageCode];

@ -20,7 +20,7 @@ import 'package:diplomaticquarterapp/pages/medical/balance/my_balance_page.dart'
import 'package:diplomaticquarterapp/pages/medical/doctor/doctor_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/doctor/doctor_home_page.dart';
import 'package:diplomaticquarterapp/pages/medical/eye/EyeMeasurementsPage.dart'; import 'package:diplomaticquarterapp/pages/medical/eye/EyeMeasurementsPage.dart';
import 'package:diplomaticquarterapp/pages/medical/labs/labs_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/labs/labs_home_page.dart';
import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart'; import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/my_trackers.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/my_trackers.dart';
import 'package:diplomaticquarterapp/pages/medical/patient_sick_leave_page.dart'; import 'package:diplomaticquarterapp/pages/medical/patient_sick_leave_page.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart';
@ -813,6 +813,48 @@ class Utils {
); );
}); });
} }
static Widget tableColumnTitle(String text) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
SizedBox(height: 6),
Text(
text,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12),
),
SizedBox(height: 6),
Divider(
height: 1,
color: Color(0xff2E303A),
thickness: 1,
)
],
);
}
static Widget tableColumnValue(String text, {bool isLast = false}) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
SizedBox(height: 12),
Text(
text.toLowerCase().capitalizeFirstofEach,
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
),
SizedBox(height: 12),
if (!isLast)
Divider(
height: 1,
color: Color(0xffEFEFEF),
thickness: 1,
)
],
);
}
} }
Widget applyShadow({Color color = Colors.grey, double shadowOpacity = 0.5, double spreadRadius = 2, double blurRadius = 7, Offset offset = const Offset(2, 2), @required Widget child}) { Widget applyShadow({Color color = Colors.grey, double shadowOpacity = 0.5, double spreadRadius = 2, double blurRadius = 7, Offset offset = const Offset(2, 2), @required Widget child}) {

@ -1,10 +1,14 @@
import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/labs_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/labs_view_model.dart';
import 'package:diplomaticquarterapp/models/header_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'LineChartCurved.dart';
import 'lab_result_chart_and_detials.dart'; import 'lab_result_chart_and_detials.dart';
class FlowChartPage extends StatelessWidget { class FlowChartPage extends StatelessWidget {
@ -16,28 +20,58 @@ class FlowChartPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<LabsViewModel>( return BaseView<LabsViewModel>(
onModelReady: (model) => model.getPatientLabOrdersResults( onModelReady: (model) => model.getPatientLabOrdersResults(patientLabOrder: patientLabOrder, procedure: filterName),
patientLabOrder: patientLabOrder, procedure: filterName),
builder: (context, model, w) => AppScaffold( builder: (context, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: filterName, appBarTitle: filterName,
baseViewModel: model, baseViewModel: model,
showNewAppBar: true,
showNewAppBarTitle: true,
backgroundColor: Color(0xffF8F8F8),
body: SingleChildScrollView( body: SingleChildScrollView(
child: model. labOrdersResultsList.isNotEmpty child: model.labOrdersResultsList.isNotEmpty
? Container( ? Column(
child: LabResultChartAndDetails( crossAxisAlignment: CrossAxisAlignment.start,
name: filterName, mainAxisSize: MainAxisSize.min,
labResult: model.labOrdersResultsList, children: [
), Container(
width: double.infinity,
padding: EdgeInsets.only(left: 17, top: 12, right: 13, bottom: 12),
margin: EdgeInsets.only(left: 21, right: 21, top: 21),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
boxShadow: [
BoxShadow(
color: Color(0xff000000).withOpacity(.05),
//spreadRadius: 5,
blurRadius: 27,
offset: Offset(0, -3),
),
],
),
child: LineChartCurved(
title: filterName,
labResult: model.labOrdersResultsList,
),
),
LabResultChartAndDetails(
name: filterName,
labResult: model.labOrdersResultsList,
),
],
) )
: Center( : Center(
child: Container( child: Container(
padding: EdgeInsets.only(top: MediaQuery.of(context).size.height *0.42), padding: EdgeInsets.only(top: MediaQuery.of(context).size.height * 0.42),
child: Center( child: Center(
child: Texts('No Data'), child: Texts('No Data'),
), ),
), ),
), ),
), ),
), ),
); );

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart';
import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -10,14 +11,12 @@ import 'package:provider/provider.dart';
import '../../text.dart'; import '../../text.dart';
import 'FlowChartPage.dart'; import 'FlowChartPage.dart';
class LabResultWidget extends StatelessWidget { class LabResultWidget extends StatelessWidget {
final String filterName;
final String filterName ;
final List<LabResult> patientLabResultList; final List<LabResult> patientLabResultList;
final PatientLabOrders patientLabOrder; final PatientLabOrders patientLabOrder;
LabResultWidget({Key key, this.filterName, this.patientLabResultList, this.patientLabOrder}) : super(key: key); LabResultWidget({Key key, this.filterName, this.patientLabResultList, this.patientLabOrder}) : super(key: key);
ProjectViewModel projectViewModel; ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -28,11 +27,15 @@ class LabResultWidget extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
SizedBox(height: 8),
Row( Row(
mainAxisAlignment: // mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: [ children: [
Texts(filterName), Text(
filterName,
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.56, height: 21 / 14),
),
SizedBox(width: 16),
InkWell( InkWell(
onTap: () { onTap: () {
Navigator.push( Navigator.push(
@ -40,135 +43,53 @@ class LabResultWidget extends StatelessWidget {
FadePage( FadePage(
page: FlowChartPage( page: FlowChartPage(
filterName: filterName, filterName: filterName,
patientLabOrder: patientLabOrder, patientLabOrder: patientLabOrder,
), ),
), ),
); );
}, },
child: Texts( child: Text(
TranslationBase.of(context).showMoreBtn, TranslationBase.of(context).viewFlowChart,
decoration: TextDecoration.underline, style: TextStyle(decoration: TextDecoration.underline, fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xffD02127), letterSpacing: -0.48, height: 18 / 12),
color: Colors.blue,
), ),
), ),
], ],
), ),
Table( Table(
border: TableBorder.symmetric( columnWidths: {
inside: BorderSide( 0: FlexColumnWidth(2),
width: 2.0, color: Colors.grey[300]), 1: FlexColumnWidth(1.5),
), 2: FlexColumnWidth(1),
children: fullData(patientLabResultList,context), },
children: fullData(patientLabResultList, context),
), ),
], ],
), ),
); );
} }
List<TableRow> fullData(List<LabResult> labResultList,context) {
List<TableRow> fullData(List<LabResult> labResultList, context) {
List<TableRow> tableRow = []; List<TableRow> tableRow = [];
tableRow.add( tableRow.add(
TableRow( TableRow(
children: [ children: [
Container( Utils.tableColumnTitle(TranslationBase.of(context).description),
child: Container( Utils.tableColumnTitle(TranslationBase.of(context).value),
decoration: BoxDecoration( Utils.tableColumnTitle(TranslationBase.of(context).range),
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
topRight: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
),
),
child: Center(
child: Texts(
TranslationBase.of(context).description,
color: Colors.white,
),
),
height: 60,
),
),
Container(
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
),
child: Center(
child: Texts(TranslationBase.of(context).value, color: Colors.white),
),
height: 60),
),
Container(
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
topRight: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
),
),
child: Center(
child: Texts(TranslationBase.of(context).range, color: Colors.white),
),
height: 60),
),
], ],
), ),
); );
labResultList.forEach((lab) {
for (int i = 0; i < labResultList.length; i++)
tableRow.add( tableRow.add(
TableRow( TableRow(
children: [ children: [
Container( Utils.tableColumnValue(labResultList[i].description, isLast: i == (labResultList.length - 1)),
child: Container( Utils.tableColumnValue(labResultList[i].resultValue + " " + labResultList[i].uOM, isLast: i == (labResultList.length - 1)),
padding: EdgeInsets.all(10), Utils.tableColumnValue(labResultList[i].referanceRange, isLast: i == (labResultList.length - 1)),
color: Colors.white,
child: Center(
child: Texts(
lab.description,
textAlign: TextAlign.center,
),
),
),
),
Container(
child: Container(
padding: EdgeInsets.all(10),
color: Colors.white,
child: Center(
child: Texts(
lab.resultValue+" "+lab.uOM,
textAlign: TextAlign.center,
),
),
),
),
Container(
child: Container(
padding: EdgeInsets.all(10),
color: Colors.white,
child: Center(
child: Texts(
lab.referanceRange,
textAlign: TextAlign.center,
),
),
),
),
], ],
), ),
); );
});
return tableRow; return tableRow;
} }
} }

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -24,96 +25,35 @@ class _VitalSignDetailsWidgetState extends State<LabResultDetailsWidget> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return Container( return Table(
decoration: BoxDecoration( columnWidths: {
color: Colors.transparent, 0: FlexColumnWidth(2),
borderRadius: BorderRadius.only( 1: FlexColumnWidth(1),
topLeft: Radius.circular(10.0), topRight: Radius.circular(10.0)), },
border: Border.all(color: Colors.grey, width: 1), children: fullData(widget.labResult, context),
),
margin: EdgeInsets.all(20),
child: Container(
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(projectViewModel),
),
],
),
),
); );
} }
List<TableRow> fullData(ProjectViewModel projectViewModel) { List<TableRow> fullData(List<LabOrderResult> labOrderResultList, context) {
List<TableRow> tableRow = []; List<TableRow> tableRow = [];
tableRow.add(TableRow(children: [ tableRow.add(
Container( TableRow(
child: Container( children: [
decoration: BoxDecoration( Utils.tableColumnTitle(TranslationBase.of(context).date),
color: Theme.of(context).primaryColor, Utils.tableColumnTitle(TranslationBase.of(context).labResults),
borderRadius: BorderRadius.only( ],
topLeft: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0),
topRight: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0),
),
),
child: Center(
child: Texts(
TranslationBase.of(context).date,
color: Colors.white,
),
),
height: 60,
),
), ),
Container( );
child: Container(
decoration: BoxDecoration( for (int i = 0; i < labOrderResultList.length; i++)
color: Theme.of(context).primaryColor, tableRow.add(
borderRadius: BorderRadius.only( TableRow(
topRight: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), children: [
topLeft: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0), Utils.tableColumnValue(DateUtil.formatDateToDate(DateUtil.convertStringToDate(labOrderResultList[i].verifiedOnDateTime)), isLast: i == (labOrderResultList.length - 1)),
), Utils.tableColumnValue(labOrderResultList[i].resultValue, isLast: i == (labOrderResultList.length - 1)),
), ],
child: Center(
child: Texts(TranslationBase.of(context).labResult, color: Colors.white),
),
height: 60),
)
]));
widget.labResult.forEach((vital) {
var date =DateUtil.convertStringToDate(vital.verifiedOnDateTime);
tableRow.add(TableRow(children: [
Container(
child: Container(
padding: EdgeInsets.all(10),
color: Colors.white,
child: Center(
child: Texts(
'${projectViewModel.isArabic? DateUtil.getWeekDayArabic(date.weekday): DateUtil.getWeekDay(date.weekday)} ,${date.day} ${projectViewModel.isArabic? DateUtil.getMonthArabic(date.month) : DateUtil.getMonth(date.month)} ${date.year}',
textAlign: TextAlign.center,
),
),
),
),
Container(
child: Container(
padding: EdgeInsets.all(10),
color: Colors.white,
child: Center(
child: Texts(
'${vital.resultValue}',
textAlign: TextAlign.center,
),
),
),
), ),
])); );
});
return tableRow; return tableRow;
} }
} }

@ -38,46 +38,34 @@ class LineChartCurvedState extends State<LineChartCurved> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AspectRatio( return Container(
aspectRatio: 1.23, decoration: const BoxDecoration(
child: Container( borderRadius: BorderRadius.all(Radius.circular(18)),
decoration: const BoxDecoration( // color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(18)), ),
// color: Colors.white, child: Stack(
), children: <Widget>[
child: Stack( Column(
children: <Widget>[ crossAxisAlignment: CrossAxisAlignment.start,
Column( children: <Widget>[
crossAxisAlignment: CrossAxisAlignment.stretch, Text(
children: <Widget>[ widget.title,
const SizedBox( style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
height: 4, ),
), SizedBox(height: 16),
Text( AspectRatio(
widget.title, aspectRatio: 333 / 288,
style: TextStyle( child: Padding(
color: Colors.black, padding: EdgeInsets.only(right: 16.0, left: 6.0),
fontSize: 32, child: LineChart(
fontWeight: FontWeight.bold, sampleData1(),
letterSpacing: 2), swapAnimationDuration: const Duration(milliseconds: 250),
textAlign: TextAlign.center,
),
Expanded(
child: Padding(
padding: const EdgeInsets.only(right: 16.0, left: 6.0),
child: LineChart(
sampleData1(),
swapAnimationDuration: const Duration(milliseconds: 250),
),
), ),
), ),
const SizedBox( ),
height: 10, ],
), ),
], ],
),
],
),
), ),
); );
} }
@ -91,17 +79,13 @@ class LineChartCurvedState extends State<LineChartCurved> {
touchCallback: (LineTouchResponse touchResponse) {}, touchCallback: (LineTouchResponse touchResponse) {},
handleBuiltInTouches: true, handleBuiltInTouches: true,
), ),
gridData: FlGridData( gridData: FlGridData(show: true, drawVerticalLine: false, drawHorizontalLine: true),
show: true, drawVerticalLine: true, drawHorizontalLine: true),
titlesData: FlTitlesData( titlesData: FlTitlesData(
bottomTitles: SideTitles( bottomTitles: SideTitles(
showTitles: true, showTitles: true,
getTextStyles: (value) => const TextStyle( getTextStyles: (value) => TextStyle(fontSize: 12, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: 0, height: 18 / 12),
color: Colors.black, margin: 8,
fontSize: 12, rotateAngle: -0,
),
margin: 22,
rotateAngle:-65,
getTitles: (value) { getTitles: (value) {
print(value); print(value);
DateTime date = DateUtil.convertStringToDate(widget.labResult[value.toInt()].verifiedOnDateTime); DateTime date = DateUtil.convertStringToDate(widget.labResult[value.toInt()].verifiedOnDateTime);
@ -111,27 +95,20 @@ class LineChartCurvedState extends State<LineChartCurved> {
} else } else
return ''; return '';
} else { } else {
if (value.toInt() == 0) if (value.toInt() == 0) return '${date.day}/ ${date.year}';
return '${date.day}/ ${date.year}'; if (value.toInt() == widget.labResult.length - 1) return '${date.day}/ ${date.year}';
if (value.toInt() == widget.labResult.length - 1)
return '${date.day}/ ${date.year}';
if (xAxixs.contains(value.toInt())) { if (xAxixs.contains(value.toInt())) {
return '${date.day}/ ${date.year}'; return '${date.day}/ ${date.year}';
} }
} }
return ''; return '';
}, },
), ),
leftTitles: SideTitles( leftTitles: SideTitles(
showTitles: true, showTitles: true,
getTextStyles: (value) => const TextStyle( getTextStyles: (value) => TextStyle(fontSize: 12, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: 0, height: 18 / 12),
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 10,
),
getTitles: (value) { getTitles: (value) {
return '${value.toInt()}'; return '${value.toInt()}';
}, },
@ -140,22 +117,22 @@ class LineChartCurvedState extends State<LineChartCurved> {
), ),
), ),
borderData: FlBorderData( borderData: FlBorderData(
show: true, show: false,
border: const Border( // border: const Border(
bottom: BorderSide( // bottom: BorderSide(
color: Colors.black, // color: Colors.black,
width: 0.5, // width: 0.5,
), // ),
left: BorderSide( // // left: BorderSide(
color: Colors.black, // // color: Colors.black,
), // // ),
right: BorderSide( // // right: BorderSide(
color: Colors.black, // // color: Colors.black,
), // // ),
top: BorderSide( // top: BorderSide(
color: Colors.transparent, // color: Colors.transparent,
), // ),
), // ),
), ),
minX: 0, minX: 0,
maxX: (widget.labResult.length - 1).toDouble(), maxX: (widget.labResult.length - 1).toDouble(),
@ -168,10 +145,10 @@ class LineChartCurvedState extends State<LineChartCurved> {
double getMaxY() { double getMaxY() {
double max = 0; double max = 0;
widget.labResult.forEach((element) { widget.labResult.forEach((element) {
try{ try {
double resultValueDouble = double.parse(element.resultValue); double resultValueDouble = double.parse(element.resultValue);
if (resultValueDouble > max) max = resultValueDouble;} if (resultValueDouble > max) max = resultValueDouble;
catch(e){ } catch (e) {
print(e); print(e);
} }
}); });
@ -181,13 +158,14 @@ class LineChartCurvedState extends State<LineChartCurved> {
double getMinY() { double getMinY() {
double min = 0; double min = 0;
try{ try {
min = double.parse(widget.labResult[0].resultValue); min = double.parse(widget.labResult[0].resultValue);
widget.labResult.forEach((element) { widget.labResult.forEach((element) {
double resultValueDouble = double.parse(element.resultValue); double resultValueDouble = double.parse(element.resultValue);
if (resultValueDouble < min) min = resultValueDouble; if (resultValueDouble < min) min = resultValueDouble;
});}catch(e){ });
} catch (e) {
print(e); print(e);
} }
int value = min.toInt(); int value = min.toInt();
@ -198,21 +176,22 @@ class LineChartCurvedState extends State<LineChartCurved> {
List<LineChartBarData> getData() { List<LineChartBarData> getData() {
List<FlSpot> spots = List(); List<FlSpot> spots = List();
for (int index = 0; index < widget.labResult.length; index++) { for (int index = 0; index < widget.labResult.length; index++) {
try{ try {
var resultValueDouble = double.parse(widget.labResult[index].resultValue); var resultValueDouble = double.parse(widget.labResult[index].resultValue);
spots.add(FlSpot(index.toDouble(), resultValueDouble)); print("$index:$resultValueDouble");
}catch(e){ spots.add(FlSpot(index.toDouble(), resultValueDouble));
} catch (e) {
print(e); print(e);
spots.add(FlSpot(index.toDouble(), 0.0)); spots.add(FlSpot(index.toDouble(), 0.0));
} }
} }
final LineChartBarData lineChartBarData1 = LineChartBarData( final LineChartBarData lineChartBarData1 = LineChartBarData(
spots: spots, spots: spots,
isCurved: true, isCurved: true,
colors: [Theme.of(context).primaryColor], //preventCurveOverShooting : true,
barWidth: 5, colors: [Color(0xffD02127)],
barWidth: 1.5,
isStrokeCapRound: true, isStrokeCapRound: true,
dotData: FlDotData( dotData: FlDotData(
show: false, show: false,

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/core/model/labs/LabOrderResult.dart'; import 'package:diplomaticquarterapp/core/model/labs/LabOrderResult.dart';
import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -20,23 +21,98 @@ class LabResultChartAndDetails extends StatelessWidget {
final List<LabOrderResult> labResult; final List<LabOrderResult> labResult;
final String name; final String name;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Column( return Container(
children: <Widget>[ padding: EdgeInsets.only(left: 17, top: 12, right: 13, bottom: 12),
AppExpandableNotifier( margin: EdgeInsets.only(left: 21, right: 21, top: 12),
headerWidget: Padding( decoration: BoxDecoration(
padding: const EdgeInsets.all(8.0), shape: BoxShape.rectangle,
child: LineChartCurved(title: name,labResult:labResult,), color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
boxShadow: [
BoxShadow(
color: Color(0xff000000).withOpacity(.05),
//spreadRadius: 5,
blurRadius: 27,
offset: Offset(0, -3),
), ),
bodyWidget: LabResultDetailsWidget( ],
labResult: labResult.reversed.toList(), ),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Expanded(
child: Text(
TranslationBase.of(context).graphDetails,
style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
),
),
],
), ),
isExpand: true, SizedBox(height: 8),
), LabResultDetailsWidget(
], labResult: labResult.reversed.toList(),
)
],
),
); );
// todo old was expandable, but new is not expandable
// Column(
// mainAxisSize: MainAxisSize.min,
// children: <Widget>[
// Row(
// mainAxisSize: MainAxisSize.min,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: <Widget>[
// Expanded(
// child: Text(
// TranslationBase.of(context).generalResult,
// style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
// ),
// ),
// ],
// ),
// LabResultDetailsWidget(
// labResult: labResult.reversed.toList(),
// ),
// AppExpandableNotifier(
// // headerWidget: Container(
// // padding: EdgeInsets.only(left: 17, top: 12, right: 13, bottom: 12),
// // margin: EdgeInsets.only(left: 21, right: 21, top: 21),
// // decoration: BoxDecoration(
// // shape: BoxShape.rectangle,
// // color: Colors.white,
// // borderRadius: BorderRadius.all(
// // Radius.circular(10.0),
// // ),
// // boxShadow: [
// // BoxShadow(
// // color: Color(0xff000000).withOpacity(.05),
// // //spreadRadius: 5,
// // blurRadius: 27,
// // offset: Offset(0, -3),
// // ),
// // ],
// // ),
// // child: LineChartCurved(
// // title: name,
// // labResult: labResult
// // ),
// // ),
// title: TranslationBase.of(context).delete,
// bodyWidget: LabResultDetailsWidget(
// labResult: labResult.reversed.toList(),
// ),
// isExpand: true,
// ),
// ],
// );
} }
} }

@ -11,6 +11,7 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.d
import 'package:diplomaticquarterapp/extensions/string_extensions.dart'; import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart'; import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart';
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_html/flutter_html.dart'; import 'package:flutter_html/flutter_html.dart';
@ -20,6 +21,7 @@ import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
import '../../text.dart'; import '../../text.dart';
import 'FlowChartPage.dart';
import 'LabResultWidget.dart'; import 'LabResultWidget.dart';
class LaboratoryResultWidget extends StatefulWidget { class LaboratoryResultWidget extends StatefulWidget {
@ -44,14 +46,14 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
return BaseView<LabsViewModel>( return BaseView<LabsViewModel>(
// onModelReady: (model) => model.getPatientLabResult(patientLabOrder: widget.patientLabOrder), onModelReady: (model) => model.getPatientLabResult(patientLabOrder: widget.patientLabOrder),
builder: (_, model, w) => NetworkBaseView( builder: (_, model, w) => NetworkBaseView(
baseViewModel: model, baseViewModel: model,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
DoctorHeader( DoctorHeader(
headerModel: new HeaderModel( headerModel: HeaderModel(
widget.patientLabOrder.doctorName, widget.patientLabOrder.doctorName,
widget.patientLabOrder.doctorImageURL, widget.patientLabOrder.doctorImageURL,
widget.patientLabOrder.speciality, widget.patientLabOrder.speciality,
@ -78,7 +80,7 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
); );
}, },
child: Container( child: Container(
padding: EdgeInsets.only(left: 17, top: 14, right: 13, bottom: 10), padding: EdgeInsets.only(left: 17, top: 12, right: 13, bottom: 12),
margin: EdgeInsets.only(left: 21, right: 21, top: 12), margin: EdgeInsets.only(left: 21, right: 21, top: 12),
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
@ -95,41 +97,27 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
), ),
], ],
), ),
child: Row( child: Column(
children: <Widget>[ mainAxisSize: MainAxisSize.min,
Expanded(child: Texts(TranslationBase.of(context).generalResult)), children: [
Container( Row(
width: 25, mainAxisSize: MainAxisSize.min,
height: 25, crossAxisAlignment: CrossAxisAlignment.center,
decoration: BoxDecoration(shape: BoxShape.circle, color: Theme.of(context).primaryColor), children: <Widget>[
child: Icon( Expanded(
_isShowMoreGeneral ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down, child: Text(
color: Colors.white, TranslationBase.of(context).generalResult,
size: 22, style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
), ),
) ),
], Icon(
), _isShowMoreGeneral ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down,
), color: Color(0xff575757),
), size: 22,
if (_isShowMoreGeneral) )
AnimatedContainer( ],
padding: EdgeInsets.all(10.0), ),
margin: EdgeInsets.only(left: 5, right: 5), if (_isShowMoreGeneral)
decoration: BoxDecoration(
shape: BoxShape.rectangle,
color: Colors.white,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(5.0),
bottomRight: Radius.circular(5.0),
),
),
duration: Duration(milliseconds: 7000),
child: Container(
width: double.infinity,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
...List.generate( ...List.generate(
model.labResultLists.length, model.labResultLists.length,
(index) => LabResultWidget( (index) => LabResultWidget(
@ -138,10 +126,10 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
patientLabResultList: model.labResultLists[index].patientLabResultList, patientLabResultList: model.labResultLists[index].patientLabResultList,
), ),
) )
], ],
),
), ),
), ),
),
], ],
), ),
), ),
@ -169,41 +157,34 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
), ),
], ],
), ),
child: Row( child: Column(
children: <Widget>[ children: [
Expanded(child: Texts(TranslationBase.of(context).specialResult)), Row(
Container( children: <Widget>[
width: 25, Expanded(
height: 25, child: Text(
decoration: BoxDecoration(shape: BoxShape.circle, color: Theme.of(context).primaryColor), TranslationBase.of(context).specialResult,
child: Icon( style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
_isShowMore ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down, ),
color: Colors.white, ),
size: 22, Icon(
_isShowMore ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down,
color: Color(0xff575757),
size: 22,
)
],
),
if (_isShowMore)
Container(
width: double.infinity,
child: Html(
data: widget.details ?? TranslationBase.of(context).noDataAvailable,
),
), ),
)
], ],
), ),
), ),
), ),
if (_isShowMore)
AnimatedContainer(
padding: EdgeInsets.all(10.0),
margin: EdgeInsets.only(left: 5, right: 5),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
color: Colors.white,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(5.0),
bottomRight: Radius.circular(5.0),
)),
duration: Duration(milliseconds: 7000),
child: Container(
width: double.infinity,
child: Html(
data: widget.details ?? TranslationBase.of(context).noDataAvailable,
)),
),
], ],
), ),
), ),

@ -39,7 +39,7 @@ class DoctorCard extends StatelessWidget {
BoxShadow( BoxShadow(
color: Color(0xff000000).withOpacity(.05), color: Color(0xff000000).withOpacity(.05),
//spreadRadius: 5, //spreadRadius: 5,
blurRadius: 12, blurRadius: 27,
offset: Offset(0, -3), offset: Offset(0, -3),
), ),
], ],
@ -159,12 +159,14 @@ class DoctorCard extends StatelessWidget {
// todo 'sikander' move this widget to separate file // todo 'sikander' move this widget to separate file
Widget myRichText(String title, String value) { Widget myRichText(String title, String value) {
return RichText( return RichText(
text: text: TextSpan(
TextSpan(text: title, style: TextStyle(fontSize: 12, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 18 / 10), children: <TextSpan>[ text: title,
TextSpan( style: TextStyle(fontSize: 12, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 18 / 10),
text: " $value", children: <TextSpan>[
style: TextStyle(fontSize: 14, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), TextSpan(
) text: " $value",
]), style: TextStyle(fontSize: 14, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12),
)
]),
); );
} }

@ -20,6 +20,8 @@ class DoctorHeader extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
String _speciality = (headerModel?.speciality ?? []).length > 0 ? headerModel.speciality.first : "";
return Container( return Container(
color: Colors.white, color: Colors.white,
child: Column( child: Column(
@ -44,7 +46,7 @@ class DoctorHeader extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
(headerModel?.speciality?.toString()?.toLowerCase()?.capitalizeFirstofEach ?? ""), _speciality,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12),
), ),
myRichText(TranslationBase.of(context).invoiceNo + ":", headerModel.invoiceNo), myRichText(TranslationBase.of(context).invoiceNo + ":", headerModel.invoiceNo),
@ -64,10 +66,10 @@ class DoctorHeader extends StatelessWidget {
DateUtil.formatDateToTime(headerModel.orderDate), DateUtil.formatDateToTime(headerModel.orderDate),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12),
), ),
Padding( // Padding(
padding: const EdgeInsets.only(top: 8.0), // padding: const EdgeInsets.only(top: 8.0),
child: Image.network(headerModel.nationalityFlagURL ?? "", height: 16), // child: Image.network(headerModel.nationalityFlagURL ?? "", height: 16),
), // ),
], ],
) )
], ],
@ -109,7 +111,6 @@ class DoctorHeader extends StatelessWidget {
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
// todo: 'change icon for send email'
SvgPicture.asset('assets/images/new/email.svg', width: 19.0), SvgPicture.asset('assets/images/new/email.svg', width: 19.0),
SizedBox(width: 6), SizedBox(width: 6),
Text( Text(

@ -65,38 +65,42 @@ class _AppExpandableNotifier extends State<AppExpandableNotifier> {
), ),
header: Padding( header: Padding(
padding: const EdgeInsets.only(top: 12, bottom: 12, left: 21, right: 21), padding: const EdgeInsets.only(top: 12, bottom: 12, left: 21, right: 21),
child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ child: InkWell(
Expanded( onTap: (){
child: Column( setState(() {
mainAxisSize: MainAxisSize.min, widget.expandFlag = !widget.expandFlag;
crossAxisAlignment: CrossAxisAlignment.start, widget.controller.expanded = widget.expandFlag;
children: [ });
if (_title.isNotEmpty) },
Text( child: Row(
_title, mainAxisAlignment: MainAxisAlignment.spaceBetween,
style: TextStyle(fontSize: 12, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.72, height: 23 / 12), children: [
), Expanded(
Text( child: Column(
_subTitle, mainAxisSize: MainAxisSize.min,
maxLines: 1, crossAxisAlignment: CrossAxisAlignment.start,
style: TextStyle(fontSize: 24, fontFamily: "Poppins", fontWeight: FontWeight.w700, color: Color(0xff2E303A), letterSpacing: -1.44, height: 25 / 24), children: [
if (_title.isNotEmpty)
Text(
_title,
style: TextStyle(fontSize: 12, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.72, height: 23 / 12),
),
Text(
_subTitle,
maxLines: 1,
style: TextStyle(fontSize: 24, fontFamily: "Poppins", fontWeight: FontWeight.w700, color: Color(0xff2E303A), letterSpacing: -1.44, height: 25 / 24),
),
],
), ),
], ),
), Icon(
), widget.expandFlag ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down,
IconButton(
icon: Icon(
widget.expandFlag ? Icons.remove : Icons.add,
color: Color(0xff2E303A), color: Color(0xff2E303A),
// size: 30.0, // size: 30.0,
), ),
onPressed: () { ],
setState(() { ),
widget.expandFlag = !widget.expandFlag; ),
widget.controller.expanded = widget.expandFlag;
});
}),
]),
), ),
collapsed: widget.collapsed ?? Container(), collapsed: widget.collapsed ?? Container(),
expanded: widget.bodyWidget, expanded: widget.bodyWidget,

Loading…
Cancel
Save