From c99bc8db2928651175939905361c964bd294aff7 Mon Sep 17 00:00:00 2001 From: yaso-meth Date: Wed, 28 Aug 2024 12:20:36 +0200 Subject: [PATCH] align loading bestween options --- .../components/builders/buildFilesList.dart | 2 +- .../lib/components/patientFiles.dart | 33 ++++- .../lib/components/patientNotes.dart | 33 ++++- .../lib/pages/patientManager.dart | 132 ++++++++++-------- 4 files changed, 132 insertions(+), 68 deletions(-) diff --git a/Frontend/patient_manager/lib/components/builders/buildFilesList.dart b/Frontend/patient_manager/lib/components/builders/buildFilesList.dart index d77ce10a..dab13510 100644 --- a/Frontend/patient_manager/lib/components/builders/buildFilesList.dart +++ b/Frontend/patient_manager/lib/components/builders/buildFilesList.dart @@ -307,7 +307,7 @@ class _BuildFilesListState extends State { double height = size.height; if (widget.files.isNotEmpty) { return SizedBox( - height: height - 250, + height: height - 254, child: ListView.separated( shrinkWrap: true, separatorBuilder: (BuildContext context, int index) { diff --git a/Frontend/patient_manager/lib/components/patientFiles.dart b/Frontend/patient_manager/lib/components/patientFiles.dart index 504047e9..83215fff 100644 --- a/Frontend/patient_manager/lib/components/patientFiles.dart +++ b/Frontend/patient_manager/lib/components/patientFiles.dart @@ -643,11 +643,27 @@ class _PatientFilesState extends State { @override Widget build(BuildContext context) { + final Size size = MediaQuery.sizeOf(context); + //double width = size.width; + double height = size.height; return FutureBuilder( future: futueFiles, builder: (context, snapshot) { if (snapshot.connectionState == ConnectionState.waiting) { - return const Mihloadingcircle(); + return Container( + height: height - 177, + decoration: BoxDecoration( + color: MzanziInnovationHub.of(context)!.theme.primaryColor(), + borderRadius: BorderRadius.circular(25.0), + border: Border.all( + color: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), + width: 3.0), + ), + child: const Center( + child: Mihloadingcircle(), + ), + ); } else if (snapshot.hasData) { final filesList = snapshot.data!; return Container( @@ -686,8 +702,19 @@ class _PatientFilesState extends State { ), ); } else { - return const Center( - child: Text("Error Loading Files"), + return Container( + height: height - 177, + decoration: BoxDecoration( + color: MzanziInnovationHub.of(context)!.theme.primaryColor(), + borderRadius: BorderRadius.circular(25.0), + border: Border.all( + color: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), + width: 3.0), + ), + child: const Center( + child: Text("Error Loading Notes"), + ), ); } }, diff --git a/Frontend/patient_manager/lib/components/patientNotes.dart b/Frontend/patient_manager/lib/components/patientNotes.dart index 01740a86..3a06637b 100644 --- a/Frontend/patient_manager/lib/components/patientNotes.dart +++ b/Frontend/patient_manager/lib/components/patientNotes.dart @@ -331,11 +331,27 @@ class _PatientNotesState extends State { @override Widget build(BuildContext context) { + final Size size = MediaQuery.sizeOf(context); + //double width = size.width; + double height = size.height; return FutureBuilder( future: futueNotes, builder: (context, snapshot) { if (snapshot.connectionState == ConnectionState.waiting) { - return const Mihloadingcircle(); + return Container( + height: height - 177, + decoration: BoxDecoration( + color: MzanziInnovationHub.of(context)!.theme.primaryColor(), + borderRadius: BorderRadius.circular(25.0), + border: Border.all( + color: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), + width: 3.0), + ), + child: const Center( + child: Mihloadingcircle(), + ), + ); } else if (snapshot.hasData) { final notesList = snapshot.data!; return Container( @@ -374,8 +390,19 @@ class _PatientNotesState extends State { ), ); } else { - return const Center( - child: Text("Error Loading Notes"), + return Container( + height: height - 177, + decoration: BoxDecoration( + color: MzanziInnovationHub.of(context)!.theme.primaryColor(), + borderRadius: BorderRadius.circular(25.0), + border: Border.all( + color: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), + width: 3.0), + ), + child: const Center( + child: Text("Error Loading Notes"), + ), ); } }, diff --git a/Frontend/patient_manager/lib/pages/patientManager.dart b/Frontend/patient_manager/lib/pages/patientManager.dart index 39370c37..b5d55115 100644 --- a/Frontend/patient_manager/lib/pages/patientManager.dart +++ b/Frontend/patient_manager/lib/pages/patientManager.dart @@ -197,19 +197,21 @@ class _PatientManagerState extends State { builder: (context, snapshot) { //print("patient Liust ${snapshot.data}"); if (snapshot.connectionState == ConnectionState.waiting) { - return Container( - //height: 500, - decoration: BoxDecoration( - color: - MzanziInnovationHub.of(context)!.theme.primaryColor(), - borderRadius: BorderRadius.circular(25.0), - border: Border.all( - color: MzanziInnovationHub.of(context)! - .theme - .secondaryColor(), - width: 3.0), + return Expanded( + child: Container( + //height: 500, + decoration: BoxDecoration( + color: + MzanziInnovationHub.of(context)!.theme.primaryColor(), + borderRadius: BorderRadius.circular(25.0), + border: Border.all( + color: MzanziInnovationHub.of(context)! + .theme + .secondaryColor(), + width: 3.0), + ), + child: const Mihloadingcircle(), ), - child: const Mihloadingcircle(), ); } else if (snapshot.connectionState == ConnectionState.done && snapshot.hasData) { @@ -226,27 +228,29 @@ class _PatientManagerState extends State { child: displayPatientList(patientsList, searchString), ); } else { - return Container( - //height: 500, - decoration: BoxDecoration( - color: - MzanziInnovationHub.of(context)!.theme.primaryColor(), - borderRadius: BorderRadius.circular(25.0), - border: Border.all( - color: MzanziInnovationHub.of(context)! - .theme - .secondaryColor(), - width: 3.0), - ), - child: Center( - child: Text( - "$errorCode: Error pulling Patients Data\n$baseUrl/patients/search/$searchString\n$errorBody", - style: TextStyle( - fontSize: 25, + return Expanded( + child: Container( + //height: 500, + decoration: BoxDecoration( + color: + MzanziInnovationHub.of(context)!.theme.primaryColor(), + borderRadius: BorderRadius.circular(25.0), + border: Border.all( color: MzanziInnovationHub.of(context)! .theme - .errorColor()), - textAlign: TextAlign.center, + .secondaryColor(), + width: 3.0), + ), + child: Center( + child: Text( + "$errorCode: Error pulling Patients Data\n$baseUrl/patients/search/$searchString\n$errorBody", + style: TextStyle( + fontSize: 25, + color: MzanziInnovationHub.of(context)! + .theme + .errorColor()), + textAlign: TextAlign.center, + ), ), ), ); @@ -279,7 +283,7 @@ class _PatientManagerState extends State { ); } return Container( - //height: 500, + height: 500, decoration: BoxDecoration( color: MzanziInnovationHub.of(context)!.theme.primaryColor(), borderRadius: BorderRadius.circular(25.0), @@ -335,18 +339,21 @@ class _PatientManagerState extends State { builder: (context, snapshot) { //print("patient Queue List ${snapshot.hasData}"); if (snapshot.connectionState == ConnectionState.waiting) { - return Container( - //height: 500, - decoration: BoxDecoration( - color: MzanziInnovationHub.of(context)!.theme.primaryColor(), - borderRadius: BorderRadius.circular(25.0), - border: Border.all( - color: MzanziInnovationHub.of(context)! - .theme - .secondaryColor(), - width: 3.0), + return Expanded( + child: Container( + height: 500, + decoration: BoxDecoration( + color: + MzanziInnovationHub.of(context)!.theme.primaryColor(), + borderRadius: BorderRadius.circular(25.0), + border: Border.all( + color: MzanziInnovationHub.of(context)! + .theme + .secondaryColor(), + width: 3.0), + ), + child: const Mihloadingcircle(), ), - child: const Mihloadingcircle(), ); } else if (snapshot.connectionState == ConnectionState.done) { List patientQueueList; @@ -362,26 +369,29 @@ class _PatientManagerState extends State { child: displayQueueList(patientQueueList), ); } else { - return Container( - //height: 500, - decoration: BoxDecoration( - color: MzanziInnovationHub.of(context)!.theme.primaryColor(), - borderRadius: BorderRadius.circular(25.0), - border: Border.all( - color: MzanziInnovationHub.of(context)! - .theme - .secondaryColor(), - width: 3.0), - ), - child: Center( - child: Text( - "$errorCode: Error pulling Patients Data\n$baseUrl/patients/search/$searchString\n$errorBody", - style: TextStyle( - fontSize: 25, + return Expanded( + child: Container( + //height: 500, + decoration: BoxDecoration( + color: + MzanziInnovationHub.of(context)!.theme.primaryColor(), + borderRadius: BorderRadius.circular(25.0), + border: Border.all( color: MzanziInnovationHub.of(context)! .theme - .errorColor()), - textAlign: TextAlign.center, + .secondaryColor(), + width: 3.0), + ), + child: Center( + child: Text( + "$errorCode: Error pulling Patients Data\n$baseUrl/patients/search/$searchString\n$errorBody", + style: TextStyle( + fontSize: 25, + color: MzanziInnovationHub.of(context)! + .theme + .errorColor()), + textAlign: TextAlign.center, + ), ), ), );