Merge pull request #124 from yaso-meth/Bug--Patient-profile-set-up-reload
fix reload on field press
This commit is contained in:
@@ -26,6 +26,7 @@ class _AddOrViewPatientState extends State<AddOrViewPatient> {
|
||||
late double width;
|
||||
late double height;
|
||||
late Widget loading;
|
||||
late Future<Patient?> patient;
|
||||
|
||||
Future<Patient?> fetchPatient() async {
|
||||
//print("Patien manager page: $endpoint");
|
||||
@@ -55,15 +56,23 @@ class _AddOrViewPatientState extends State<AddOrViewPatient> {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
super.initState();
|
||||
patient = fetchPatient();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
print("AddOrViewPatient");
|
||||
var size = MediaQuery.of(context).size;
|
||||
setState(() {
|
||||
width = size.width;
|
||||
height = size.height;
|
||||
});
|
||||
return FutureBuilder(
|
||||
future: fetchPatient(),
|
||||
future: patient,
|
||||
builder: (ctx, snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.done &&
|
||||
snapshot.hasData) {
|
||||
|
||||
@@ -8,6 +8,7 @@ import 'package:Mzansi_Innovation_Hub/mih_components/mih_layout/mih_action.dart'
|
||||
import 'package:Mzansi_Innovation_Hub/mih_components/mih_layout/mih_body.dart';
|
||||
import 'package:Mzansi_Innovation_Hub/mih_components/mih_layout/mih_header.dart';
|
||||
import 'package:Mzansi_Innovation_Hub/mih_components/mih_layout/mih_layout_builder.dart';
|
||||
import 'package:Mzansi_Innovation_Hub/mih_components/mih_layout/mih_single_child_scroll.dart';
|
||||
import 'package:Mzansi_Innovation_Hub/mih_components/mih_pop_up_messages/mih_error_message.dart';
|
||||
import 'package:Mzansi_Innovation_Hub/mih_components/mih_pop_up_messages/mih_success_message.dart';
|
||||
import 'package:Mzansi_Innovation_Hub/mih_env/env.dart';
|
||||
@@ -158,7 +159,8 @@ class _AddPatientState extends State<AddPatient> {
|
||||
}
|
||||
|
||||
Widget displayForm() {
|
||||
return Column(
|
||||
return MihSingleChildScroll(
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
"Personal Details",
|
||||
@@ -169,7 +171,8 @@ class _AddPatientState extends State<AddPatient> {
|
||||
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
),
|
||||
),
|
||||
Divider(color: MzanziInnovationHub.of(context)!.theme.secondaryColor()),
|
||||
Divider(
|
||||
color: MzanziInnovationHub.of(context)!.theme.secondaryColor()),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHTextField(
|
||||
controller: idController,
|
||||
@@ -222,7 +225,8 @@ class _AddPatientState extends State<AddPatient> {
|
||||
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
),
|
||||
),
|
||||
Divider(color: MzanziInnovationHub.of(context)!.theme.secondaryColor()),
|
||||
Divider(
|
||||
color: MzanziInnovationHub.of(context)!.theme.secondaryColor()),
|
||||
const SizedBox(height: 10.0),
|
||||
MIHDropdownField(
|
||||
controller: medAidController,
|
||||
@@ -299,6 +303,7 @@ class _AddPatientState extends State<AddPatient> {
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -393,6 +398,7 @@ class _AddPatientState extends State<AddPatient> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
print("Add Patient");
|
||||
return MIHLayoutBuilder(
|
||||
actionButton: getActionButton(),
|
||||
header: getHeader(),
|
||||
|
||||
Reference in New Issue
Block a user