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; double height = size.height;
if (widget.files.isNotEmpty) { if (widget.files.isNotEmpty) {
return SizedBox( return SizedBox(
height: height - 250, height: height - 254,
child: ListView.separated( child: ListView.separated(
shrinkWrap: true, shrinkWrap: true,
separatorBuilder: (BuildContext context, int index) { separatorBuilder: (BuildContext context, int index) {

View File

@@ -643,11 +643,27 @@ class _PatientFilesState extends State<PatientFiles> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final Size size = MediaQuery.sizeOf(context);
//double width = size.width;
double height = size.height;
return FutureBuilder( return FutureBuilder(
future: futueFiles, future: futueFiles,
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) { 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) { } else if (snapshot.hasData) {
final filesList = snapshot.data!; final filesList = snapshot.data!;
return Container( return Container(
@@ -686,8 +702,19 @@ class _PatientFilesState extends State<PatientFiles> {
), ),
); );
} else { } else {
return const Center( return Container(
child: Text("Error Loading Files"), 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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final Size size = MediaQuery.sizeOf(context);
//double width = size.width;
double height = size.height;
return FutureBuilder( return FutureBuilder(
future: futueNotes, future: futueNotes,
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) { 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) { } else if (snapshot.hasData) {
final notesList = snapshot.data!; final notesList = snapshot.data!;
return Container( return Container(
@@ -374,8 +390,19 @@ class _PatientNotesState extends State<PatientNotes> {
), ),
); );
} else { } else {
return const Center( return Container(
child: Text("Error Loading Notes"), 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) { builder: (context, snapshot) {
//print("patient Liust ${snapshot.data}"); //print("patient Liust ${snapshot.data}");
if (snapshot.connectionState == ConnectionState.waiting) { if (snapshot.connectionState == ConnectionState.waiting) {
return Container( return Expanded(
//height: 500, child: Container(
decoration: BoxDecoration( //height: 500,
color: decoration: BoxDecoration(
MzanziInnovationHub.of(context)!.theme.primaryColor(), color:
borderRadius: BorderRadius.circular(25.0), MzanziInnovationHub.of(context)!.theme.primaryColor(),
border: Border.all( borderRadius: BorderRadius.circular(25.0),
color: MzanziInnovationHub.of(context)! border: Border.all(
.theme color: MzanziInnovationHub.of(context)!
.secondaryColor(), .theme
width: 3.0), .secondaryColor(),
width: 3.0),
),
child: const Mihloadingcircle(),
), ),
child: const Mihloadingcircle(),
); );
} else if (snapshot.connectionState == ConnectionState.done && } else if (snapshot.connectionState == ConnectionState.done &&
snapshot.hasData) { snapshot.hasData) {
@@ -226,27 +228,29 @@ class _PatientManagerState extends State<PatientManager> {
child: displayPatientList(patientsList, searchString), child: displayPatientList(patientsList, searchString),
); );
} else { } else {
return Container( return Expanded(
//height: 500, child: Container(
decoration: BoxDecoration( //height: 500,
color: decoration: BoxDecoration(
MzanziInnovationHub.of(context)!.theme.primaryColor(), color:
borderRadius: BorderRadius.circular(25.0), MzanziInnovationHub.of(context)!.theme.primaryColor(),
border: Border.all( borderRadius: BorderRadius.circular(25.0),
color: MzanziInnovationHub.of(context)! border: Border.all(
.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,
color: MzanziInnovationHub.of(context)! color: MzanziInnovationHub.of(context)!
.theme .theme
.errorColor()), .secondaryColor(),
textAlign: TextAlign.center, 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( return Container(
//height: 500, height: 500,
decoration: BoxDecoration( decoration: BoxDecoration(
color: MzanziInnovationHub.of(context)!.theme.primaryColor(), color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
borderRadius: BorderRadius.circular(25.0), borderRadius: BorderRadius.circular(25.0),
@@ -335,18 +339,21 @@ class _PatientManagerState extends State<PatientManager> {
builder: (context, snapshot) { builder: (context, snapshot) {
//print("patient Queue List ${snapshot.hasData}"); //print("patient Queue List ${snapshot.hasData}");
if (snapshot.connectionState == ConnectionState.waiting) { if (snapshot.connectionState == ConnectionState.waiting) {
return Container( return Expanded(
//height: 500, child: Container(
decoration: BoxDecoration( height: 500,
color: MzanziInnovationHub.of(context)!.theme.primaryColor(), decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25.0), color:
border: Border.all( MzanziInnovationHub.of(context)!.theme.primaryColor(),
color: MzanziInnovationHub.of(context)! borderRadius: BorderRadius.circular(25.0),
.theme border: Border.all(
.secondaryColor(), color: MzanziInnovationHub.of(context)!
width: 3.0), .theme
.secondaryColor(),
width: 3.0),
),
child: const Mihloadingcircle(),
), ),
child: const Mihloadingcircle(),
); );
} else if (snapshot.connectionState == ConnectionState.done) { } else if (snapshot.connectionState == ConnectionState.done) {
List<PatientQueue> patientQueueList; List<PatientQueue> patientQueueList;
@@ -362,26 +369,29 @@ class _PatientManagerState extends State<PatientManager> {
child: displayQueueList(patientQueueList), child: displayQueueList(patientQueueList),
); );
} else { } else {
return Container( return Expanded(
//height: 500, child: Container(
decoration: BoxDecoration( //height: 500,
color: MzanziInnovationHub.of(context)!.theme.primaryColor(), decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25.0), color:
border: Border.all( MzanziInnovationHub.of(context)!.theme.primaryColor(),
color: MzanziInnovationHub.of(context)! borderRadius: BorderRadius.circular(25.0),
.theme border: Border.all(
.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)! color: MzanziInnovationHub.of(context)!
.theme .theme
.errorColor()), .secondaryColor(),
textAlign: TextAlign.center, 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,
),
), ),
), ),
); );