UI Update

This commit is contained in:
2024-07-05 19:13:45 +02:00
parent e09ca04e8a
commit d188dd205f
5 changed files with 166 additions and 164 deletions

View File

@@ -90,27 +90,40 @@ class _BuildFilesListState extends State<BuildFilesList> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SizedBox( if (widget.files.isNotEmpty) {
height: 290.0, return SizedBox(
child: ListView.separated( height: 290.0,
shrinkWrap: true, child: ListView.separated(
separatorBuilder: (BuildContext context, int index) { shrinkWrap: true,
return const Divider(); separatorBuilder: (BuildContext context, int index) {
}, return const Divider();
itemCount: widget.files.length, },
itemBuilder: (context, index) { itemCount: widget.files.length,
return ListTile( itemBuilder: (context, index) {
title: Text( return ListTile(
widget.files[index].file_name, title: Text(
), widget.files[index].file_name,
subtitle: Text(widget.files[index].insert_date), ),
trailing: const Icon(Icons.arrow_forward), subtitle: Text(widget.files[index].insert_date),
onTap: () { trailing: const Icon(Icons.arrow_forward),
viewFilePopUp(widget.files[index].file_name); onTap: () {
}, viewFilePopUp(widget.files[index].file_name);
); },
}, );
), },
); ),
);
} else {
return const SizedBox(
height: 290.0,
child: Center(
child: Text(
"No Files Available",
style: TextStyle(fontSize: 25, color: Colors.grey),
textAlign: TextAlign.center,
),
),
);
}
} }
} }

View File

