New Business Setup Flow
This commit is contained in:
@@ -174,8 +174,9 @@ class _MIHAppDrawerState extends State<MIHAppDrawer> {
|
||||
),
|
||||
),
|
||||
Text(
|
||||
mzansiProfileProvider.user!.type
|
||||
.toUpperCase(),
|
||||
mzansiProfileProvider.business == null
|
||||
? "PERSONAL"
|
||||
: "BUSINESS",
|
||||
style: TextStyle(
|
||||
fontSize: 10,
|
||||
fontWeight: FontWeight.bold,
|
||||
|
||||
@@ -284,7 +284,7 @@ class _MihHomeState extends State<MihHome> {
|
||||
child: MihPackage(
|
||||
packageActionButton: getAction(),
|
||||
packageTools: getTools(mzansiProfileProvider,
|
||||
mzansiProfileProvider.user!.type != "personal"),
|
||||
mzansiProfileProvider.business != null),
|
||||
packageToolBodies: getToolBody(mzansiProfileProvider),
|
||||
packageToolTitles: getToolTitle(),
|
||||
actionDrawer: getActionDrawer(),
|
||||
|
||||
@@ -3,6 +3,7 @@ import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_env.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/Example/package_tiles/test_package_tile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mzansi_profile/business_profile/package_tiles/mzansi_setup_business_profile_tile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_ai_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/about_mih/package_tile/about_mih_tile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/access_review/package_tile/mih_access_tile.dart';
|
||||
@@ -66,7 +67,8 @@ class _MihPersonalHomeState extends State<MihPersonalHome>
|
||||
return temp;
|
||||
}
|
||||
|
||||
List<Map<String, Widget>> setPersonalPackagesMap() {
|
||||
List<Map<String, Widget>> setPersonalPackagesMap(
|
||||
MzansiProfileProvider profileProvider) {
|
||||
List<Map<String, Widget>> temp = [];
|
||||
//=============== Mzansi Profile ===============
|
||||
temp.add({
|
||||
@@ -74,6 +76,14 @@ class _MihPersonalHomeState extends State<MihPersonalHome>
|
||||
packageSize: packageSize,
|
||||
)
|
||||
});
|
||||
//=============== Mzansi Profile ===============
|
||||
if (profileProvider.business == null) {
|
||||
temp.add({
|
||||
"Create Business": MzansiSetupBusinessProfileTile(
|
||||
packageSize: packageSize,
|
||||
)
|
||||
});
|
||||
}
|
||||
//=============== Mzansi Wallet ===============
|
||||
temp.add({
|
||||
"Mzansi Wallet": MihWalletTile(
|
||||
@@ -198,7 +208,7 @@ class _MihPersonalHomeState extends State<MihPersonalHome>
|
||||
personalPackagesMap = setNerUserPersonalPackage();
|
||||
autoNavToProfile();
|
||||
} else {
|
||||
personalPackagesMap = setPersonalPackagesMap();
|
||||
personalPackagesMap = setPersonalPackagesMap(profileProvider);
|
||||
}
|
||||
searchPackage();
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ class _MihEditPersonalProfileWindowState
|
||||
bool businessUser = false;
|
||||
|
||||
void initializeControllers(MzansiProfileProvider mzansiProfileProvider) {
|
||||
businessUser = mzansiProfileProvider.user!.type == "business";
|
||||
businessUser = mzansiProfileProvider.business != null;
|
||||
oldProPicName = mzansiProfileProvider.user!.pro_pic_path.isNotEmpty
|
||||
? mzansiProfileProvider.user!.pro_pic_path.split("/").last
|
||||
: "";
|
||||
@@ -51,7 +51,7 @@ class _MihEditPersonalProfileWindowState
|
||||
mzansiProfileProvider.user!.pro_pic_path.isNotEmpty
|
||||
? mzansiProfileProvider.user!.pro_pic_path.split("/").last
|
||||
: "";
|
||||
businessUser = mzansiProfileProvider.user!.type == "business";
|
||||
businessUser = mzansiProfileProvider.business != null;
|
||||
_controllersInitialized = true;
|
||||
}
|
||||
}
|
||||
@@ -135,7 +135,7 @@ class _MihEditPersonalProfileWindowState
|
||||
}
|
||||
|
||||
void setProfileVariables(MzansiProfileProvider mzansiProfileProvider) {
|
||||
businessUser = mzansiProfileProvider.user!.type == "business";
|
||||
businessUser = mzansiProfileProvider.business != null;
|
||||
oldProPicName = mzansiProfileProvider.user!.pro_pic_path.isNotEmpty
|
||||
? mzansiProfileProvider.user!.pro_pic_path.split("/").last
|
||||
: "";
|
||||
@@ -160,13 +160,8 @@ class _MihEditPersonalProfileWindowState
|
||||
[
|
||||
MihButton(
|
||||
onPressed: () {
|
||||
if (profileProvider.user!.type.toLowerCase() == "business" &&
|
||||
profileProvider.business == null) {
|
||||
setupBusinessPopUp(profileProvider);
|
||||
} else {
|
||||
context.pop();
|
||||
context.pop();
|
||||
}
|
||||
context.pop();
|
||||
context.pop();
|
||||
},
|
||||
buttonColor: MihColors.primary(),
|
||||
elevation: 10,
|
||||
@@ -429,19 +424,19 @@ class _MihEditPersonalProfileWindowState
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
MihToggle(
|
||||
hintText: "Activate Business Account",
|
||||
initialPostion: businessUser,
|
||||
fillColor: MihColors.secondary(),
|
||||
secondaryFillColor: MihColors.primary(),
|
||||
onChange: (value) {
|
||||
setState(() {
|
||||
businessUser = value;
|
||||
});
|
||||
KenLogger.success("Business User: $businessUser");
|
||||
},
|
||||
),
|
||||
// const SizedBox(height: 10.0),
|
||||
// MihToggle(
|
||||
// hintText: "Activate Business Account",
|
||||
// initialPostion: businessUser,
|
||||
// fillColor: MihColors.secondary(),
|
||||
// secondaryFillColor: MihColors.primary(),
|
||||
// onChange: (value) {
|
||||
// setState(() {
|
||||
// businessUser = value;
|
||||
// });
|
||||
// KenLogger.success("Business User: $businessUser");
|
||||
// },
|
||||
// ),
|
||||
const SizedBox(height: 30.0),
|
||||
Center(
|
||||
child: MihButton(
|
||||
|
||||
@@ -214,7 +214,7 @@ class _MihPersonalProfileState extends State<MihPersonalProfile> {
|
||||
),
|
||||
FittedBox(
|
||||
child: Text(
|
||||
mzansiProfileProvider.user!.type == "business"
|
||||
mzansiProfileProvider.business != null
|
||||
? "Business".toUpperCase()
|
||||
: "Personal".toUpperCase(),
|
||||
style: TextStyle(
|
||||
|
||||
Reference in New Issue
Block a user