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(
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"), child: Text("Error Loading Notes"),
),
); );
} }
}, },

View File

@@ -197,7 +197,8 @@ 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(
child: Container(
//height: 500, //height: 500,
decoration: BoxDecoration( decoration: BoxDecoration(
color: color:
@@ -210,6 +211,7 @@ class _PatientManagerState extends State<PatientManager> {
width: 3.0), 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,7 +228,8 @@ class _PatientManagerState extends State<PatientManager> {
child: displayPatientList(patientsList, searchString), child: displayPatientList(patientsList, searchString),
); );
} else { } else {
return Container( return Expanded(
child: Container(
//height: 500, //height: 500,
decoration: BoxDecoration( decoration: BoxDecoration(
color: color:
@@ -249,6 +252,7 @@ class _PatientManagerState extends State<PatientManager> {
textAlign: TextAlign.center, 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,10 +339,12 @@ 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(
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),
border: Border.all( border: Border.all(
color: MzanziInnovationHub.of(context)! color: MzanziInnovationHub.of(context)!
@@ -347,6 +353,7 @@ class _PatientManagerState extends State<PatientManager> {
width: 3.0), 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,10 +369,12 @@ class _PatientManagerState extends State<PatientManager> {
child: displayQueueList(patientQueueList), child: displayQueueList(patientQueueList),
); );
} else { } else {
return Container( return Expanded(
child: 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),
border: Border.all( border: Border.all(
color: MzanziInnovationHub.of(context)! color: MzanziInnovationHub.of(context)!
@@ -384,6 +393,7 @@ class _PatientManagerState extends State<PatientManager> {
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
), ),
),
); );
} }
}, },