@@ -97,50 +97,42 @@ class _BuildNotesListState extends State<BuildNotesList> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SizedBox( if (widget.notes.isNotEmpty) {
height: 290.0, return SizedBox(
child: ListView.separated( height: 290.0,
shrinkWrap: true, child: ListView.separated(
separatorBuilder: (BuildContext context, int index) { shrinkWrap: true,
return const Divider(); separatorBuilder: (BuildContext context, int index) {
}, return const Divider();
itemCount: widget.notes.length, },
itemBuilder: (context, index) { itemCount: widget.notes.length,
return ListTile( itemBuilder: (context, index) {
title: Text( return ListTile(
widget.notes[index].note_name, title: Text(
), widget.notes[index].note_name,
subtitle: Text( ),
"${widget.notes[index].insert_date}:\n${widget.notes[index].note_text}"), //Text(widget.notes[index].note_text), subtitle: Text(
trailing: const Icon(Icons.arrow_forward), "${widget.notes[index].insert_date}:\n${widget.notes[index].note_text}"), //Text(widget.notes[index].note_text),
onTap: () { trailing: const Icon(Icons.arrow_forward),
viewNotePopUp(widget.notes[index].note_name, onTap: () {
"${widget.notes[index].insert_date}:\n${widget.notes[index].note_text}"); viewNotePopUp(widget.notes[index].note_name,
// showDialog( "${widget.notes[index].insert_date}:\n${widget.notes[index].note_text}");
// context: context, },
// builder: (context) => AlertDialog( );
// title: Center(child: Text(widget.notes[index].note_name)), },
// content: SizedBox( ),
// width: 700, );
// height: 250, } else {
// child: Text( return const SizedBox(
// "${widget.notes[index].insert_date}:\n${widget.notes[index].note_text}", height: 290.0,
// style: TextStyle(fontSize: 16), child: Center(
// ), child: Text(
// ), "No Notes Available",
// actions: [ style: TextStyle(fontSize: 25, color: Colors.grey),
// TextButton( textAlign: TextAlign.center,
// onPressed: () { ),
// Navigator.pop(context); ),
// }, );
// child: const Text("Close")) }
// ],
// ),
// );
},
);
},
),
);
} }
} }

View File

@@ -534,67 +534,64 @@ class _PatientFilesState extends State<PatientFiles> {
final filesList = snapshot.data!; final filesList = snapshot.data!;
return Flexible( return Flexible(
flex: 1, flex: 1,
child: Padding( child: Container(
padding: const EdgeInsets.all(10.0), //height: 300.0,
child: Container( decoration: BoxDecoration(
//height: 300.0, color: Colors.white,
decoration: BoxDecoration( borderRadius: BorderRadius.circular(25.0),
color: Colors.white, border: Border.all(color: Colors.blueAccent, width: 3.0),
borderRadius: BorderRadius.circular(25.0), ),
border: Border.all(color: Colors.blueAccent, width: 3.0), child: Padding(
), padding: const EdgeInsets.only(top: 5.0),
child: Padding( child: Column(children: [
padding: const EdgeInsets.only(top: 5.0), Row(
child: Column(children: [ mainAxisAlignment: MainAxisAlignment.center,
Row( children: [
mainAxisAlignment: MainAxisAlignment.center, const Text(
children: [ "Files",
const Text( textAlign: TextAlign.center,
"Files", style: TextStyle(
textAlign: TextAlign.center, fontSize: 25,
style: TextStyle( fontWeight: FontWeight.bold,
fontSize: 25, color: Colors.blueAccent,
fontWeight: FontWeight.bold,
color: Colors.blueAccent,
),
), ),
IconButton( ),
onPressed: () { IconButton(
medCertPopUp(); onPressed: () {
}, medCertPopUp();
icon: const Icon( },
Icons.sick_outlined, icon: const Icon(
color: Colors.blueAccent, Icons.sick_outlined,
), color: Colors.blueAccent,
), ),
IconButton( ),
onPressed: () { IconButton(
prescritionPopUp(); onPressed: () {
}, prescritionPopUp();
icon: const Icon( },
Icons.medication_outlined, icon: const Icon(
color: Colors.blueAccent, Icons.medication_outlined,
), color: Colors.blueAccent,
), ),
IconButton( ),
onPressed: () { IconButton(
uploudFilePopUp(); onPressed: () {
}, uploudFilePopUp();
icon: const Icon( },
Icons.add, icon: const Icon(
color: Colors.blueAccent, Icons.add,
), color: Colors.blueAccent,
) ),
], )
), ],
const Padding( ),
padding: EdgeInsets.symmetric(horizontal: 20.0), const Padding(
child: Divider(color: Colors.blueAccent), padding: EdgeInsets.symmetric(horizontal: 20.0),
), child: Divider(color: Colors.blueAccent),
const SizedBox(height: 10), ),
BuildFilesList(files: filesList), const SizedBox(height: 10),
]), BuildFilesList(files: filesList),
), ]),
), ),
), ),
); );

View File

@@ -219,45 +219,42 @@ class _PatientNotesState extends State<PatientNotes> {
final notesList = snapshot.data!; final notesList = snapshot.data!;
return Flexible( return Flexible(
flex: 1, flex: 1,
child: Padding( child: Container(
padding: const EdgeInsets.all(10.0), //height: 300.0,
child: Container( decoration: BoxDecoration(
//height: 300.0, color: Colors.white,
decoration: BoxDecoration( borderRadius: BorderRadius.circular(25.0),
color: Colors.white, border: Border.all(color: Colors.blueAccent, width: 3.0),
borderRadius: BorderRadius.circular(25.0), ),
border: Border.all(color: Colors.blueAccent, width: 3.0), child: Padding(
), padding: const EdgeInsets.only(top: 5.0),
child: Padding( child: Column(children: [
padding: const EdgeInsets.only(top: 5.0), Row(
child: Column(children: [ mainAxisAlignment: MainAxisAlignment.center,
Row( children: [
mainAxisAlignment: MainAxisAlignment.center, const Text(
children: [ "Notes",
const Text( textAlign: TextAlign.center,
"Notes", style: TextStyle(
textAlign: TextAlign.center, fontSize: 25,
style: TextStyle( fontWeight: FontWeight.bold,
fontSize: 25, color: Colors.blueAccent),
fontWeight: FontWeight.bold, ),
color: Colors.blueAccent), IconButton(
), onPressed: () {
IconButton( addNotePopUp();
onPressed: () { },
addNotePopUp(); icon: const Icon(Icons.add, color: Colors.blueAccent),
}, )
icon: const Icon(Icons.add, color: Colors.blueAccent), ],
) ),
], const Padding(
), padding: EdgeInsets.symmetric(horizontal: 20.0),
const Padding( child: Divider(color: Colors.blueAccent),
padding: EdgeInsets.symmetric(horizontal: 20.0), ),
child: Divider(color: Colors.blueAccent), const SizedBox(height: 10),
), BuildNotesList(notes: notesList),
const SizedBox(height: 10), ]),
BuildNotesList(notes: notesList),
]),
),
), ),
), ),
); );

View File

@@ -32,6 +32,9 @@ class _PatientViewState extends State<PatientView> {
PatientNotes( PatientNotes(
patientIndex: widget.selectedPatient.idpatients, patientIndex: widget.selectedPatient.idpatients,
), ),
SizedBox(
width: 10,
),
PatientFiles( PatientFiles(
patientIndex: widget.selectedPatient.idpatients, patientIndex: widget.selectedPatient.idpatients,
selectedPatient: widget.selectedPatient, selectedPatient: widget.selectedPatient,