|
|
|
@ -31,13 +31,32 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
|
|
|
|
bool _isShowMore = true;
|
|
|
|
bool _isShowMore = true;
|
|
|
|
late ProjectViewModel projectViewModel;
|
|
|
|
late ProjectViewModel projectViewModel;
|
|
|
|
late String? labSpecialResult;
|
|
|
|
late String? labSpecialResult;
|
|
|
|
|
|
|
|
bool isTabletScreen = false;
|
|
|
|
|
|
|
|
LabsViewModel? model;
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
super.initState();
|
|
|
|
|
|
|
|
|
|
|
|
labSpecialResult = widget.details ?? TranslationBase.of(context).noDataAvailable;
|
|
|
|
labSpecialResult = widget.details ?? TranslationBase.of(context).noDataAvailable;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
|
|
|
void didChangeDependencies() {
|
|
|
|
|
|
|
|
super.didChangeDependencies();
|
|
|
|
|
|
|
|
print("did change dependency is called");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var oldStateTablateScreenState = isTabletScreen;
|
|
|
|
|
|
|
|
isTabletScreen = isTablet(context);
|
|
|
|
|
|
|
|
if(isTabletScreen != oldStateTablateScreenState);
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
print("the screen width is changed");
|
|
|
|
|
|
|
|
model?.recalculatePercentage(isTabletScreen);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool isTablet(BuildContext context) {
|
|
|
|
bool isTablet(BuildContext context) {
|
|
|
|
final size = MediaQuery.of(context).size;
|
|
|
|
final size = MediaQuery.of(context).size;
|
|
|
|
final shortestSide = size.shortestSide;
|
|
|
|
final shortestSide = size.shortestSide;
|
|
|
|
@ -45,10 +64,13 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
|
|
|
isTabletScreen = isTablet(context);
|
|
|
|
projectViewModel = Provider.of(context);
|
|
|
|
projectViewModel = Provider.of(context);
|
|
|
|
return BaseView<LabsViewModel>(
|
|
|
|
return BaseView<LabsViewModel>(
|
|
|
|
onModelReady: (model) =>
|
|
|
|
onModelReady: (model) {
|
|
|
|
model.getPatientLabResult(isVidaPlus: Utils.isVidaPlusProject(projectViewModel, int.parse(widget.patientLabOrder!.projectID!)), patientLabOrder: widget.patientLabOrder!, isTablet: isTablet(context)),
|
|
|
|
this.model = model;
|
|
|
|
|
|
|
|
model.getPatientLabResult(isVidaPlus: Utils.isVidaPlusProject(projectViewModel, int.parse(widget.patientLabOrder!.projectID!)), patientLabOrder: widget.patientLabOrder!, isTablet: isTabletScreen);
|
|
|
|
|
|
|
|
},
|
|
|
|
builder: (_, model, w) => NetworkBaseView(
|
|
|
|
builder: (_, model, w) => NetworkBaseView(
|
|
|
|
baseViewModel: model,
|
|
|
|
baseViewModel: model,
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
|