add toot titles to missing packages

This commit is contained in:
2025-11-25 10:45:39 +02:00
parent d51d13a685
commit 4a293c0aa4
7 changed files with 17 additions and 6 deletions

View File

@@ -12,7 +12,7 @@ class MihPackage extends StatefulWidget {
final Widget appActionButton; final Widget appActionButton;
final MihPackageTools appTools; final MihPackageTools appTools;
final List<Widget> appBody; final List<Widget> appBody;
final List<String>? appToolTitles; final List<String> appToolTitles;
final MIHAppDrawer? actionDrawer; final MIHAppDrawer? actionDrawer;
int selectedbodyIndex; int selectedbodyIndex;
final Function(int) onIndexChange; final Function(int) onIndexChange;
@@ -21,7 +21,7 @@ class MihPackage extends StatefulWidget {
required this.appActionButton, required this.appActionButton,
required this.appTools, required this.appTools,
required this.appBody, required this.appBody,
this.appToolTitles, required this.appToolTitles,
this.actionDrawer, this.actionDrawer,
required this.selectedbodyIndex, required this.selectedbodyIndex,
required this.onIndexChange, required this.onIndexChange,
@@ -173,10 +173,7 @@ class _MihPackageState extends State<MihPackage>
// color: Colors.black, // color: Colors.black,
child: FittedBox( child: FittedBox(
child: Text( child: Text(
widget.appToolTitles != null widget.appToolTitles[widget.selectedbodyIndex],
? widget
.appToolTitles![widget.selectedbodyIndex]
: "",
style: const TextStyle( style: const TextStyle(
fontSize: 23, fontSize: 23,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,

View File

@@ -20,6 +20,7 @@ class _MihAuthForgotPasswordState extends State<MihAuthForgotPassword> {
return MihPackage( return MihPackage(
appActionButton: getAction(), appActionButton: getAction(),
appTools: getTools(), appTools: getTools(),
appToolTitles: ["Forgot Password"],
appBody: getToolBody(), appBody: getToolBody(),
selectedbodyIndex: _selcetedIndex, selectedbodyIndex: _selcetedIndex,
onIndexChange: (newValue) { onIndexChange: (newValue) {

View File

@@ -26,6 +26,7 @@ class _MihAuthPasswordResetState extends State<MihAuthPasswordReset> {
appActionButton: getAction(), appActionButton: getAction(),
appTools: getTools(), appTools: getTools(),
appBody: getToolBody(), appBody: getToolBody(),
appToolTitles: ["Reset Password"],
selectedbodyIndex: _selcetedIndex, selectedbodyIndex: _selcetedIndex,
onIndexChange: (newValue) { onIndexChange: (newValue) {
setState(() { setState(() {

View File

@@ -23,6 +23,7 @@ class _MihAuthenticationState extends State<MihAuthentication> {
appActionButton: getAction(), appActionButton: getAction(),
appTools: getTools(), appTools: getTools(),
appBody: getToolBody(), appBody: getToolBody(),
appToolTitles: getToolTitle(),
selectedbodyIndex: context.watch<MihAuthenticationProvider>().toolIndex, selectedbodyIndex: context.watch<MihAuthenticationProvider>().toolIndex,
onIndexChange: (newIndex) { onIndexChange: (newIndex) {
context.read<MihAuthenticationProvider>().setToolIndex(newIndex); context.read<MihAuthenticationProvider>().setToolIndex(newIndex);
@@ -35,6 +36,14 @@ class _MihAuthenticationState extends State<MihAuthentication> {
return toolBodies; return toolBodies;
} }
List<String> getToolTitle() {
List<String> toolTitles = [
"Sign In",
"Create an Account",
];
return toolTitles;
}
MihPackageTools getTools() { MihPackageTools getTools() {
Map<Widget, void Function()?> temp = {}; Map<Widget, void Function()?> temp = {};
temp[const Icon(Icons.perm_identity)] = () { temp[const Icon(Icons.perm_identity)] = () {

View File

@@ -27,6 +27,7 @@ class _MihHomeErrorState extends State<MihHomeError> {
return MihPackage( return MihPackage(
appActionButton: getErrorAction(), appActionButton: getErrorAction(),
appTools: getErrorTools(), appTools: getErrorTools(),
appToolTitles: ["Connection Error"],
appBody: getErrorToolBody(widget.errorMessage), appBody: getErrorToolBody(widget.errorMessage),
selectedbodyIndex: _selcetedIndex, selectedbodyIndex: _selcetedIndex,
onIndexChange: (newValue) { onIndexChange: (newValue) {

View File

@@ -26,6 +26,7 @@ class _MihRouteErrorState extends State<MihRouteError> {
return MihPackage( return MihPackage(
appActionButton: getErrorAction(), appActionButton: getErrorAction(),
appTools: getErrorTools(), appTools: getErrorTools(),
appToolTitles: ["Invalid Path"],
appBody: getErrorToolBody(), appBody: getErrorToolBody(),
selectedbodyIndex: _selcetedIndex, selectedbodyIndex: _selcetedIndex,
onIndexChange: (newValue) { onIndexChange: (newValue) {

View File

@@ -62,6 +62,7 @@ class _BusinesProfileState extends State<BusinesProfile> {
return MihPackage( return MihPackage(
appActionButton: getAction(), appActionButton: getAction(),
appTools: getTools(), appTools: getTools(),
appToolTitles: getToolTitle(),
appBody: getToolBody(), appBody: getToolBody(),
selectedbodyIndex: mzansiProfileProvider.businessIndex, selectedbodyIndex: mzansiProfileProvider.businessIndex,
onIndexChange: (newIndex) { onIndexChange: (newIndex) {