Update UI of screens
This commit is contained in:
@@ -1,50 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
class PatientDetailItem extends StatefulWidget {
|
|
||||||
final String category;
|
|
||||||
final String value;
|
|
||||||
const PatientDetailItem({
|
|
||||||
super.key,
|
|
||||||
required this.category,
|
|
||||||
required this.value,
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<PatientDetailItem> createState() => _PatientDetailItemState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _PatientDetailItemState extends State<PatientDetailItem> {
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Expanded(
|
|
||||||
flex: 1,
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
"${widget.category}:",
|
|
||||||
style: const TextStyle(fontWeight: FontWeight.bold, fontSize: 20),
|
|
||||||
),
|
|
||||||
const SizedBox(width: 10),
|
|
||||||
Expanded(
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.only(right: 10.0),
|
|
||||||
child: Container(
|
|
||||||
//width: MediaQuery.of(context).size.width * 0.5,
|
|
||||||
padding: const EdgeInsets.only(left: 10.0, right: 10.0),
|
|
||||||
decoration: const BoxDecoration(
|
|
||||||
color: Colors.white,
|
|
||||||
borderRadius: BorderRadius.all(Radius.circular(5.0))),
|
|
||||||
child: Text(
|
|
||||||
widget.value,
|
|
||||||
style: const TextStyle(
|
|
||||||
fontSize: 20,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:patient_manager/components/patientDetailItem.dart';
|
import 'package:patient_manager/components/myTextInput.dart';
|
||||||
import 'package:patient_manager/objects/patients.dart';
|
import 'package:patient_manager/objects/patients.dart';
|
||||||
|
|
||||||
class PatientDetails extends StatefulWidget {
|
class PatientDetails extends StatefulWidget {
|
||||||
@@ -11,119 +11,190 @@ class PatientDetails extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _PatientDetailsState extends State<PatientDetails> {
|
class _PatientDetailsState extends State<PatientDetails> {
|
||||||
|
final idController = TextEditingController();
|
||||||
|
final fnameController = TextEditingController();
|
||||||
|
final lnameController = TextEditingController();
|
||||||
|
final cellController = TextEditingController();
|
||||||
|
final emailController = TextEditingController();
|
||||||
|
final medNoController = TextEditingController();
|
||||||
|
final medNameController = TextEditingController();
|
||||||
|
final medSchemeController = TextEditingController();
|
||||||
|
final addressController = TextEditingController();
|
||||||
double? headingFontSize = 35.0;
|
double? headingFontSize = 35.0;
|
||||||
double? bodyFonstSize = 20.0;
|
double? bodyFonstSize = 20.0;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
setState(() {
|
||||||
|
idController.value = TextEditingValue(text: widget.selectedPatient.id_no);
|
||||||
|
fnameController.value =
|
||||||
|
TextEditingValue(text: widget.selectedPatient.first_name);
|
||||||
|
lnameController.value =
|
||||||
|
TextEditingValue(text: widget.selectedPatient.last_name);
|
||||||
|
cellController.value =
|
||||||
|
TextEditingValue(text: widget.selectedPatient.cell_no);
|
||||||
|
emailController.value =
|
||||||
|
TextEditingValue(text: widget.selectedPatient.email);
|
||||||
|
medNameController.value =
|
||||||
|
TextEditingValue(text: widget.selectedPatient.medical_aid_name);
|
||||||
|
medNoController.value =
|
||||||
|
TextEditingValue(text: widget.selectedPatient.medical_aid_no);
|
||||||
|
medSchemeController.value =
|
||||||
|
TextEditingValue(text: widget.selectedPatient.medical_aid_scheme);
|
||||||
|
addressController.value =
|
||||||
|
TextEditingValue(text: widget.selectedPatient.address);
|
||||||
|
});
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Card(
|
return Container(
|
||||||
elevation: 20,
|
padding: const EdgeInsets.all(20),
|
||||||
child: Container(
|
decoration: BoxDecoration(
|
||||||
padding: const EdgeInsets.all(20),
|
color: Colors.white,
|
||||||
decoration: const BoxDecoration(
|
borderRadius: BorderRadius.circular(25.0),
|
||||||
color: Color.fromARGB(255, 219, 218, 218),
|
border: Border.all(color: Colors.blueAccent, width: 3.0),
|
||||||
borderRadius: BorderRadius.all(
|
),
|
||||||
Radius.circular(10),
|
//constraints: const BoxConstraints.expand(height: 250.0),
|
||||||
),
|
child: SelectionArea(
|
||||||
),
|
child: Column(
|
||||||
//constraints: const BoxConstraints.expand(height: 250.0),
|
children: [
|
||||||
child: SelectionArea(
|
Row(
|
||||||
child: Column(
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
const Text(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
"Patient Details",
|
||||||
children: [
|
textAlign: TextAlign.center,
|
||||||
const Text(
|
style: TextStyle(
|
||||||
"Patient Details",
|
fontSize: 35,
|
||||||
textAlign: TextAlign.center,
|
fontWeight: FontWeight.bold,
|
||||||
style: TextStyle(
|
color: Colors.blueAccent,
|
||||||
fontSize: 35,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
IconButton(
|
|
||||||
icon: const Icon(Icons.edit),
|
|
||||||
alignment: Alignment.topRight,
|
|
||||||
onPressed: () {
|
|
||||||
Navigator.of(context).pushNamed(
|
|
||||||
'/patient-manager/patient/edit',
|
|
||||||
arguments: widget.selectedPatient);
|
|
||||||
},
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
const Divider(),
|
|
||||||
const SizedBox(height: 10),
|
|
||||||
Column(
|
|
||||||
children: [
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
PatientDetailItem(
|
|
||||||
category: "ID No. ",
|
|
||||||
value: widget.selectedPatient.id_no,
|
|
||||||
),
|
|
||||||
PatientDetailItem(
|
|
||||||
category: "Name ",
|
|
||||||
value: widget.selectedPatient.first_name,
|
|
||||||
),
|
|
||||||
PatientDetailItem(
|
|
||||||
category: "Surname ",
|
|
||||||
value: widget.selectedPatient.last_name,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
const SizedBox(height: 5),
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
PatientDetailItem(
|
|
||||||
category: "Cell No ",
|
|
||||||
value: widget.selectedPatient.cell_no,
|
|
||||||
),
|
|
||||||
PatientDetailItem(
|
|
||||||
category: "Email ",
|
|
||||||
value: widget.selectedPatient.email,
|
|
||||||
),
|
|
||||||
PatientDetailItem(
|
|
||||||
category: "Address ",
|
|
||||||
value: widget.selectedPatient.address,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10),
|
|
||||||
const Text(
|
|
||||||
"Medical Aid Details",
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 25,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
),
|
||||||
|
IconButton(
|
||||||
|
icon: const Icon(Icons.edit),
|
||||||
|
alignment: Alignment.topRight,
|
||||||
|
color: Colors.blueAccent,
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context).pushNamed(
|
||||||
|
'/patient-manager/patient/edit',
|
||||||
|
arguments: widget.selectedPatient);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const Divider(color: Colors.blueAccent),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: MyTextField(
|
||||||
|
controller: idController,
|
||||||
|
hintText: "ID No.",
|
||||||
|
editable: false,
|
||||||
|
required: false),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: MyTextField(
|
||||||
|
controller: fnameController,
|
||||||
|
hintText: "Name",
|
||||||
|
editable: false,
|
||||||
|
required: false),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: MyTextField(
|
||||||
|
controller: lnameController,
|
||||||
|
hintText: "Surname",
|
||||||
|
editable: false,
|
||||||
|
required: false),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: MyTextField(
|
||||||
|
controller: cellController,
|
||||||
|
hintText: "Cell No.",
|
||||||
|
editable: false,
|
||||||
|
required: false),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: MyTextField(
|
||||||
|
controller: emailController,
|
||||||
|
hintText: "Email",
|
||||||
|
editable: false,
|
||||||
|
required: false),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: MyTextField(
|
||||||
|
controller: addressController,
|
||||||
|
hintText: "Address",
|
||||||
|
editable: false,
|
||||||
|
required: false),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
const Text(
|
||||||
|
"Medical Aid Details",
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 25,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: Colors.blueAccent,
|
||||||
),
|
),
|
||||||
const Divider(),
|
),
|
||||||
const SizedBox(height: 10),
|
const Divider(color: Colors.blueAccent),
|
||||||
Column(
|
const SizedBox(height: 10),
|
||||||
children: [
|
Column(
|
||||||
Row(
|
children: [
|
||||||
children: [
|
Row(
|
||||||
PatientDetailItem(
|
children: [
|
||||||
category: "No. ",
|
Expanded(
|
||||||
value: widget.selectedPatient.medical_aid_no,
|
child: MyTextField(
|
||||||
),
|
controller: medNoController,
|
||||||
PatientDetailItem(
|
hintText: "No.",
|
||||||
category: "Name ",
|
editable: false,
|
||||||
value: widget.selectedPatient.medical_aid_name,
|
required: false),
|
||||||
),
|
),
|
||||||
PatientDetailItem(
|
Expanded(
|
||||||
category: "Scheme ",
|
child: MyTextField(
|
||||||
value: widget.selectedPatient.medical_aid_scheme,
|
controller: medNameController,
|
||||||
),
|
hintText: "Name",
|
||||||
],
|
editable: false,
|
||||||
),
|
required: false),
|
||||||
],
|
),
|
||||||
)
|
Expanded(
|
||||||
],
|
child: MyTextField(
|
||||||
),
|
controller: medSchemeController,
|
||||||
|
hintText: "Scheme",
|
||||||
|
editable: false,
|
||||||
|
required: false),
|
||||||
|
),
|
||||||
|
// PatientDetailItem(
|
||||||
|
// category: "No. ",
|
||||||
|
// value: widget.selectedPatient.medical_aid_no,
|
||||||
|
// ),
|
||||||
|
// PatientDetailItem(
|
||||||
|
// category: "Name ",
|
||||||
|
// value: widget.selectedPatient.medical_aid_name,
|
||||||
|
// ),
|
||||||
|
// PatientDetailItem(
|
||||||
|
// category: "Scheme ",
|
||||||
|
// value: widget.selectedPatient.medical_aid_scheme,
|
||||||
|
// ),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -536,58 +536,64 @@ class _PatientFilesState extends State<PatientFiles> {
|
|||||||
flex: 1,
|
flex: 1,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(10.0),
|
padding: const EdgeInsets.all(10.0),
|
||||||
child: Card(
|
child: Container(
|
||||||
elevation: 20.0,
|
//height: 300.0,
|
||||||
child: Container(
|
decoration: BoxDecoration(
|
||||||
//height: 300.0,
|
color: Colors.white,
|
||||||
decoration: const BoxDecoration(
|
borderRadius: BorderRadius.circular(25.0),
|
||||||
color: Color.fromARGB(255, 219, 218, 218),
|
border: Border.all(color: Colors.blueAccent, width: 3.0),
|
||||||
borderRadius: BorderRadius.all(
|
),
|
||||||
Radius.circular(10),
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.only(top: 5.0),
|
||||||
|
child: Column(children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
const Text(
|
||||||
|
"Files",
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 35,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: Colors.blueAccent,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
medCertPopUp();
|
||||||
|
},
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.sick_outlined,
|
||||||
|
color: Colors.blueAccent,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
prescritionPopUp();
|
||||||
|
},
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.medication_outlined,
|
||||||
|
color: Colors.blueAccent,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
uploudFilePopUp();
|
||||||
|
},
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.add,
|
||||||
|
color: Colors.blueAccent,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
const Padding(
|
||||||
child: Padding(
|
padding: EdgeInsets.symmetric(horizontal: 20.0),
|
||||||
padding: const EdgeInsets.only(top: 5.0),
|
child: Divider(),
|
||||||
child: Column(children: [
|
),
|
||||||
Row(
|
const SizedBox(height: 10),
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
BuildFilesList(files: filesList),
|
||||||
children: [
|
]),
|
||||||
const Text(
|
|
||||||
"Files",
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 35,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
IconButton(
|
|
||||||
onPressed: () {
|
|
||||||
medCertPopUp();
|
|
||||||
},
|
|
||||||
icon: const Icon(Icons.sick_outlined),
|
|
||||||
),
|
|
||||||
IconButton(
|
|
||||||
onPressed: () {
|
|
||||||
prescritionPopUp();
|
|
||||||
},
|
|
||||||
icon: const Icon(Icons.medication_outlined),
|
|
||||||
),
|
|
||||||
IconButton(
|
|
||||||
onPressed: () {
|
|
||||||
uploudFilePopUp();
|
|
||||||
},
|
|
||||||
icon: const Icon(Icons.add),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
const Padding(
|
|
||||||
padding: EdgeInsets.symmetric(horizontal: 20.0),
|
|
||||||
child: Divider(),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10),
|
|
||||||
BuildFilesList(files: filesList),
|
|
||||||
]),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -221,46 +221,42 @@ class _PatientNotesState extends State<PatientNotes> {
|
|||||||
flex: 1,
|
flex: 1,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(10.0),
|
padding: const EdgeInsets.all(10.0),
|
||||||
child: Card(
|
child: Container(
|
||||||
elevation: 20.0,
|
//height: 300.0,
|
||||||
child: Container(
|
decoration: BoxDecoration(
|
||||||
//height: 300.0,
|
color: Colors.white,
|
||||||
decoration: const BoxDecoration(
|
borderRadius: BorderRadius.circular(25.0),
|
||||||
color: Color.fromARGB(255, 219, 218, 218),
|
border: Border.all(color: Colors.blueAccent, width: 3.0),
|
||||||
borderRadius: BorderRadius.all(
|
),
|
||||||
Radius.circular(10),
|
child: Padding(
|
||||||
),
|
padding: const EdgeInsets.only(top: 5.0),
|
||||||
),
|
child: Column(children: [
|
||||||
child: Padding(
|
Row(
|
||||||
padding: const EdgeInsets.only(top: 5.0),
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
child: Column(children: [
|
children: [
|
||||||
Row(
|
const Text(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
"Notes",
|
||||||
children: [
|
textAlign: TextAlign.center,
|
||||||
const Text(
|
style: TextStyle(
|
||||||
"Notes",
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 35,
|
fontSize: 35,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
color: Colors.blueAccent),
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
addNotePopUp();
|
addNotePopUp();
|
||||||
},
|
},
|
||||||
icon: const Icon(Icons.add),
|
icon: const Icon(Icons.add, color: Colors.blueAccent),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const Padding(
|
const Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 20.0),
|
padding: EdgeInsets.symmetric(horizontal: 20.0),
|
||||||
child: Divider(),
|
child: Divider(),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
BuildNotesList(notes: notesList),
|
BuildNotesList(notes: notesList),
|
||||||
]),
|
]),
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user