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

@@ -132,24 +132,29 @@ class _BuildPatientsListState extends State<BuildAccessRequestList> {
if (access == "APPROVED") {
accessWithColour = TextSpan(
text: "$access\n",
style: TextStyle(color: MihColors.getGreenColor(context)));
style: TextStyle(
color: MihColors.getGreenColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark")));
} else if (access == "PENDING") {
accessWithColour = TextSpan(
text: "$access\n",
style: TextStyle(
color:
MzansiInnovationHub.of(context)!.theme.messageTextColor()));
color: MihColors.getGreyColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark")));
} else {
accessWithColour = TextSpan(
text: "$access\n",
style: TextStyle(color: MihColors.getRedColor(context)));
style: TextStyle(
color: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark")));
}
return ListTile(
title: Text(
line1,
style: TextStyle(
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
),
),
subtitle: RichText(
@@ -165,7 +170,7 @@ class _BuildPatientsListState extends State<BuildAccessRequestList> {
// Text(
// subtitle,
// style: TextStyle(
// color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
// color: MihColors.getSecondaryColor(MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
// ),
// ),
onTap: () {
@@ -177,7 +182,7 @@ class _BuildPatientsListState extends State<BuildAccessRequestList> {
},
// trailing: Icon(
// Icons.arrow_forward,
// color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
// color: MihColors.getSecondaryColor(MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
// ),
);
}
@@ -232,8 +237,8 @@ class _BuildPatientsListState extends State<BuildAccessRequestList> {
subtitle,
textAlign: TextAlign.left,
style: TextStyle(
color:
MzansiInnovationHub.of(context)!.theme.secondaryColor(),
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
fontSize: popUpBodySize,
//fontWeight: FontWeight.bold,
),
@@ -247,14 +252,15 @@ class _BuildPatientsListState extends State<BuildAccessRequestList> {
onPressed: () {
updateAccessAPICall(index, "declined");
},
buttonColor: MihColors.getRedColor(context),
buttonColor: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
width: 300,
child: Text(
"Decline",
style: TextStyle(
color: MzansiInnovationHub.of(context)!
.theme
.primaryColor(),
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
),
@@ -264,14 +270,15 @@ class _BuildPatientsListState extends State<BuildAccessRequestList> {
onPressed: () {
updateAccessAPICall(index, "approved");
},
buttonColor: MihColors.getGreenColor(context),
buttonColor: MihColors.getGreenColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
width: 300,
child: Text(
"Approve",
style: TextStyle(
color: MzansiInnovationHub.of(context)!
.theme
.primaryColor(),
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
),
@@ -308,7 +315,8 @@ class _BuildPatientsListState extends State<BuildAccessRequestList> {
physics: const NeverScrollableScrollPhysics(),
separatorBuilder: (BuildContext context, index) {
return Divider(
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
);
},
itemCount: widget.accessRequests.length,

View File

@@ -85,24 +85,29 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
if (access == "APPROVED") {
accessWithColour = TextSpan(
text: "$access\n",
style: TextStyle(color: MihColors.getGreenColor(context)));
style: TextStyle(
color: MihColors.getGreenColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark")));
} else if (access == "PENDING") {
accessWithColour = TextSpan(
text: "$access\n",
style: TextStyle(
color:
MzansiInnovationHub.of(context)!.theme.messageTextColor()));
color: MihColors.getGreyColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark")));
} else {
accessWithColour = TextSpan(
text: "$access\n",
style: TextStyle(color: MihColors.getRedColor(context)));
style: TextStyle(
color: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark")));
}
return ListTile(
title: Text(
line1,
style: TextStyle(
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
),
),
subtitle: RichText(
@@ -117,7 +122,7 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
// Text(
// subtitle,
// style: TextStyle(
// color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
// color: MihColors.getSecondaryColor(MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
// ),
// ),
onTap: () {
@@ -125,7 +130,7 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
},
// trailing: Icon(
// Icons.arrow_forward,
// color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
// color: MihColors.getSecondaryColor(MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
// ),
);
}
@@ -193,8 +198,8 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
subtitle,
textAlign: TextAlign.left,
style: TextStyle(
color:
MzansiInnovationHub.of(context)!.theme.secondaryColor(),
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
fontSize: popUpBodySize,
//fontWeight: FontWeight.bold,
),
@@ -211,14 +216,18 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
"Important Notice: Approving Profile Access",
style: TextStyle(
fontWeight: FontWeight.bold,
color: MihColors.getRedColor(context),
color: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
),
),
Text(
"You are about to accept access to your patient's profile. Please be aware of the following important points:",
style: TextStyle(
fontWeight: FontWeight.normal,
color: MihColors.getRedColor(context),
color: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
),
),
SizedBox(
@@ -227,9 +236,9 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
"1. Permanent Access: Once you accepts this access request, it will become permanent.",
style: TextStyle(
fontWeight: FontWeight.normal,
color: MzansiInnovationHub.of(context)!
.theme
.errorColor(),
color: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
),
),
),
@@ -239,9 +248,9 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
"2. Shared Information: Any updates make to youe patient profile will be visible to all who have access to the profile.",
style: TextStyle(
fontWeight: FontWeight.normal,
color: MzansiInnovationHub.of(context)!
.theme
.errorColor(),
color: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
),
),
),
@@ -251,9 +260,9 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
"3. Irreversible Access: Once granted, you cannot revoke access to your patient's profile.",
style: TextStyle(
fontWeight: FontWeight.normal,
color: MzansiInnovationHub.of(context)!
.theme
.errorColor(),
color: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
),
),
),
@@ -261,7 +270,9 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
"By pressing the \"Approve\" button you accept the above terms.",
style: TextStyle(
fontWeight: FontWeight.bold,
color: MihColors.getRedColor(context),
color: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
),
),
],
@@ -277,14 +288,18 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
"Important Notice: Approved Profile Access",
style: TextStyle(
fontWeight: FontWeight.bold,
color: MihColors.getRedColor(context),
color: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
),
),
Text(
"You have accepted access to your patient's profile. Please be aware of the following important points:",
style: TextStyle(
fontWeight: FontWeight.normal,
color: MihColors.getRedColor(context),
color: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
),
),
SizedBox(
@@ -293,9 +308,9 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
"1. Permanent Access: This access is permanent.",
style: TextStyle(
fontWeight: FontWeight.normal,
color: MzansiInnovationHub.of(context)!
.theme
.errorColor(),
color: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
),
),
),
@@ -305,9 +320,9 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
"2. Shared Information: Any updates make to youe patient profile will be visible to all who have access to the profile.",
style: TextStyle(
fontWeight: FontWeight.normal,
color: MzansiInnovationHub.of(context)!
.theme
.errorColor(),
color: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
),
),
),
@@ -317,9 +332,9 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
"3. Irreversible Access: You cannot revoke this access to your patient's profile.",
style: TextStyle(
fontWeight: FontWeight.normal,
color: MzansiInnovationHub.of(context)!
.theme
.errorColor(),
color: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
),
),
),
@@ -349,14 +364,16 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
context,
);
},
buttonColor: MihColors.getRedColor(context),
buttonColor: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
width: 300,
child: Text(
"Decline",
style: TextStyle(
color: MzansiInnovationHub.of(context)!
.theme
.primaryColor(),
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
),
@@ -375,14 +392,16 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
context,
);
},
buttonColor: MihColors.getGreenColor(context),
buttonColor: MihColors.getGreenColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
width: 300,
child: Text(
"Approve",
style: TextStyle(
color: MzansiInnovationHub.of(context)!
.theme
.primaryColor(),
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
),
@@ -420,7 +439,8 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
physics: const NeverScrollableScrollPhysics(),
separatorBuilder: (BuildContext context, index) {
return Divider(
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
);
},
itemCount: widget.patientAccessList.length,

View File

@@ -3,6 +3,7 @@ import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_objects/app_user.dart';
import 'package:flutter/material.dart';
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
class MihAccessTile extends StatefulWidget {
final AppUser signedInUser;
@@ -31,12 +32,15 @@ class _MihAccessTileState extends State<MihAccessTile> {
appName: "Access Controls",
appIcon: Icon(
MihIcons.accessControl,
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
// size: widget.packageSize,
),
iconSize: widget.packageSize,
primaryColor: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
secondaryColor: MzansiInnovationHub.of(context)!.theme.primaryColor(),
primaryColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
secondaryColor: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
);
}
}

