align loading bestween options

This commit is contained in:
2024-08-28 12:20:36 +02:00
parent 12dd69b5d7
commit c99bc8db29
4 changed files with 132 additions and 68 deletions

View File

@@ -307,7 +307,7 @@ class _BuildFilesListState extends State<BuildFilesList> {
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) {

View File

@@ -643,11 +643,27 @@ class _PatientFilesState extends State<PatientFiles> {
@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<PatientFiles> {
),
);
} 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"),
),
);
}
},

View File

@@ -331,11 +331,27 @@ class _PatientNotesState extends State<PatientNotes> {
@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<PatientNotes> {
),
);
} 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"),
),
);
}
},

View File

@@ -197,19 +197,21 @@ class _PatientManagerState extends State<PatientManager> {
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<PatientManager> {
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<PatientManager> {
);
}
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<PatientManager> {
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<PatientQueue> patientQueueList;
@@ -362,26 +369,29 @@ class _PatientManagerState extends State<PatientManager> {
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,
),
),
),
);