Fix pop up windows with input. make more dynamic
This commit is contained in:
@@ -28,7 +28,7 @@ class _MedcertinputState extends State<Medcertinput> {
|
||||
//height: 325,
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(height: 50.0),
|
||||
//const SizedBox(height: 50.0),
|
||||
SizedBox(
|
||||
width: 700,
|
||||
child: MIHDateField(
|
||||
|
||||
@@ -80,55 +80,61 @@ class _MedicineSearchState extends State<MedicineSearch> {
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
width: 5.0),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
"Select Medicine",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
fontSize: 35.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
child: SingleChildScrollView(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
"Select Medicine",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: MzanziInnovationHub.of(context)!
|
||||
.theme
|
||||
.secondaryColor(),
|
||||
fontSize: 35.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 25.0),
|
||||
FutureBuilder(
|
||||
future: futueMeds,
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||
return const SizedBox(
|
||||
height: 400,
|
||||
child: Mihloadingcircle(),
|
||||
);
|
||||
} else if (snapshot.hasData && snapshot.data!.isNotEmpty) {
|
||||
final medsList = snapshot.data!;
|
||||
return SizedBox(
|
||||
height: 400,
|
||||
child: BuildMedicinesList(
|
||||
contoller: widget.searchVlaue,
|
||||
medicines: medsList,
|
||||
//searchString: searchString,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return const SizedBox(
|
||||
height: 400,
|
||||
child: Center(
|
||||
child: Text(
|
||||
"No Match Found\nPlease close and manually capture medicine",
|
||||
style: TextStyle(fontSize: 25, color: Colors.grey),
|
||||
textAlign: TextAlign.center,
|
||||
const SizedBox(height: 25.0),
|
||||
FutureBuilder(
|
||||
future: futueMeds,
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||
return const SizedBox(
|
||||
height: 400,
|
||||
child: Mihloadingcircle(),
|
||||
);
|
||||
} else if (snapshot.hasData &&
|
||||
snapshot.data!.isNotEmpty) {
|
||||
final medsList = snapshot.data!;
|
||||
return SizedBox(
|
||||
height: 400,
|
||||
child: BuildMedicinesList(
|
||||
contoller: widget.searchVlaue,
|
||||
medicines: medsList,
|
||||
//searchString: searchString,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
} else {
|
||||
return const SizedBox(
|
||||
height: 400,
|
||||
child: Center(
|
||||
child: Text(
|
||||
"No Match Found\nPlease close and manually capture medicine",
|
||||
style:
|
||||
TextStyle(fontSize: 25, color: Colors.grey),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
|
||||
@@ -17,7 +17,25 @@ class MIHBody extends StatefulWidget {
|
||||
class _MIHBodyState extends State<MIHBody> {
|
||||
//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) {
|
||||
return 10;
|
||||
} else {
|
||||
@@ -54,9 +72,9 @@ class _MIHBodyState extends State<MIHBody> {
|
||||
Size screenSize = MediaQuery.sizeOf(context);
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(
|
||||
left: getPaddingSize(),
|
||||
right: getPaddingSize(),
|
||||
bottom: getPaddingSize(),
|
||||
left: getHorizontalPaddingSize(screenSize),
|
||||
right: getHorizontalPaddingSize(screenSize),
|
||||
bottom: getVerticalPaddingSize(screenSize),
|
||||
top: 0,
|
||||
),
|
||||
child: Container(
|
||||
@@ -64,7 +82,7 @@ class _MIHBodyState extends State<MIHBody> {
|
||||
left: 10,
|
||||
right: 10,
|
||||
bottom: 10,
|
||||
top: getPaddingSize(),
|
||||
top: getVerticalPaddingSize(screenSize),
|
||||
),
|
||||
width: screenSize.width,
|
||||
height: screenSize.height,
|
||||
|
||||
@@ -40,19 +40,21 @@ class _MIHLayoutBuilderState extends State<MIHLayoutBuilder> {
|
||||
Widget build(BuildContext context) {
|
||||
Size screenSize = MediaQuery.sizeOf(context);
|
||||
return Scaffold(
|
||||
body: SizedBox(
|
||||
width: screenSize.width,
|
||||
height: screenSize.height,
|
||||
child: Stack(
|
||||
children: [
|
||||
widget.actionButton,
|
||||
Column(
|
||||
children: [
|
||||
widget.header,
|
||||
Expanded(child: widget.body),
|
||||
],
|
||||
),
|
||||
],
|
||||
body: SafeArea(
|
||||
child: SizedBox(
|
||||
width: screenSize.width,
|
||||
height: screenSize.height,
|
||||
child: Stack(
|
||||
children: [
|
||||
widget.actionButton,
|
||||
Column(
|
||||
children: [
|
||||
widget.header,
|
||||
Expanded(child: widget.body),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user