forked from yaso_meth/mih-project
Update MZansi Pers Prof to us Go router
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_action.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tools.dart';
|
||||
@@ -41,7 +42,14 @@ class _MzansiProfileState extends State<MzansiProfile> {
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
iconSize: 35,
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
// Navigator.of(context).pop();
|
||||
context.goNamed(
|
||||
'home',
|
||||
extra: AuthArguments(
|
||||
true,
|
||||
false,
|
||||
),
|
||||
);
|
||||
FocusScope.of(context).unfocus();
|
||||
},
|
||||
);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
|
||||
@@ -28,9 +29,9 @@ class _MzansiProfileTileState extends State<MzansiProfileTile> {
|
||||
// ImageProvider logo = MzansiInnovationHub.of(context)!.theme.logoImage();
|
||||
return MihPackageTile(
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
'/mzansi-profile',
|
||||
arguments: AppProfileUpdateArguments(
|
||||
context.goNamed(
|
||||
'mzansiProfileManage',
|
||||
extra: AppProfileUpdateArguments(
|
||||
widget.signedInUser,
|
||||
widget.propicFile,
|
||||
),
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
|
||||
@@ -27,9 +28,9 @@ class _MzansiSetupProfileTileState extends State<MzansiSetupProfileTile> {
|
||||
Widget build(BuildContext context) {
|
||||
return MihPackageTile(
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
'/mzansi-profile',
|
||||
arguments: AppProfileUpdateArguments(
|
||||
context.goNamed(
|
||||
'mzansiProfileManage',
|
||||
extra: AppProfileUpdateArguments(
|
||||
widget.signedInUser,
|
||||
widget.propicFile,
|
||||
),
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
@@ -14,7 +15,6 @@ import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_text_form_field.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_toggle.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_error_message.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_success_message.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_env.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_objects/arguments.dart';
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
@@ -131,19 +131,8 @@ class _MihPersonalProfileState extends State<MihPersonalProfile> {
|
||||
if (originalProfileTypeIsBusiness == false && businessUser == true) {
|
||||
stayOnPersonalSide = false;
|
||||
}
|
||||
Navigator.of(context).pop();
|
||||
Navigator.of(context).pop();
|
||||
Navigator.of(context).pop();
|
||||
Navigator.of(context).pushNamed(
|
||||
'/',
|
||||
arguments: AuthArguments(
|
||||
stayOnPersonalSide,
|
||||
// true,
|
||||
false,
|
||||
),
|
||||
);
|
||||
String message = "Your information has been updated successfully!";
|
||||
successPopUp(message);
|
||||
successPopUp(message, stayOnPersonalSide);
|
||||
} else {
|
||||
internetConnectionPopUp();
|
||||
}
|
||||
@@ -164,14 +153,66 @@ class _MihPersonalProfileState extends State<MihPersonalProfile> {
|
||||
}
|
||||
}
|
||||
|
||||
void successPopUp(String message) {
|
||||
void successPopUp(String message, bool stayOnPersonalSide) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return MIHSuccessMessage(
|
||||
successType: "Success",
|
||||
successMessage: message,
|
||||
return MihPackageAlert(
|
||||
alertIcon: Icon(
|
||||
Icons.check_circle_outline_rounded,
|
||||
size: 150,
|
||||
color: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
),
|
||||
alertTitle: "Successfully Updated Profile",
|
||||
alertBody: Column(
|
||||
children: [
|
||||
Text(
|
||||
message,
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 25),
|
||||
Center(
|
||||
child: MihButton(
|
||||
onPressed: () {
|
||||
context.goNamed(
|
||||
'home',
|
||||
extra: AuthArguments(
|
||||
stayOnPersonalSide,
|
||||
false,
|
||||
),
|
||||
);
|
||||
},
|
||||
buttonColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
elevation: 10,
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Dismiss",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
alertColour: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
);
|
||||
// return MIHSuccessMessage(
|
||||
// successType: "Success",
|
||||
// successMessage: message,
|
||||
// );
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user