BUG: Fix MIH Logo press on app drawer
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_components/mih_objects/arguments.dart';
|
|
||||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_circle_avatar.dart';
|
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_circle_avatar.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
|
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_components/mih_providers/about_mih_provider.dart';
|
import 'package:mzansi_innovation_hub/mih_components/mih_providers/about_mih_provider.dart';
|
||||||
@@ -61,11 +60,18 @@ class _MIHAppDrawerState extends State<MIHAppDrawer> {
|
|||||||
context.goNamed(
|
context.goNamed(
|
||||||
'mzansiProfileManage',
|
'mzansiProfileManage',
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
if (mzansiProfileProvider.business == null) {
|
||||||
|
context.goNamed(
|
||||||
|
'businessProfileSetup',
|
||||||
|
extra: mzansiProfileProvider.user,
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
context.goNamed(
|
context.goNamed(
|
||||||
"businessProfileManage",
|
"businessProfileManage",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
child: MihCircleAvatar(
|
child: MihCircleAvatar(
|
||||||
imageFile: mzansiProfileProvider.personalHome
|
imageFile: mzansiProfileProvider.personalHome
|
||||||
@@ -132,7 +138,8 @@ class _MIHAppDrawerState extends State<MIHAppDrawer> {
|
|||||||
Visibility(
|
Visibility(
|
||||||
visible: !mzansiProfileProvider.personalHome,
|
visible: !mzansiProfileProvider.personalHome,
|
||||||
child: Text(
|
child: Text(
|
||||||
mzansiProfileProvider.business?.Name ?? "",
|
mzansiProfileProvider.business?.Name ??
|
||||||
|
"Setup Business",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.getPrimaryColor(
|
||||||
@@ -368,26 +375,22 @@ class _MIHAppDrawerState extends State<MIHAppDrawer> {
|
|||||||
height: 30,
|
height: 30,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
setState(() {
|
// setState(() {
|
||||||
if (MzansiInnovationHub.of(context)?.theme.mode ==
|
// if (MzansiInnovationHub.of(context)?.theme.mode ==
|
||||||
"Dark") {
|
// "Dark") {
|
||||||
//darkm = !darkm;
|
// //darkm = !darkm;
|
||||||
MzansiInnovationHub.of(context)!
|
// MzansiInnovationHub.of(context)!
|
||||||
.changeTheme(ThemeMode.light);
|
// .changeTheme(ThemeMode.light);
|
||||||
//print("Dark Mode: $darkm");
|
// //print("Dark Mode: $darkm");
|
||||||
} else {
|
// } else {
|
||||||
//darkm = !darkm;
|
// //darkm = !darkm;
|
||||||
MzansiInnovationHub.of(context)!
|
// MzansiInnovationHub.of(context)!
|
||||||
.changeTheme(ThemeMode.dark);
|
// .changeTheme(ThemeMode.dark);
|
||||||
//print("Dark Mode: $darkm");
|
// //print("Dark Mode: $darkm");
|
||||||
}
|
// }
|
||||||
Navigator.of(context).pop();
|
// // Navigator.of(context).popAndPushNamed('/',);
|
||||||
Navigator.of(context).popAndPushNamed(
|
// });
|
||||||
'/',
|
context.goNamed("aboutMih");
|
||||||
arguments: AuthArguments(true, false),
|
|
||||||
);
|
|
||||||
// Navigator.of(context).popAndPushNamed('/',);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
child: Icon(
|
child: Icon(
|
||||||
MihIcons.mihLogo,
|
MihIcons.mihLogo,
|
||||||
|
|||||||
Reference in New Issue
Block a user