Med Search window enhancement
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:patient_manager/mih_components/mih_layout/mih_window.dart';
|
||||||
import 'package:patient_manager/mih_packages/patient_profile/builder/build_med_list.dart';
|
import 'package:patient_manager/mih_packages/patient_profile/builder/build_med_list.dart';
|
||||||
import 'package:patient_manager/mih_components/mih_pop_up_messages/mih_loading_circle.dart';
|
import 'package:patient_manager/mih_components/mih_pop_up_messages/mih_loading_circle.dart';
|
||||||
import 'package:patient_manager/mih_components/mih_pop_up_messages/mih_error_message.dart';
|
import 'package:patient_manager/mih_components/mih_pop_up_messages/mih_error_message.dart';
|
||||||
@@ -65,96 +66,138 @@ class _MedicineSearchState extends State<MedicineSearch> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Dialog(
|
return MIHWindow(
|
||||||
child: Stack(
|
fullscreen: false,
|
||||||
children: [
|
windowTitle: "Select Medicine",
|
||||||
Container(
|
windowTools: [],
|
||||||
padding: const EdgeInsets.all(10.0),
|
onWindowTapClose: () {
|
||||||
width: 700.0,
|
Navigator.pop(context);
|
||||||
//height: 475.0,
|
},
|
||||||
decoration: BoxDecoration(
|
windowBody: [
|
||||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
FutureBuilder(
|
||||||
borderRadius: BorderRadius.circular(25.0),
|
future: futueMeds,
|
||||||
border: Border.all(
|
builder: (context, snapshot) {
|
||||||
color:
|
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
return const SizedBox(
|
||||||
width: 5.0),
|
height: 400,
|
||||||
),
|
child: Mihloadingcircle(),
|
||||||
child: SingleChildScrollView(
|
);
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
} else if (snapshot.hasData && snapshot.data!.isNotEmpty) {
|
||||||
child: Column(
|
final medsList = snapshot.data!;
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
return SizedBox(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
height: 400,
|
||||||
mainAxisSize: MainAxisSize.min,
|
child: BuildMedicinesList(
|
||||||
children: [
|
contoller: widget.searchVlaue,
|
||||||
Text(
|
medicines: medsList,
|
||||||
"Select Medicine",
|
//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,
|
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,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Positioned(
|
|
||||||
top: 5,
|
|
||||||
right: 5,
|
|
||||||
width: 50,
|
|
||||||
height: 50,
|
|
||||||
child: IconButton(
|
|
||||||
onPressed: () {
|
|
||||||
Navigator.pop(context);
|
|
||||||
},
|
|
||||||
icon: const Icon(
|
|
||||||
Icons.close,
|
|
||||||
color: Colors.red,
|
|
||||||
size: 35,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
|
// return Dialog(
|
||||||
|
// child: Stack(
|
||||||
|
// children: [
|
||||||
|
// Container(
|
||||||
|
// padding: const EdgeInsets.all(10.0),
|
||||||
|
// width: 700.0,
|
||||||
|
// //height: 475.0,
|
||||||
|
// decoration: BoxDecoration(
|
||||||
|
// color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||||
|
// borderRadius: BorderRadius.circular(25.0),
|
||||||
|
// border: Border.all(
|
||||||
|
// color:
|
||||||
|
// MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
|
// width: 5.0),
|
||||||
|
// ),
|
||||||
|
// 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,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// Positioned(
|
||||||
|
// top: 5,
|
||||||
|
// right: 5,
|
||||||
|
// width: 50,
|
||||||
|
// height: 50,
|
||||||
|
// child: IconButton(
|
||||||
|
// onPressed: () {
|
||||||
|
// Navigator.pop(context);
|
||||||
|
// },
|
||||||
|
// icon: const Icon(
|
||||||
|
// Icons.close,
|
||||||
|
// color: Colors.red,
|
||||||
|
// size: 35,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ class _MIHLayoutBuilderState extends State<MIHLayoutBuilder> {
|
|||||||
if (widget.secondaryActionButton != null) {
|
if (widget.secondaryActionButton != null) {
|
||||||
temp.add(widget.secondaryActionButton!);
|
temp.add(widget.secondaryActionButton!);
|
||||||
} else {
|
} else {
|
||||||
print(widget.header.headerItems.length);
|
//print(widget.header.headerItems.length);
|
||||||
if (widget.header.headerItems.length == 1) {
|
if (widget.header.headerItems.length == 1) {
|
||||||
temp.add(const SizedBox(
|
temp.add(const SizedBox(
|
||||||
width: 50,
|
width: 50,
|
||||||
|
|||||||
Reference in New Issue
Block a user