View File

@@ -1,11 +1,12 @@
import 'package:mzansi_innovation_hub/main.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
import 'package:mzansi_innovation_hub/mih_services/mih_validation_services.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_single_child_scroll.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_dropdwn_field.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tool_body.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_objects/arguments.dart';
import 'package:flutter/material.dart';
import '../../../main.dart';
import '../../../mih_services/mih_service_calls.dart';
import '../../../mih_components/mih_layout/mih_action.dart';
import '../../../mih_components/mih_layout/mih_header.dart';
@@ -197,9 +198,9 @@ class _MihAccessRequestState extends State<MihAccessRequest> {
Icon(
MihIcons.accessControl,
size: 165,
color: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
),
const SizedBox(height: 10),
Text(
@@ -209,9 +210,9 @@ class _MihAccessRequestState extends State<MihAccessRequest> {
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
color: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
),
),
// const SizedBox(height: 10),
@@ -269,9 +270,9 @@ class _MihAccessRequestState extends State<MihAccessRequest> {
"$errorCode: Error pulling Patients Data\n$baseUrl/queue/patients/\n$errorBody",
style: TextStyle(
fontSize: 25,
color: MzansiInnovationHub.of(context)!
.theme
.errorColor()),
color: MihColors.getGreenColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark")),
textAlign: TextAlign.center,
),
);