pop up design alignment

This commit is contained in:
2024-07-03 15:58:16 +02:00
parent 8f0134a98f
commit b25583ddf3
4 changed files with 415 additions and 264 deletions

View File

@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:patient_manager/components/myDropdownInput.dart';
import 'package:patient_manager/components/myErrorMessage.dart';
import 'package:patient_manager/components/myTextInput.dart';
import 'package:patient_manager/components/mybutton.dart';
import 'package:patient_manager/objects/appUser.dart';
@@ -21,6 +22,16 @@ class _ProfileUserUpdateState extends State<ProfileUserUpdate> {
final lnameController = TextEditingController();
final titleController = TextEditingController();
bool isFieldsFilled() {
if (fnameController.text.isEmpty ||
lnameController.text.isEmpty ||
titleController.text.isEmpty) {
return false;
} else {
return true;
}
}
@override
void initState() {
fnameController.text = widget.signedInUser.fname;
@@ -70,24 +81,12 @@ class _ProfileUserUpdateState extends State<ProfileUserUpdate> {
height: 100.0,
child: MyButton(
onTap: () {
if (fnameController.text == "") {
showDialog<void>(
if (isFieldsFilled()) {
} else {
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: const Text('Incomplete Field\\s'),
content: const Text(
'Please conplete all fields',
),
actions: <Widget>[
TextButton(
child: const Text('Disable'),
onPressed: () {
Navigator.of(context).pop();
},
),
],
);
builder: (context) {
return const MyErrorMessage(errorType: "Input Error");
},
);
}