add success message to add patient, edit patient,patient notes, patient files.

update note and file view to match UI.
restrict file types in file uploud.
add image viewer
This commit is contained in:
2024-07-04 13:34:55 +02:00
parent 0c40888907
commit 643f4cd39d
34 changed files with 377 additions and 112 deletions

View File

@@ -1,4 +1,6 @@
import 'package:flutter/material.dart';
import 'package:patient_manager/components/myMLTextInput.dart';
//import 'package:patient_manager/components/mybutton.dart';
import 'package:patient_manager/objects/notes.dart';
class BuildNotesList extends StatefulWidget {
@@ -12,9 +14,87 @@ class BuildNotesList extends StatefulWidget {
State<BuildNotesList> createState() => _BuildNotesListState();
}
int indexOn = 0;
class _BuildNotesListState extends State<BuildNotesList> {
final noteTextController = TextEditingController();
int indexOn = 0;
void viewNotePopUp(String title, String note) {
setState(() {
noteTextController.text = note;
});
showDialog(
context: context,
builder: (context) => Dialog(
child: Stack(
children: [
Container(
padding: const EdgeInsets.all(10.0),
width: 700.0,
//height: 475.0,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(25.0),
border: Border.all(color: Colors.blueAccent, width: 5.0),
),
child: Column(
//mainAxisSize: MainAxisSize.max,
children: [
Text(
title,
textAlign: TextAlign.center,
style: const TextStyle(
color: Colors.blueAccent,
fontSize: 35.0,
fontWeight: FontWeight.bold,
),
),
const SizedBox(height: 25.0),
Expanded(
child: MyMLTextField(
controller: noteTextController,
hintText: "Note Details",
editable: false,
required: false,
),
),
const SizedBox(height: 25.0),
// SizedBox(
// width: 300,
// height: 100,
// child: MyButton(
// onTap: () {
// Navigator.pop(context);
// },
// buttonText: "Close",
// buttonColor: Colors.blueAccent,
// textColor: Colors.white,
// ),
// )
],
),
),
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,
),
),
),
],
),
),
);
}
@override
Widget build(BuildContext context) {
return SizedBox(
@@ -34,27 +114,29 @@ class _BuildNotesListState extends State<BuildNotesList> {
"${widget.notes[index].insert_date}:\n${widget.notes[index].note_text}"), //Text(widget.notes[index].note_text),
trailing: const Icon(Icons.arrow_forward),
onTap: () {
showDialog(
context: context,
builder: (context) => AlertDialog(
title: Center(child: Text(widget.notes[index].note_name)),
content: SizedBox(
width: 700,
height: 250,
child: Text(
"${widget.notes[index].insert_date}:\n${widget.notes[index].note_text}",
style: TextStyle(fontSize: 16),
),
),
actions: [
TextButton(
onPressed: () {
Navigator.pop(context);
},
child: const Text("Close"))
],
),
);
viewNotePopUp(widget.notes[index].note_name,
"${widget.notes[index].insert_date}:\n${widget.notes[index].note_text}");
// showDialog(
// context: context,
// builder: (context) => AlertDialog(
// title: Center(child: Text(widget.notes[index].note_name)),
// content: SizedBox(
// width: 700,
// height: 250,
// child: Text(
// "${widget.notes[index].insert_date}:\n${widget.notes[index].note_text}",
// style: TextStyle(fontSize: 16),
// ),
// ),
// actions: [
// TextButton(
// onPressed: () {
// Navigator.pop(context);
// },
// child: const Text("Close"))
// ],
// ),
// );
},
);
},