update-to-3.32-sdk
haroon amjad 6 months ago
parent 880db9315e
commit afd7c5db81

@ -2147,8 +2147,8 @@ const Map localizedValues = {
"readMore": {"en": "Read More", "ar": "اقرأ أكثر"}, "readMore": {"en": "Read More", "ar": "اقرأ أكثر"},
"showLess": {"en": "Show Less", "ar": "عرض أقل"}, "showLess": {"en": "Show Less", "ar": "عرض أقل"},
"change": {"en": "Change", "ar": "فرق"}, "change": {"en": "Change", "ar": "فرق"},
"referenceRange": {"en": "Reference Range", "ar": "النطاق المرجعي"}, "referenceRange": {"en": "Reference Range", "ar": "نطاق مرجعي"},
"criticalLow": {"en": "Critical Low", "ar": "النطاق المرجعي"}, "criticalLow": {"en": "Critical Low", "ar": "انخفاض حرج"},
"criticalHigh": {"en": "Critical High", "ar": "حرج مرتفع"}, "criticalHigh": {"en": "Critical High", "ar": "حرج مرتفع"},
"high": {"en": "High", "ar": "مرتفع"}, "high": {"en": "High", "ar": "مرتفع"},
"normal": {"en": "Normal", "ar": "عادي"}, "normal": {"en": "Normal", "ar": "عادي"},

@ -187,8 +187,8 @@ class BaseAppClient {
// body['IdentificationNo'] = 1023854217; // body['IdentificationNo'] = 1023854217;
// body['MobileNo'] = "531940021"; //0560717232 // body['MobileNo'] = "531940021"; //0560717232
// body['PatientID'] = 3628599; //4609100 body['PatientID'] = 1018977; //4609100
// body['TokenID'] = "@dm!n"; body['TokenID'] = "@dm!n";
// Patient ID: 3027574 // Patient ID: 3027574
// Mobile no.: 0502303285 // Mobile no.: 0502303285

@ -32,8 +32,7 @@ class LabsViewModel extends BaseViewModel {
List<ThresholdRange> threshold = []; List<ThresholdRange> threshold = [];
double maxYForThreeDots = 0.0; double maxYForThreeDots = 0.0;
double maxYForCompleteGraph = 0.0; double maxYForCompleteGraph = 0.0;
List months = ['Jan','Feb','Mar','April','May','Jun','July','Aug','Sep','Oct','Nov','Dec']; List months = ['Jan', 'Feb', 'Mar', 'April', 'May', 'Jun', 'July', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
String get labReportPDF => _labsService.labReportPDF; String get labReportPDF => _labsService.labReportPDF;
@ -94,13 +93,13 @@ class LabsViewModel extends BaseViewModel {
await _labsService.getLaboratoryResult(invoiceNo: invoiceNo, invoiceType: invoiceType, orderNo: orderNo, projectID: projectID, clinicID: clinicID, setupID: setupID, isVidaPlus: isVidaPlus); await _labsService.getLaboratoryResult(invoiceNo: invoiceNo, invoiceType: invoiceType, orderNo: orderNo, projectID: projectID, clinicID: clinicID, setupID: setupID, isVidaPlus: isVidaPlus);
if (_labsService.hasError) { if (_labsService.hasError) {
error = _labsService.error!; error = _labsService.error!;
setState(ViewState.Error); // setState(ViewState.Error);
} else { } else {
setState(ViewState.Idle); // setState(ViewState.Idle);
} }
} }
getPatientLabResult({required PatientLabOrders patientLabOrder, required bool isVidaPlus, bool isTablet = false}) async { getPatientLabResult({required PatientLabOrders patientLabOrder, required bool isVidaPlus, bool isTablet = false}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _labsService.getPatientLabResult(patientLabOrder: patientLabOrder, isVidaPlus: isVidaPlus); await _labsService.getPatientLabResult(patientLabOrder: patientLabOrder, isVidaPlus: isVidaPlus);
if (_labsService.hasError) { if (_labsService.hasError) {
@ -109,54 +108,48 @@ class LabsViewModel extends BaseViewModel {
} else { } else {
_labsService.labResultList.forEach((element) { _labsService.labResultList.forEach((element) {
List<LabResultList> patientLabOrdersClinic = labResultLists.where((elementClinic) => elementClinic.filterName == element.testCode).toList(); List<LabResultList> patientLabOrdersClinic = labResultLists.where((elementClinic) => elementClinic.filterName == element.testCode).toList();
element.percentage = element.percentage = getPercentage(element.calculatedResultFlag ?? ResultFlag.N, isTablet);
getPercentage(element.calculatedResultFlag?? ResultFlag.N, isTablet);
if (patientLabOrdersClinic.length != 0) { if (patientLabOrdersClinic.length != 0) {
labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])].patientLabResultList!.add(element); labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])].patientLabResultList!.add(element);
} else { } else {
labResultLists.add(LabResultList( labResultLists.add(LabResultList(filterName: element.testCode, description: element.packageShortDescription, lab: element));
filterName: element.testCode,
description: element.packageShortDescription,
lab: element));
} }
}); });
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
recalculatePercentage(isTablet){ recalculatePercentage(isTablet) {
for(int i = 0;i<labResultLists.length;i++){ for (int i = 0; i < labResultLists.length; i++) {
for (int j = 0; j<(labResultLists[i].patientLabResultList?.length??0 );j++){ for (int j = 0; j < (labResultLists[i].patientLabResultList?.length ?? 0); j++) {
labResultLists[i].patientLabResultList![j].percentage = getPercentage(labResultLists[i].patientLabResultList![j].calculatedResultFlag ?? ResultFlag.N, isTablet);
labResultLists[i].patientLabResultList![j].percentage = getPercentage(labResultLists[i].patientLabResultList![j].calculatedResultFlag?? ResultFlag.N, isTablet);
}
} }
}
} }
double getPercentage(ResultFlag flag, bool isTablet) { double getPercentage(ResultFlag flag, bool isTablet) {
double percentage = 0.0; double percentage = 0.0;
var division = (1/15); var division = (1 / 15);
print("its a tablet $isTablet");
switch (flag) { switch (flag) {
case ResultFlag.N: case ResultFlag.N:
percentage = division * (isTablet?7.25:6.85); percentage = division * (isTablet ? 7.25 : 6.85);
break; break;
case ResultFlag.H: case ResultFlag.H:
percentage = division * (isTablet?11:10.9); percentage = division * (isTablet ? 11 : 10.9);
break; break;
case ResultFlag.L: case ResultFlag.L:
percentage = division * (isTablet?3.5:2.95); percentage = division * (isTablet ? 3.5 : 2.95);
break; break;
case ResultFlag.CL: case ResultFlag.CL:
case ResultFlag.LCL: case ResultFlag.LCL:
percentage = division * (isTablet?0.7:.04); percentage = division * (isTablet ? 0.7 : .04);
break; break;
case ResultFlag.HCH: case ResultFlag.HCH:
case ResultFlag.CH: case ResultFlag.CH:
percentage = division * (isTablet?13.5:13.3); percentage = division * (isTablet ? 13.5 : 13.3);
break; break;
case ResultFlag.IRR: case ResultFlag.IRR:
percentage = 0; percentage = 0;
@ -178,7 +171,6 @@ class LabsViewModel extends BaseViewModel {
error = _labsService.error!; error = _labsService.error!;
setState(ViewState.Error); setState(ViewState.Error);
} else { } else {
/// commented out based on PAP-304 /// commented out based on PAP-304
// bool isShouldClear = false; // bool isShouldClear = false;
// if (_labsService.labOrdersResultsList.length == 1) { // if (_labsService.labOrdersResultsList.length == 1) {
@ -192,32 +184,32 @@ class LabsViewModel extends BaseViewModel {
// _labsService.labOrdersResultsList.clear(); // _labsService.labOrdersResultsList.clear();
var sortedResponse = _labsService.sortByFlagAndValue(_labsService.labOrdersResultsList); var sortedResponse = _labsService.sortByFlagAndValue(_labsService.labOrdersResultsList);
print("the sorted list is ${sortedResponse}");
var recentThree = _labsService.getMostRecentThree(sortedResponse); var recentThree = _labsService.getMostRecentThree(sortedResponse);
print("the recentThree list is ${recentThree}");
var mappedToThresholdValue = _labsService.getThresholdValue(); var mappedToThresholdValue = _labsService.getThresholdValue();
// var mappedToThresholdValue = _labsService.buildThresholdList(recentThree); // var mappedToThresholdValue = _labsService.buildThresholdList(recentThree);
// _labsService.adjustLabOrderResults(sortedResponse); // _labsService.adjustLabOrderResults(sortedResponse);
print("the recentThree list is ${mappedToThresholdValue}"); threshold = mappedToThresholdValue;
threshold = mappedToThresholdValue; List months = ['Jan', 'Feb', 'Mar', 'April', 'May', 'Jun', 'July', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
List months = ['Jan','Feb','Mar','April','May','Jun','July','Aug','Sep','Oct','Nov','Dec'];
double counter = 1; double counter = 1;
recentThree.reversed.forEach((element) { recentThree.reversed.forEach((element) {
try { try {
var dateTime = DateUtil.convertStringToDate(element.verifiedOnDateTime!); var dateTime = DateUtil.convertStringToDate(element.verifiedOnDateTime!);
// debugPrint("the double.parse(element.resultValue!) is ${double.parse(element.resultValue!)}"); // debugPrint("the double.parse(element.resultValue!) is ${double.parse(element.resultValue!)}");
if(double.parse(element.resultValue!)> maxYForThreeDots){ if (double.parse(element.resultValue!) > maxYForThreeDots) {
debugPrint("the double.parse(element.resultValue!) is ${double.parse(element.resultValue!)}");
maxYForThreeDots = double.parse(element.resultValue!); maxYForThreeDots = double.parse(element.resultValue!);
} }
// threePointGraphValue.add(DataPoint( labelValue: counter,value : _labsService.transformValueInRange(double.parse(element.resultValue!), element.calculatedResultFlag??""), label: "${months[dateTime.month-1]} ${dateTime.year}", date: dateTime)); // threePointGraphValue.add(DataPoint( labelValue: counter,value : _labsService.transformValueInRange(double.parse(element.resultValue!), element.calculatedResultFlag??""), label: "${months[dateTime.month-1]} ${dateTime.year}", date: dateTime));
threePointGraphValue.add(DataPoint( labelValue: counter,value : double.parse(element.resultValue!), actualValue: element.resultValue!,label: "${months[dateTime.month-1]} ${dateTime.year}", date: dateTime, referenceRangeValue:element.calculatedResultFlag ??"IRR")); threePointGraphValue.add(DataPoint(
labelValue: counter,
value: double.parse(element.resultValue!),
actualValue: element.resultValue!,
label: "${months[dateTime.month - 1]} ${dateTime.year}",
date: dateTime,
referenceRangeValue: element.calculatedResultFlag ?? "IRR"));
counter++; counter++;
} catch (e) {} } catch (e) {}
}); });
debugPrint("the maxY is ${maxYForThreeDots}");
threePointGraphValue.last.label = "thisResult"; threePointGraphValue.last.label = "thisResult";
threePointGraphValue.last.isStringResource = true; threePointGraphValue.last.isStringResource = true;
@ -227,33 +219,31 @@ class LabsViewModel extends BaseViewModel {
/// This function is used to create a full graph data points for the lab results. /// This function is used to create a full graph data points for the lab results.
/// @param onComplete: A callback function that is called when the data points are created. /// @param onComplete: A callback function that is called when the data points are created.
createFullGraphDatPoints( createFullGraphDatPoints(VoidCallback onComplete) {
VoidCallback onComplete
){
maxYForCompleteGraph = 0.0; maxYForCompleteGraph = 0.0;
completeeGraphValues.clear(); completeeGraphValues.clear();
setState(ViewState.Busy); setState(ViewState.Busy);
double counter = 1; double counter = 1;
threshold = _labsService.getThresholdValue(); threshold = _labsService.getThresholdValue();
_labsService.labOrdersResultsList.reversed.forEach((element) { _labsService.labOrdersResultsList.reversed.forEach((element) {
try { try {
print("the mapping is being done");
var dateTime = DateUtil.convertStringToDate(element.verifiedOnDateTime!); var dateTime = DateUtil.convertStringToDate(element.verifiedOnDateTime!);
if(double.parse(element.resultValue!)> maxYForCompleteGraph){ if (double.parse(element.resultValue!) > maxYForCompleteGraph) {
maxYForCompleteGraph = double.parse(element.resultValue!); maxYForCompleteGraph = double.parse(element.resultValue!);
} }
// completeeGraphValues.add(DataPoint( labelValue: counter,value : _labsService.transformValueInRange(double.parse(element.resultValue!), element.calculatedResultFlag??""), label: "${months[dateTime.month-1]} ${dateTime.year}", date: dateTime)); // completeeGraphValues.add(DataPoint( labelValue: counter,value : _labsService.transformValueInRange(double.parse(element.resultValue!), element.calculatedResultFlag??""), label: "${months[dateTime.month-1]} ${dateTime.year}", date: dateTime));
completeeGraphValues.add(DataPoint( labelValue: counter,value : double.parse(element.resultValue!), label: "${months[dateTime.month-1]} ${dateTime.year}", date: dateTime,actualValue: element.resultValue!, referenceRangeValue:element.calculatedResultFlag??"IRR" )); completeeGraphValues.add(DataPoint(
labelValue: counter,
value: double.parse(element.resultValue!),
label: "${months[dateTime.month - 1]} ${dateTime.year}",
date: dateTime,
actualValue: element.resultValue!,
referenceRangeValue: element.calculatedResultFlag ?? "IRR"));
} catch (e) { } catch (e) {
print("the mapping is having exception $e"); print("the mapping is having exception $e");
} }
++counter; ++counter;
}); });
print("the label values are $counter");
print("the completeeGraphValues length are ${completeeGraphValues.length}");
print("the completeeGraphValues last value of label ias ${completeeGraphValues.last.labelValue}");
completeeGraphValues.last.label = "thisResult"; completeeGraphValues.last.label = "thisResult";
completeeGraphValues.last.isStringResource = true; completeeGraphValues.last.isStringResource = true;
setState(ViewState.Idle); setState(ViewState.Idle);
@ -287,8 +277,7 @@ class LabsViewModel extends BaseViewModel {
Future<String> _createFileFromString(String encodedStr, String ext) async { Future<String> _createFileFromString(String encodedStr, String ext) async {
Uint8List bytes = base64.decode(encodedStr); Uint8List bytes = base64.decode(encodedStr);
String dir = (await getApplicationDocumentsDirectory()).path; String dir = (await getApplicationDocumentsDirectory()).path;
File file = File( File file = File("$dir/" + DateTime.now().millisecondsSinceEpoch.toString() + "." + ext);
"$dir/" + DateTime.now().millisecondsSinceEpoch.toString() + "." + ext);
await file.writeAsBytes(bytes); await file.writeAsBytes(bytes);
return file.path; return file.path;
} }

@ -34,7 +34,6 @@ void main() async {
await Firebase.initializeApp(); await Firebase.initializeApp();
await initLocalStorage(); await initLocalStorage();
// Pass all uncaught "fatal" errors from the framework to Crashlytics // Pass all uncaught "fatal" errors from the framework to Crashlytics
// FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterFatalError; // FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterFatalError;
@ -117,8 +116,7 @@ class _MyApp extends State<MyApp> {
void openAppLink(Uri uri) { void openAppLink(Uri uri) {
print("the uri is $uri"); print("the uri is $uri");
DeepLinkHandler.instance.handleDeepLinkAndNavigation( DeepLinkHandler.instance.handleDeepLinkAndNavigation(locator<NavigationService>().navigatorKey.currentState, uri, context);
locator<NavigationService>().navigatorKey.currentState, uri, context);
} }
@override @override
@ -142,7 +140,8 @@ class _MyApp extends State<MyApp> {
providers: [ providers: [
ChangeNotifierProvider<PharmacyPagesViewModel>( ChangeNotifierProvider<PharmacyPagesViewModel>(
create: (context) => PharmacyPagesViewModel(), create: (context) => PharmacyPagesViewModel(),
), ChangeNotifierProvider<AuthProviderViewModel>( ),
ChangeNotifierProvider<AuthProviderViewModel>(
create: (context) => AuthProviderViewModel(), create: (context) => AuthProviderViewModel(),
), ),
ChangeNotifierProvider<ProjectViewModel>( ChangeNotifierProvider<ProjectViewModel>(

@ -31,144 +31,126 @@ class FlowChartPage extends StatelessWidget {
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.getPatientLabOrdersResults( onModelReady: (model) =>
patientLabOrder: patientLabOrder, model.getPatientLabOrdersResults(patientLabOrder: patientLabOrder, procedure: filterName, isVidaPlus: Utils.isVidaPlusProject(projectViewModel!, int.parse(patientLabOrder!.projectID!))),
procedure: filterName, builder: (context, model, w) {
isVidaPlus: Utils.isVidaPlusProject( return SizedBox(
projectViewModel!, int.parse(patientLabOrder!.projectID!))), height: MediaQuery.sizeOf(context).height * .75,
builder: (context, model, w) { child: (model.state == ViewState.Busy)
print("the maxY in builder is ${model.maxYForCompleteGraph}"); ? Material(
return SizedBox( color: Colors.grey.withOpacity(0.6),
height: MediaQuery.sizeOf(context).height * .75, shape: RoundedRectangleBorder(borderRadius: BorderRadius.only(topLeft: Radius.circular(20), topRight: Radius.circular(20))),
child: (model.state == ViewState.Busy) child: Center(
? Material( child: Container(child: GifLoaderContainer(), margin: EdgeInsets.only(bottom: MediaQuery.of(context).size.height * 0.09)),
color: Colors.grey.withOpacity(0.6), ),
shape: RoundedRectangleBorder( )
borderRadius: BorderRadius.only( : SingleChildScrollView(
topLeft: Radius.circular(20), child: model.labOrdersResultsList.isNotEmpty
topRight: Radius.circular(20))), ? Column(
child: Center( crossAxisAlignment: CrossAxisAlignment.start,
child: Container( mainAxisSize: MainAxisSize.min,
child: GifLoaderContainer(), children: [
margin: EdgeInsets.only( Padding(
bottom: MediaQuery.of(context).size.height * 0.09)), padding: const EdgeInsets.only(top: 16.0, right: 16.0, bottom: 10, left: 16.0),
), child: Row(
) mainAxisAlignment: MainAxisAlignment.spaceBetween,
: SingleChildScrollView( children: [
child: model.labOrdersResultsList.isNotEmpty Text(
? Column( filterName ?? "",
crossAxisAlignment: CrossAxisAlignment.start, style: TextStyle(
mainAxisSize: MainAxisSize.min, fontSize: 21,
children: [ fontWeight: FontWeight.w700,
color: Colors.black,
Padding( letterSpacing: -0.64,
padding: const EdgeInsets.only( ),
top: 16.0, right: 16.0, bottom: 10, left: 16.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(filterName??"", style: TextStyle(
fontSize: 21,
fontWeight: FontWeight.w700,
color: Colors.black,
letterSpacing: -0.64,
),),
GestureDetector(
onTap: () => Navigator.pop(context),
child: Align(
alignment: Alignment.centerRight,
child: Icon(
Icons.close,
color: Colors.black,
size: 28,
), ),
), GestureDetector(
onTap: () => Navigator.pop(context),
child: Align(
alignment: Alignment.centerRight,
child: Icon(
Icons.close,
color: Colors.black,
size: 28,
),
),
),
],
), ),
],
),
),
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: [ Container(
BoxShadow( width: double.infinity,
color: Color(0xff000000).withOpacity(.05), padding: EdgeInsets.only(left: 17, top: 12, right: 13, bottom: 12),
//spreadRadius: 5, margin: EdgeInsets.only(left: 21, right: 21, top: 21),
blurRadius: 27, decoration: BoxDecoration(
offset: Offset(0, -3), shape: BoxShape.rectangle,
), color: Colors.white,
], borderRadius: BorderRadius.all(
), Radius.circular(10.0),
// child: LineChartCurved(
// title: filterName,
// labResult: model.labOrdersResultsList,
// ),
// child: ShowChart(
// title: filterName!,
// timeSeries: model.timeSeries,
// indexes: model.timeSeries.length ~/ 5.5 ?? 0,
// ),
child: Column(
children: [
SizedBox(
height: MediaQuery.sizeOf(context).height / 4,
child: DynamicResultChart(
dataPoints: model.threePointGraphValue,
thresholds: model.threshold,
maxY: model.maxYForThreeDots,
width: MediaQuery.sizeOf(context).width - 77,
scrollDirection: Axis.horizontal,
height: MediaQuery.sizeOf(context).height / 4,
), ),
boxShadow: [
BoxShadow(
color: Color(0xff000000).withOpacity(.05),
//spreadRadius: 5,
blurRadius: 27,
offset: Offset(0, -3),
),
],
), ),
// child: LineChartCurved(
InkWell( // title: filterName,
onTap: () { // labResult: model.labOrdersResultsList,
model.createFullGraphDatPoints(() { // ),
Navigator.push(context, // child: ShowChart(
MaterialPageRoute(builder: (_) { // title: filterName!,
return FullScreenGraph( // timeSeries: model.timeSeries,
completeeGraphValues: model.completeeGraphValues, // indexes: model.timeSeries.length ~/ 5.5 ?? 0,
threshold: model.threshold, // ),
maxY : model.maxYForCompleteGraph child: Column(
); children: [
})); SizedBox(
}); height: MediaQuery.sizeOf(context).height / 4,
}, child: DynamicResultChart(
// child: Text(TranslationBase.of(context) dataPoints: model.threePointGraphValue,
// .seeAllGraphValues), thresholds: model.threshold,
child: Utils.tableColumnValueWithUnderLine(TranslationBase.of(context).seeAllGraphValues, isLast: true, isCapitable: false), maxY: model.maxYForThreeDots,
) width: MediaQuery.sizeOf(context).width - 77,
], scrollDirection: Axis.horizontal,
height: MediaQuery.sizeOf(context).height / 4,
),
),
InkWell(
onTap: () {
model.createFullGraphDatPoints(() {
Navigator.push(context, MaterialPageRoute(builder: (_) {
return FullScreenGraph(completeeGraphValues: model.completeeGraphValues, threshold: model.threshold, maxY: model.maxYForCompleteGraph);
}));
});
},
// child: Text(TranslationBase.of(context)
// .seeAllGraphValues),
child: Utils.tableColumnValueWithUnderLine(TranslationBase.of(context).seeAllGraphValues, isLast: true, isCapitable: false),
)
],
),
),
LabResultChartAndDetails(
name: filterName!,
// labResult: model.labOrdersResultsList,
labResult: model.labOrdersResultsList.reversed.toList(),
),
],
)
: Center(
child: Container(
padding: EdgeInsets.only(top: MediaQuery.of(context).size.height * 0.32),
child: Center(
child: getNoDataWidget(context),
),
), ),
), ),
LabResultChartAndDetails( ),
name: filterName!, );
// labResult: model.labOrdersResultsList, });
labResult: model.labOrdersResultsList.reversed.toList(),
),
],
)
: Center(
child: Container(
padding: EdgeInsets.only(
top: MediaQuery.of(context).size.height * 0.32),
child: Center(
child: getNoDataWidget(context),
),
),
),
),
);}
);
} }
} }

@ -20,13 +20,11 @@ class DynamicResultChart extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
var minY = 0.0; var minY = 0.0;
// var maxY = 0.0; // var maxY = 0.0;
print("the maxY from parameter is $maxY");
double interval = 20; double interval = 20;
if((maxY??0)>10 &&(maxY??0)<=20) interval = 2; if((maxY??0)>10 &&(maxY??0)<=20) interval = 2;
else if((maxY??0)>5 &&(maxY??0)<=10) interval = 1; else if((maxY??0)>5 &&(maxY??0)<=10) interval = 1;
else if((maxY??0)>=0 &&(maxY??0)<=5) interval = .4; else if((maxY??0)>=0 &&(maxY??0)<=5) interval = .4;
// else if((maxY??0)>=100) interval = 20; // else if((maxY??0)>=100) interval = 20;
print("the interval parameter is $interval");
// if (thresholds.isNotEmpty) { // if (thresholds.isNotEmpty) {
// print("the thresholds are $thresholds"); // print("the thresholds are $thresholds");
@ -198,7 +196,6 @@ class DynamicResultChart extends StatelessWidget {
List<LineChartBarData> _buildColoredLineSegments(List<DataPoint> dataPoints, List<ThresholdRange> thresholds) { List<LineChartBarData> _buildColoredLineSegments(List<DataPoint> dataPoints, List<ThresholdRange> thresholds) {
List<LineChartBarData> segments = []; List<LineChartBarData> segments = [];
Color getColor(String value) { Color getColor(String value) {
print("the value to compare is $value");
for (int i = thresholds.length - 1; i >= 0; i--) { for (int i = thresholds.length - 1; i >= 0; i--) {
if (value == thresholds[i].label) { if (value == thresholds[i].label) {
return thresholds[i].lineColor; return thresholds[i].lineColor;
@ -249,7 +246,6 @@ class DynamicResultChart extends StatelessWidget {
final List<FlSpot> allSpots = dataPoints.asMap().entries.map((entry) { final List<FlSpot> allSpots = dataPoints.asMap().entries.map((entry) {
return FlSpot(entry.key.toDouble(), entry.value.value); return FlSpot(entry.key.toDouble(), entry.value.value);
}).toList(); }).toList();
print("the spots are $allSpots");
var data = [ var data = [
// ...segments // ...segments

@ -141,8 +141,6 @@ class _LabItemState extends State<LabItem> {
scrollControlDisabledMaxHeightRatio: .75, scrollControlDisabledMaxHeightRatio: .75,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.only(topLeft: Radius.circular(20), topRight: Radius.circular(20))), shape: RoundedRectangleBorder(borderRadius: BorderRadius.only(topLeft: Radius.circular(20), topRight: Radius.circular(20))),
builder: (context) { builder: (context) {
print('builder: the bottom sheet is showing');
return FlowChartPage( return FlowChartPage(
filterName: procedure, filterName: procedure,
patientLabOrder: widget.patientLabOrders, patientLabOrder: widget.patientLabOrders,

@ -393,6 +393,7 @@ class ItemResultCardWidgetWithParams extends StatelessWidget {
Text( Text(
"${TranslationBase.of(context).referenceRange} \n $referenceRange", "${TranslationBase.of(context).referenceRange} \n $referenceRange",
style: TextStyle( style: TextStyle(
overflow: TextOverflow.clip,
fontSize: 10, fontSize: 10,
fontFamily: fontFamily, fontFamily: fontFamily,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,

Loading…
Cancel
Save