Use MihColor Across MIH

This commit is contained in:
2025-08-14 15:26:26 +02:00
parent 726c6f5213
commit 96d913629a
119 changed files with 4018 additions and 2968 deletions

View File

@@ -88,11 +88,13 @@ class _SignInState extends State<SignIn> {
}
Color getPrim() {
return MzansiInnovationHub.of(context)!.theme.secondaryColor();
return MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark");
}
Color getSec() {
return MzansiInnovationHub.of(context)!.theme.primaryColor();
return MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark");
}
void setSandboxProfiles(List<MIHTile> tileList) {
@@ -212,7 +214,7 @@ class _SignInState extends State<SignIn> {
context: context,
builder: (context) {
return Dialog(
//backgroundColor: MzansiInnovationHub.of(context)!.theme.primaryColor(),
//backgroundColor: MihColors.getPrimaryColor(MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
child: Stack(
children: [
Container(
@@ -220,12 +222,13 @@ class _SignInState extends State<SignIn> {
width: 500.0,
height: 500,
decoration: BoxDecoration(
color: MzansiInnovationHub.of(context)!.theme.primaryColor(),
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
borderRadius: BorderRadius.circular(25.0),
border: Border.all(
color: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
width: 5.0),
),
child: Column(
@@ -235,9 +238,9 @@ class _SignInState extends State<SignIn> {
"Sandbox Profiles",
textAlign: TextAlign.center,
style: TextStyle(
color: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
fontSize: 25.0,
fontWeight: FontWeight.bold,
),
@@ -247,9 +250,9 @@ class _SignInState extends State<SignIn> {
"NB: These accounts are used for test purposes. Please do not store personal information on these profiles.",
textAlign: TextAlign.center,
style: TextStyle(
color: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
fontSize: 15.0,
fontWeight: FontWeight.bold,
),
@@ -282,7 +285,8 @@ class _SignInState extends State<SignIn> {
},
icon: Icon(
Icons.close,
color: MihColors.getRedColor(context),
color: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
size: 35,
),
),
@@ -304,12 +308,14 @@ class _SignInState extends State<SignIn> {
onPressed: () {
MihInstallServices().installMihTrigger(context);
},
buttonColor: MihColors.getGreenColor(context),
buttonColor: MihColors.getGreenColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
width: 150,
child: Text(
"Install MIH",
style: TextStyle(
color: MzansiInnovationHub.of(context)!.theme.primaryColor(),
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
),
@@ -336,7 +342,8 @@ class _SignInState extends State<SignIn> {
child: FittedBox(
child: Icon(
MihIcons.mihLogo,
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
),
),
),
@@ -400,9 +407,9 @@ class _SignInState extends State<SignIn> {
Icon(
Icons.lock,
size: 100,
color: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
),
//spacer
const SizedBox(height: 10),
@@ -412,9 +419,9 @@ class _SignInState extends State<SignIn> {
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
color: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
),
),
//spacer
@@ -423,12 +430,12 @@ class _SignInState extends State<SignIn> {
formKey: _formKey,
formFields: [
MihTextFormField(
fillColor: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
inputColor: MzansiInnovationHub.of(context)!
.theme
.primaryColor(),
fillColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
inputColor: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
controller: emailController,
multiLineInput: false,
requiredText: true,
@@ -443,12 +450,12 @@ class _SignInState extends State<SignIn> {
const SizedBox(height: 10),
//password input
MihTextFormField(
fillColor: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
inputColor: MzansiInnovationHub.of(context)!
.theme
.primaryColor(),
fillColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
inputColor: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
controller: passwordController,
multiLineInput: false,
requiredText: true,
@@ -477,9 +484,11 @@ class _SignInState extends State<SignIn> {
'Forgot Password?',
style: TextStyle(
fontSize: 15,
color: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!
.theme
.mode ==
"Dark"),
fontWeight: FontWeight.bold,
),
),
@@ -507,17 +516,20 @@ class _SignInState extends State<SignIn> {
.formNotFilledCompletely(context);
}
},
buttonColor:
buttonColor: MihColors.getGreenColor(
MzansiInnovationHub.of(context)!
.theme
.successColor(),
.theme
.mode ==
"Dark"),
width: 300,
child: Text(
"Sign In",
style: TextStyle(
color: MzansiInnovationHub.of(context)!
.theme
.primaryColor(),
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!
.theme
.mode ==
"Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
),
@@ -525,17 +537,20 @@ class _SignInState extends State<SignIn> {
),
MihButton(
onPressed: widget.onTap,
buttonColor:
buttonColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
.theme
.mode ==
"Dark"),
width: 300,
child: Text(
"Create New Account",
style: TextStyle(
color: MzansiInnovationHub.of(context)!
.theme
.primaryColor(),
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!
.theme
.mode ==
"Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
),
@@ -570,10 +585,13 @@ class _SignInState extends State<SignIn> {
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 15,
color: MzansiInnovationHub.of(
context)!
.theme
.secondaryColor()),
color:
MihColors.getSecondaryColor(
MzansiInnovationHub.of(
context)!
.theme
.mode ==
"Dark")),
),
onTap: () {
setState(() {
@@ -620,10 +638,11 @@ class _SignInState extends State<SignIn> {
"NB: These accounts are used for test purposes. Please do not store personal information on these profiles.",
textAlign: TextAlign.center,
style: TextStyle(
color:
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
.theme
.mode ==
"Dark"),
fontSize: 15.0,
fontWeight: FontWeight.bold,
),