Fix pop up windows with input. make more dynamic

This commit is contained in:
2024-09-19 10:56:57 +02:00
parent 7f2367a9ce
commit 7111ad3600
10 changed files with 271 additions and 230 deletions

View File

@@ -28,7 +28,7 @@ class _MedcertinputState extends State<Medcertinput> {
//height: 325, //height: 325,
child: Column( child: Column(
children: [ children: [
const SizedBox(height: 50.0), //const SizedBox(height: 50.0),
SizedBox( SizedBox(
width: 700, width: 700,
child: MIHDateField( child: MIHDateField(

View File

@@ -80,6 +80,8 @@ class _MedicineSearchState extends State<MedicineSearch> {
MzanziInnovationHub.of(context)!.theme.secondaryColor(), MzanziInnovationHub.of(context)!.theme.secondaryColor(),
width: 5.0), width: 5.0),
), ),
child: SingleChildScrollView(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@@ -89,8 +91,9 @@ class _MedicineSearchState extends State<MedicineSearch> {
"Select Medicine", "Select Medicine",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
color: color: MzanziInnovationHub.of(context)!
MzanziInnovationHub.of(context)!.theme.secondaryColor(), .theme
.secondaryColor(),
fontSize: 35.0, fontSize: 35.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
@@ -104,7 +107,8 @@ class _MedicineSearchState extends State<MedicineSearch> {
height: 400, height: 400,
child: Mihloadingcircle(), child: Mihloadingcircle(),
); );
} else if (snapshot.hasData && snapshot.data!.isNotEmpty) { } else if (snapshot.hasData &&
snapshot.data!.isNotEmpty) {
final medsList = snapshot.data!; final medsList = snapshot.data!;
return SizedBox( return SizedBox(
height: 400, height: 400,
@@ -120,7 +124,8 @@ class _MedicineSearchState extends State<MedicineSearch> {
child: Center( child: Center(
child: Text( child: Text(
"No Match Found\nPlease close and manually capture medicine", "No Match Found\nPlease close and manually capture medicine",
style: TextStyle(fontSize: 25, color: Colors.grey), style:
TextStyle(fontSize: 25, color: Colors.grey),
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
), ),
@@ -131,6 +136,7 @@ class _MedicineSearchState extends State<MedicineSearch> {
], ],
), ),
), ),
),
Positioned( Positioned(
top: 5, top: 5,
right: 5, right: 5,

View File

@@ -17,7 +17,25 @@ class MIHBody extends StatefulWidget {
class _MIHBodyState extends State<MIHBody> { class _MIHBodyState extends State<MIHBody> {
//double paddingSize = 10; //double paddingSize = 10;
double getPaddingSize() { double getHorizontalPaddingSize(Size screenSize) {
if (MzanziInnovationHub.of(context)!.theme.screenType == "desktop") {
if (widget.borderOn) {
return 10;
} else {
return 0;
}
} else {
// mobile
if (widget.borderOn) {
return 10;
} else {
return 0;
}
}
}
double getVerticalPaddingSize(Size screenSize) {
// mobile
if (widget.borderOn) { if (widget.borderOn) {
return 10; return 10;
} else { } else {
@@ -54,9 +72,9 @@ class _MIHBodyState extends State<MIHBody> {
Size screenSize = MediaQuery.sizeOf(context); Size screenSize = MediaQuery.sizeOf(context);
return Padding( return Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: getPaddingSize(), left: getHorizontalPaddingSize(screenSize),
right: getPaddingSize(), right: getHorizontalPaddingSize(screenSize),
bottom: getPaddingSize(), bottom: getVerticalPaddingSize(screenSize),
top: 0, top: 0,
), ),
child: Container( child: Container(
@@ -64,7 +82,7 @@ class _MIHBodyState extends State<MIHBody> {
left: 10, left: 10,
right: 10, right: 10,
bottom: 10, bottom: 10,
top: getPaddingSize(), top: getVerticalPaddingSize(screenSize),
), ),
width: screenSize.width, width: screenSize.width,
height: screenSize.height, height: screenSize.height,

View File

@@ -40,7 +40,8 @@ class _MIHLayoutBuilderState extends State<MIHLayoutBuilder> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
Size screenSize = MediaQuery.sizeOf(context); Size screenSize = MediaQuery.sizeOf(context);
return Scaffold( return Scaffold(
body: SizedBox( body: SafeArea(
child: SizedBox(
width: screenSize.width, width: screenSize.width,
height: screenSize.height, height: screenSize.height,
child: Stack( child: Stack(
@@ -55,6 +56,7 @@ class _MIHLayoutBuilderState extends State<MIHLayoutBuilder> {
], ],
), ),
), ),
),
); );
} }
} }

View File

@@ -155,7 +155,7 @@ class _BuildEmployeeListState extends State<BuildEmployeeList> {
MzanziInnovationHub.of(context)!.theme.secondaryColor(), MzanziInnovationHub.of(context)!.theme.secondaryColor(),
width: 5.0), width: 5.0),
), ),
child: Padding( child: SingleChildScrollView(
padding: const EdgeInsets.symmetric(horizontal: 10), padding: const EdgeInsets.symmetric(horizontal: 10),
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,

View File

@@ -130,7 +130,7 @@ class _BuildUserListState extends State<BuildUserList> {
MzanziInnovationHub.of(context)!.theme.secondaryColor(), MzanziInnovationHub.of(context)!.theme.secondaryColor(),
width: 5.0), width: 5.0),
), ),
child: Padding( child: SingleChildScrollView(
padding: const EdgeInsets.symmetric(horizontal: 10), padding: const EdgeInsets.symmetric(horizontal: 10),
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,

View File

@@ -144,7 +144,7 @@ class _BuildPatientsListState extends State<BuildPatientsList> {
MzanziInnovationHub.of(context)!.theme.secondaryColor(), MzanziInnovationHub.of(context)!.theme.secondaryColor(),
width: 5.0), width: 5.0),
), ),
child: Padding( child: SingleChildScrollView(
padding: const EdgeInsets.symmetric(horizontal: 10), padding: const EdgeInsets.symmetric(horizontal: 10),
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,

View File

@@ -263,6 +263,8 @@ class _PatientFilesState extends State<PatientFiles> {
MzanziInnovationHub.of(context)!.theme.secondaryColor(), MzanziInnovationHub.of(context)!.theme.secondaryColor(),
width: 5.0), width: 5.0),
), ),
child: SingleChildScrollView(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
@@ -292,8 +294,9 @@ class _PatientFilesState extends State<PatientFiles> {
buttonColor: MzanziInnovationHub.of(context)! buttonColor: MzanziInnovationHub.of(context)!
.theme .theme
.secondaryColor(), .secondaryColor(),
textColor: textColor: MzanziInnovationHub.of(context)!
MzanziInnovationHub.of(context)!.theme.primaryColor(), .theme
.primaryColor(),
onTap: () async { onTap: () async {
if (isMedCertFieldsFilled()) { if (isMedCertFieldsFilled()) {
await generateMedCert(); await generateMedCert();
@@ -313,6 +316,7 @@ class _PatientFilesState extends State<PatientFiles> {
], ],
), ),
), ),
),
Positioned( Positioned(
top: 5, top: 5,
right: 5, right: 5,
@@ -354,6 +358,8 @@ class _PatientFilesState extends State<PatientFiles> {
MzanziInnovationHub.of(context)!.theme.secondaryColor(), MzanziInnovationHub.of(context)!.theme.secondaryColor(),
width: 5.0), width: 5.0),
), ),
child: SingleChildScrollView(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@@ -370,7 +376,7 @@ class _PatientFilesState extends State<PatientFiles> {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
), ),
const SizedBox(height: 25.0), //const SizedBox(height: 25.0),
PrescripInput( PrescripInput(
medicineController: medicineController, medicineController: medicineController,
quantityController: quantityController, quantityController: quantityController,
@@ -387,6 +393,7 @@ class _PatientFilesState extends State<PatientFiles> {
], ],
), ),
), ),
),
Positioned( Positioned(
top: 5, top: 5,
right: 5, right: 5,

View File

@@ -158,8 +158,10 @@ class _PatientNotesState extends State<PatientNotes> {
MzanziInnovationHub.of(context)!.theme.secondaryColor(), MzanziInnovationHub.of(context)!.theme.secondaryColor(),
width: 5.0), width: 5.0),
), ),
child: SingleChildScrollView(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Column( child: Column(
//mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.min,
children: [ children: [
Text( Text(
"Add Note", "Add Note",
@@ -213,7 +215,9 @@ class _PatientNotesState extends State<PatientNotes> {
), ),
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
Expanded( SizedBox(
width: 700,
height: 250,
child: MIHMLTextField( child: MIHMLTextField(
controller: noteTextController, controller: noteTextController,
hintText: "Note Details", hintText: "Note Details",
@@ -244,13 +248,15 @@ class _PatientNotesState extends State<PatientNotes> {
buttonColor: MzanziInnovationHub.of(context)! buttonColor: MzanziInnovationHub.of(context)!
.theme .theme
.secondaryColor(), .secondaryColor(),
textColor: textColor: MzanziInnovationHub.of(context)!
MzanziInnovationHub.of(context)!.theme.primaryColor(), .theme
.primaryColor(),
), ),
) )
], ],
), ),
), ),
),
Positioned( Positioned(
top: 5, top: 5,
right: 5, right: 5,

View File

@@ -344,6 +344,8 @@ class _PrescripInputState extends State<PrescripInput> {
Widget displayMedInput() { Widget displayMedInput() {
return Column( return Column(
children: [ children: [
const SizedBox(height: 25.0),
KeyboardListener( KeyboardListener(
focusNode: _focusNode, focusNode: _focusNode,
autofocus: true, autofocus: true,