|
|
|
|
@ -6,55 +6,67 @@ import 'package:hmg_patient_app/widgets/others/app_scaffold_widget.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
class FullScreenGraph extends StatelessWidget {
|
|
|
|
|
final List<DataPoint> completeeGraphValues ;
|
|
|
|
|
final List<ThresholdRange> threshold ;
|
|
|
|
|
final double maxY ;
|
|
|
|
|
final List<DataPoint> completeeGraphValues;
|
|
|
|
|
|
|
|
|
|
final List<ThresholdRange> threshold;
|
|
|
|
|
|
|
|
|
|
final double maxY;
|
|
|
|
|
|
|
|
|
|
const FullScreenGraph(
|
|
|
|
|
{super.key,
|
|
|
|
|
required this.completeeGraphValues,
|
|
|
|
|
required this.threshold,
|
|
|
|
|
required this.maxY});
|
|
|
|
|
|
|
|
|
|
const FullScreenGraph({super.key, required this.completeeGraphValues, required this.threshold, required this. maxY});
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return AppScaffold(
|
|
|
|
|
isShowAppBar: true,
|
|
|
|
|
appBarTitle: TranslationBase.of(context).labResult,
|
|
|
|
|
showNewAppBar: true,
|
|
|
|
|
showNewAppBarTitle: true,
|
|
|
|
|
backgroundColor: Color(0xffF8F8F8),
|
|
|
|
|
body: RotatedBox(
|
|
|
|
|
quarterTurns: 1,
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
// width: MediaQuery.sizeOf(context).height,
|
|
|
|
|
height: MediaQuery.sizeOf(context).width,
|
|
|
|
|
child: Material(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 18),
|
|
|
|
|
isShowAppBar: true,
|
|
|
|
|
appBarTitle: TranslationBase.of(context).labResult,
|
|
|
|
|
showNewAppBar: true,
|
|
|
|
|
showNewAppBarTitle: true,
|
|
|
|
|
backgroundColor: Color(0xffF8F8F8),
|
|
|
|
|
body: RotatedBox(
|
|
|
|
|
quarterTurns: 1,
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
// width: MediaQuery.sizeOf(context).height,
|
|
|
|
|
height: MediaQuery.sizeOf(context).width,
|
|
|
|
|
child: Material(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 18),
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
|
scrollDirection: Axis.horizontal,
|
|
|
|
|
child: DynamicResultChart(
|
|
|
|
|
dataPoints: completeeGraphValues,
|
|
|
|
|
thresholds: threshold,
|
|
|
|
|
maxY : maxY,
|
|
|
|
|
// width:((completeeGraphValues.length <=2)? MediaQuery.sizeOf(context).height : (MediaQuery.sizeOf(context).height* (
|
|
|
|
|
// completeeGraphValues.length <= 3
|
|
|
|
|
// ? 1
|
|
|
|
|
// : (completeeGraphValues.length/3))
|
|
|
|
|
// ) )-77,
|
|
|
|
|
width: MediaQuery.sizeOf(context).height-100,
|
|
|
|
|
dataPoints: completeeGraphValues,
|
|
|
|
|
thresholds: threshold,
|
|
|
|
|
maxY: maxY,
|
|
|
|
|
width:((completeeGraphValues.length <=2)? MediaQuery.sizeOf(context).height : (MediaQuery.sizeOf(context).height* (
|
|
|
|
|
completeeGraphValues.length <= 15
|
|
|
|
|
? 1
|
|
|
|
|
: (completeeGraphValues.length/15))
|
|
|
|
|
) )-100,
|
|
|
|
|
maxX: completeeGraphValues.length+1,
|
|
|
|
|
// width: MediaQuery.sizeOf(context).height - 100,
|
|
|
|
|
scrollDirection: Axis.horizontal,
|
|
|
|
|
height: MediaQuery.sizeOf(context).width,
|
|
|
|
|
isFullScreenGraph: true,
|
|
|
|
|
showBottomTitleDates: true,
|
|
|
|
|
isFullScreeGraph: true,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
// double getMax(List<DataPoint> dataPoints) {
|
|
|
|
|
// double max = double.negativeInfinity;
|
|
|
|
|
// for (var point in dataPoints) {
|
|
|
|
|
// if (point.value > max) {
|
|
|
|
|
// max = point.y;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// return max;
|
|
|
|
|
// }
|
|
|
|
|
// double getMax(List<DataPoint> dataPoints) {
|
|
|
|
|
// double max = double.negativeInfinity;
|
|
|
|
|
// for (var point in dataPoints) {
|
|
|
|
|
// if (point.value > max) {
|
|
|
|
|
// max = point.y;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// return max;
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
|