chane tile if new business user
This commit is contained in:
@@ -167,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,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user