Merge pull request #123 from yaso-meth/NEW--new-home-screen-set-up-account-business-and-patient
NEW--new-home-screen-set-up-account-business-and-patient
This commit is contained in:
@@ -47,7 +47,7 @@ class _MIHAppDrawerState extends State<MIHAppDrawer> {
|
|||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
Navigator.of(context).pushNamed(
|
Navigator.of(context).pushNamed(
|
||||||
'/user-profile',
|
'/mzansi-profile',
|
||||||
arguments: AppProfileUpdateArguments(
|
arguments: AppProfileUpdateArguments(
|
||||||
widget.signedInUser, widget.propicFile),
|
widget.signedInUser, widget.propicFile),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ class MihHome extends StatefulWidget {
|
|||||||
|
|
||||||
class _MihHomeState extends State<MihHome> {
|
class _MihHomeState extends State<MihHome> {
|
||||||
final proPicController = TextEditingController();
|
final proPicController = TextEditingController();
|
||||||
int _selcetedIndex = 0;
|
late int _selcetedIndex;
|
||||||
late bool _personalSelected;
|
late bool _personalSelected;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -57,7 +57,18 @@ class _MihHomeState extends State<MihHome> {
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_personalSelected = widget.personalSelected;
|
|
||||||
|
if (widget.personalSelected == true) {
|
||||||
|
setState(() {
|
||||||
|
_selcetedIndex = 0;
|
||||||
|
_personalSelected = true;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
setState(() {
|
||||||
|
_selcetedIndex = 1;
|
||||||
|
_personalSelected = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -69,15 +80,14 @@ class _MihHomeState extends State<MihHome> {
|
|||||||
actionDrawer: getActionDrawer(),
|
actionDrawer: getActionDrawer(),
|
||||||
selectedbodyIndex: _selcetedIndex,
|
selectedbodyIndex: _selcetedIndex,
|
||||||
onIndexChange: (newValue) {
|
onIndexChange: (newValue) {
|
||||||
setState(() {
|
if (_selcetedIndex == 0) {
|
||||||
_selcetedIndex = newValue;
|
|
||||||
});
|
|
||||||
if (newValue == 0) {
|
|
||||||
setState(() {
|
setState(() {
|
||||||
|
_selcetedIndex = newValue;
|
||||||
_personalSelected = true;
|
_personalSelected = true;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
setState(() {
|
setState(() {
|
||||||
|
_selcetedIndex = newValue;
|
||||||
_personalSelected = false;
|
_personalSelected = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -121,12 +131,14 @@ class _MihHomeState extends State<MihHome> {
|
|||||||
temp[const Icon(Icons.person)] = () {
|
temp[const Icon(Icons.person)] = () {
|
||||||
setState(() {
|
setState(() {
|
||||||
_selcetedIndex = 0;
|
_selcetedIndex = 0;
|
||||||
|
_personalSelected = true;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
if (widget.isBusinessUser) {
|
if (widget.isBusinessUser) {
|
||||||
temp[const Icon(Icons.business_center)] = () {
|
temp[const Icon(Icons.business_center)] = () {
|
||||||
setState(() {
|
setState(() {
|
||||||
_selcetedIndex = 1;
|
_selcetedIndex = 1;
|
||||||
|
_personalSelected = false;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -145,6 +157,7 @@ class _MihHomeState extends State<MihHome> {
|
|||||||
business: widget.business,
|
business: widget.business,
|
||||||
businessUser: widget.businessUser,
|
businessUser: widget.businessUser,
|
||||||
propicFile: widget.propicFile,
|
propicFile: widget.propicFile,
|
||||||
|
isUserNew: widget.isUserNew,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
if (widget.isBusinessUser) {
|
if (widget.isBusinessUser) {
|
||||||
@@ -154,6 +167,7 @@ class _MihHomeState extends State<MihHome> {
|
|||||||
personalSelected: _personalSelected,
|
personalSelected: _personalSelected,
|
||||||
businessUser: widget.businessUser,
|
businessUser: widget.businessUser,
|
||||||
business: widget.business,
|
business: widget.business,
|
||||||
|
isBusinessUserNew: widget.isBusinessUserNew,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ class _MIHHomeLegacyState extends State<MIHHomeLegacy> {
|
|||||||
tileList.add(MIHTile(
|
tileList.add(MIHTile(
|
||||||
videoID: "jFV3NN65DtQ",
|
videoID: "jFV3NN65DtQ",
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.of(context).pushNamed('/user-profile',
|
Navigator.of(context).pushNamed('/mzansi-profile',
|
||||||
arguments: AppProfileUpdateArguments(
|
arguments: AppProfileUpdateArguments(
|
||||||
widget.signedInUser, widget.propicFile));
|
widget.signedInUser, widget.propicFile));
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import 'package:Mzansi_Innovation_Hub/mih_packages/calculator/package_tiles/mih_
|
|||||||
import 'package:Mzansi_Innovation_Hub/mih_packages/calendar/package_tiles/mzansi_calendar_tile.dart';
|
import 'package:Mzansi_Innovation_Hub/mih_packages/calendar/package_tiles/mzansi_calendar_tile.dart';
|
||||||
import 'package:Mzansi_Innovation_Hub/mih_packages/mzansi_ai/package_tiles/mzansi_ai_tile.dart';
|
import 'package:Mzansi_Innovation_Hub/mih_packages/mzansi_ai/package_tiles/mzansi_ai_tile.dart';
|
||||||
import 'package:Mzansi_Innovation_Hub/mih_packages/mzansi_profile/business_profile/package_tiles/mzansi_business_profile_tile.dart';
|
import 'package:Mzansi_Innovation_Hub/mih_packages/mzansi_profile/business_profile/package_tiles/mzansi_business_profile_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_packages/patient_profile/pat_manager/package_tiles/pat_manager_tile.dart';
|
import 'package:Mzansi_Innovation_Hub/mih_packages/patient_profile/pat_manager/package_tiles/pat_manager_tile.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
@@ -20,12 +21,14 @@ class MihBusinessHome extends StatefulWidget {
|
|||||||
final bool personalSelected;
|
final bool personalSelected;
|
||||||
final Business? business;
|
final Business? business;
|
||||||
final BusinessUser? businessUser;
|
final BusinessUser? businessUser;
|
||||||
|
final bool isBusinessUserNew;
|
||||||
const MihBusinessHome({
|
const MihBusinessHome({
|
||||||
super.key,
|
super.key,
|
||||||
required this.signedInUser,
|
required this.signedInUser,
|
||||||
required this.personalSelected,
|
required this.personalSelected,
|
||||||
required this.business,
|
required this.business,
|
||||||
required this.businessUser,
|
required this.businessUser,
|
||||||
|
required this.isBusinessUserNew,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -39,6 +42,17 @@ class _MihBusinessHomeState extends State<MihBusinessHome> {
|
|||||||
ValueNotifier([]);
|
ValueNotifier([]);
|
||||||
double packageSize = 200;
|
double packageSize = 200;
|
||||||
|
|
||||||
|
List<Map<String, Widget>> setNewBusinessUserPackages() {
|
||||||
|
List<Map<String, Widget>> temp = [];
|
||||||
|
temp.add({
|
||||||
|
"Setup Business": MzansiSetupBusinessProfileTile(
|
||||||
|
signedInUser: widget.signedInUser,
|
||||||
|
packageSize: packageSize,
|
||||||
|
)
|
||||||
|
});
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
List<Map<String, Widget>> setBusinessPackages() {
|
List<Map<String, Widget>> setBusinessPackages() {
|
||||||
List<Map<String, Widget>> temp = [];
|
List<Map<String, Widget>> temp = [];
|
||||||
//=============== Biz Profile ===============
|
//=============== Biz Profile ===============
|
||||||
@@ -137,7 +151,11 @@ class _MihBusinessHomeState extends State<MihBusinessHome> {
|
|||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
searchController.addListener(searchPackage);
|
searchController.addListener(searchPackage);
|
||||||
businessPackagesMap = setBusinessPackages();
|
if (widget.isBusinessUserNew) {
|
||||||
|
businessPackagesMap = setNewBusinessUserPackages();
|
||||||
|
} else {
|
||||||
|
businessPackagesMap = setBusinessPackages();
|
||||||
|
}
|
||||||
searchPackage();
|
searchPackage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import 'package:Mzansi_Innovation_Hub/mih_packages/calculator/package_tiles/mih_
|
|||||||
import 'package:Mzansi_Innovation_Hub/mih_packages/calendar/package_tiles/mzansi_calendar_tile.dart';
|
import 'package:Mzansi_Innovation_Hub/mih_packages/calendar/package_tiles/mzansi_calendar_tile.dart';
|
||||||
import 'package:Mzansi_Innovation_Hub/mih_packages/mzansi_ai/package_tiles/mzansi_ai_tile.dart';
|
import 'package:Mzansi_Innovation_Hub/mih_packages/mzansi_ai/package_tiles/mzansi_ai_tile.dart';
|
||||||
import 'package:Mzansi_Innovation_Hub/mih_packages/mzansi_profile/personal_profile/package_tiles/mzansi_profile_tile.dart';
|
import 'package:Mzansi_Innovation_Hub/mih_packages/mzansi_profile/personal_profile/package_tiles/mzansi_profile_tile.dart';
|
||||||
|
import 'package:Mzansi_Innovation_Hub/mih_packages/mzansi_profile/personal_profile/package_tiles/mzansi_setup_profile_tile.dart';
|
||||||
import 'package:Mzansi_Innovation_Hub/mih_packages/mzansi_wallet/package_tiles/mih_wallet_tile.dart';
|
import 'package:Mzansi_Innovation_Hub/mih_packages/mzansi_wallet/package_tiles/mih_wallet_tile.dart';
|
||||||
import 'package:Mzansi_Innovation_Hub/mih_packages/patient_profile/pat_profile/package_tiles/patient_profile_tile.dart';
|
import 'package:Mzansi_Innovation_Hub/mih_packages/patient_profile/pat_profile/package_tiles/patient_profile_tile.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -23,6 +24,7 @@ class MihPersonalHome extends StatefulWidget {
|
|||||||
final Business? business;
|
final Business? business;
|
||||||
final BusinessUser? businessUser;
|
final BusinessUser? businessUser;
|
||||||
final ImageProvider<Object>? propicFile;
|
final ImageProvider<Object>? propicFile;
|
||||||
|
final bool isUserNew;
|
||||||
|
|
||||||
const MihPersonalHome({
|
const MihPersonalHome({
|
||||||
super.key,
|
super.key,
|
||||||
@@ -31,6 +33,7 @@ class MihPersonalHome extends StatefulWidget {
|
|||||||
required this.business,
|
required this.business,
|
||||||
required this.businessUser,
|
required this.businessUser,
|
||||||
required this.propicFile,
|
required this.propicFile,
|
||||||
|
required this.isUserNew,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -44,6 +47,18 @@ class _MihPersonalHomeState extends State<MihPersonalHome> {
|
|||||||
ValueNotifier([]);
|
ValueNotifier([]);
|
||||||
double packageSize = 200;
|
double packageSize = 200;
|
||||||
|
|
||||||
|
List<Map<String, Widget>> setNerUserPersonalPackage() {
|
||||||
|
List<Map<String, Widget>> temp = [];
|
||||||
|
temp.add({
|
||||||
|
"Setup Profile": MzansiSetupProfileTile(
|
||||||
|
signedInUser: widget.signedInUser,
|
||||||
|
propicFile: widget.propicFile,
|
||||||
|
packageSize: packageSize,
|
||||||
|
)
|
||||||
|
});
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
List<Map<String, Widget>> setPersonalPackagesMap() {
|
List<Map<String, Widget>> setPersonalPackagesMap() {
|
||||||
List<Map<String, Widget>> temp = [];
|
List<Map<String, Widget>> temp = [];
|
||||||
//=============== Mzansi Profile ===============
|
//=============== Mzansi Profile ===============
|
||||||
@@ -154,7 +169,11 @@ class _MihPersonalHomeState extends State<MihPersonalHome> {
|
|||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
searchController.addListener(searchPackage);
|
searchController.addListener(searchPackage);
|
||||||
personalPackagesMap = setPersonalPackagesMap();
|
if (widget.isUserNew) {
|
||||||
|
personalPackagesMap = setNerUserPersonalPackage();
|
||||||
|
} else {
|
||||||
|
personalPackagesMap = setPersonalPackagesMap();
|
||||||
|
}
|
||||||
searchPackage();
|
searchPackage();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -193,7 +212,7 @@ class _MihPersonalHomeState extends State<MihPersonalHome> {
|
|||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
child: MIHSearchField(
|
child: MIHSearchField(
|
||||||
controller: searchController,
|
controller: searchController,
|
||||||
hintText: "Search Mzansi Packages",
|
hintText: "Search MIH Packages",
|
||||||
required: false,
|
required: false,
|
||||||
editable: true,
|
editable: true,
|
||||||
onTap: () {},
|
onTap: () {},
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
import 'package:Mzansi_Innovation_Hub/main.dart';
|
||||||
|
import 'package:Mzansi_Innovation_Hub/mih_components/mih_package/mih_app_tile.dart';
|
||||||
|
import 'package:Mzansi_Innovation_Hub/mih_objects/app_user.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class MzansiSetupBusinessProfileTile extends StatefulWidget {
|
||||||
|
final AppUser signedInUser;
|
||||||
|
final double packageSize;
|
||||||
|
const MzansiSetupBusinessProfileTile({
|
||||||
|
super.key,
|
||||||
|
required this.signedInUser,
|
||||||
|
required this.packageSize,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<MzansiSetupBusinessProfileTile> createState() =>
|
||||||
|
_MzansiSetupBusinessProfileTileState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _MzansiSetupBusinessProfileTileState
|
||||||
|
extends State<MzansiSetupBusinessProfileTile> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return MihAppTile(
|
||||||
|
onTap: () {
|
||||||
|
Navigator.of(context).pushNamed(
|
||||||
|
'/business-profile/set-up',
|
||||||
|
arguments: widget.signedInUser,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
appName: "Setup Business",
|
||||||
|
appIcon: Container(
|
||||||
|
padding: const EdgeInsets.all(0.5),
|
||||||
|
child: Icon(
|
||||||
|
Icons.business_center,
|
||||||
|
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
iconSize: widget.packageSize,
|
||||||
|
primaryColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
|
secondaryColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -122,12 +122,12 @@ class _MihBusinessProfileState extends State<MihBusinessProfile> {
|
|||||||
}
|
}
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
|
Navigator.of(context).pop();
|
||||||
Navigator.of(context).pushNamed(
|
Navigator.of(context).pushNamed(
|
||||||
'/business-profile/manage',
|
'/',
|
||||||
arguments: BusinessArguments(
|
arguments: AuthArguments(
|
||||||
widget.arguments.signedInUser,
|
false,
|
||||||
widget.arguments.businessUser,
|
false,
|
||||||
widget.arguments.business,
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
String message =
|
String message =
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
|
|||||||
);
|
);
|
||||||
if (response.statusCode == 201) {
|
if (response.statusCode == 201) {
|
||||||
uploadSelectedFile(selectedSignature, signtureController);
|
uploadSelectedFile(selectedSignature, signtureController);
|
||||||
// Navigator.of(context).pushNamed('/');
|
Navigator.of(context).pop();
|
||||||
Navigator.of(context).popAndPushNamed(
|
Navigator.of(context).popAndPushNamed(
|
||||||
'/',
|
'/',
|
||||||
arguments: AuthArguments(false, false),
|
arguments: AuthArguments(false, false),
|
||||||
|
|||||||
@@ -0,0 +1,47 @@
|
|||||||
|
import 'package:Mzansi_Innovation_Hub/main.dart';
|
||||||
|
import 'package:Mzansi_Innovation_Hub/mih_components/mih_package/mih_app_tile.dart';
|
||||||
|
import 'package:Mzansi_Innovation_Hub/mih_objects/app_user.dart';
|
||||||
|
import 'package:Mzansi_Innovation_Hub/mih_objects/arguments.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class MzansiSetupProfileTile extends StatefulWidget {
|
||||||
|
final AppUser signedInUser;
|
||||||
|
final ImageProvider<Object>? propicFile;
|
||||||
|
final double packageSize;
|
||||||
|
|
||||||
|
const MzansiSetupProfileTile({
|
||||||
|
super.key,
|
||||||
|
required this.signedInUser,
|
||||||
|
required this.propicFile,
|
||||||
|
required this.packageSize,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<MzansiSetupProfileTile> createState() => _MzansiSetupProfileTileState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _MzansiSetupProfileTileState extends State<MzansiSetupProfileTile> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
ImageProvider logo = MzanziInnovationHub.of(context)!.theme.logoImage();
|
||||||
|
return MihAppTile(
|
||||||
|
onTap: () {
|
||||||
|
Navigator.of(context).pushNamed(
|
||||||
|
'/mzansi-profile',
|
||||||
|
arguments: AppProfileUpdateArguments(
|
||||||
|
widget.signedInUser,
|
||||||
|
widget.propicFile,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
appName: "Setup Profile",
|
||||||
|
appIcon: Container(
|
||||||
|
padding: const EdgeInsets.all(25),
|
||||||
|
child: Image(image: logo),
|
||||||
|
),
|
||||||
|
iconSize: widget.packageSize,
|
||||||
|
primaryColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
|
secondaryColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -144,12 +144,20 @@ class _MihPersonalProfileState extends State<MihPersonalProfile> {
|
|||||||
//print("Here4");
|
//print("Here4");
|
||||||
//print(response.statusCode);
|
//print(response.statusCode);
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
|
Navigator.of(context).pop();
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
Navigator.of(context).pushNamed(
|
Navigator.of(context).pushNamed(
|
||||||
'/user-profile',
|
'/',
|
||||||
arguments: AppProfileUpdateArguments(
|
arguments: AuthArguments(
|
||||||
widget.arguments.signedInUser, widget.arguments.propicFile),
|
true,
|
||||||
|
false,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
// Navigator.of(context).pushNamed(
|
||||||
|
// '/mzansi-profile',
|
||||||
|
// arguments: AppProfileUpdateArguments(
|
||||||
|
// widget.arguments.signedInUser, widget.arguments.propicFile),
|
||||||
|
// );
|
||||||
String message =
|
String message =
|
||||||
"${widget.arguments.signedInUser.email}'s information has been updated successfully!";
|
"${widget.arguments.signedInUser.email}'s information has been updated successfully!";
|
||||||
successPopUp(message);
|
successPopUp(message);
|
||||||
|
|||||||
@@ -330,7 +330,7 @@ class _AddPatientState extends State<AddPatient> {
|
|||||||
headerAlignment: MainAxisAlignment.center,
|
headerAlignment: MainAxisAlignment.center,
|
||||||
headerItems: [
|
headerItems: [
|
||||||
Text(
|
Text(
|
||||||
"Add Patient Details",
|
"Set Up Patient Profile",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
fontSize: 25,
|
fontSize: 25,
|
||||||
|
|||||||
Reference in New Issue
Block a user