UX update to add thene class and apply the theme to entire app

This commit is contained in:
2024-07-09 16:51:00 +02:00
parent 8cb311e285
commit 162e37f740
38 changed files with 823 additions and 501 deletions

View File

@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:patient_manager/theme/mihTheme.dart';
class MyTextField extends StatefulWidget {
final controller;
@@ -55,20 +56,20 @@ class _MyTextFieldState extends State<MyTextField> {
return Row(
mainAxisSize: MainAxisSize.min,
children: [
const Text(
Text(
"*",
style: TextStyle(color: Colors.red),
style: TextStyle(color: MyTheme().errorColor()),
),
const SizedBox(
width: 8.0,
),
Text(widget.hintText,
style: const TextStyle(color: Colors.blueAccent)),
style: TextStyle(color: MyTheme().secondaryColor())),
],
);
} else {
return Text(widget.hintText,
style: const TextStyle(color: Colors.blueAccent));
style: TextStyle(color: MyTheme().secondaryColor()));
}
}
@@ -83,6 +84,7 @@ class _MyTextFieldState extends State<MyTextField> {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 25.0),
child: TextField(
style: TextStyle(color: MyTheme().secondaryColor()),
controller: widget.controller,
focusNode: _focus,
readOnly: makeEditable(),
@@ -92,20 +94,35 @@ class _MyTextFieldState extends State<MyTextField> {
}),
decoration: InputDecoration(
label: setRequiredText(),
//labelStyle: const TextStyle(color: Colors.blueAccent),
fillColor: Colors.white,
//labelStyle: TextStyle(color: MyTheme().primaryColor()),
fillColor: MyTheme().primaryColor(),
filled: true,
errorText: _errorText,
errorStyle: TextStyle(
color: MyTheme().errorColor(), fontWeight: FontWeight.bold),
//errorBorder: const InputBorder(),
//hintText: hintText,
//hintStyle: TextStyle(color: Colors.blueGrey[400]),
enabledBorder: const OutlineInputBorder(
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Colors.blueAccent,
color: MyTheme().secondaryColor(),
width: 2.0,
),
),
focusedBorder: const OutlineInputBorder(
borderSide: BorderSide(color: Colors.blue),
focusedErrorBorder: OutlineInputBorder(
borderSide: BorderSide(
color: MyTheme().errorColor(),
width: 2.0,
),
),
errorBorder: OutlineInputBorder(
borderSide: BorderSide(
color: MyTheme().errorColor(),
width: 2.0,
),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: MyTheme().secondaryColor()),
),
),
),