add sync data package, enable offline display of mzansi wallet, about mih & mzansi ai

This commit is contained in:
yaso 2026-06-29 09:53:23 +02:00
parent f588e9f715
commit 6ad1ea613c
18 changed files with 826 additions and 833 deletions

View file

@ -1,28 +1,9 @@
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.
analyzer:
exclude:
- lib/**/*.g.dart
- lib/**/hive_registrar.g.dart
# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml
linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at https://dart.dev/lints.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options

14
mih_ui/build.yaml Normal file
View file

@ -0,0 +1,14 @@
targets:
$default:
builders:
# 1. Restrict adapter generation to your mih_hive folder
hive_ce_generator:hive_adapters_generator:
generate_for:
- lib/mih_hive/*.dart
# 2. Restrict registrar generation to your entry points
hive_ce_generator:hive_registrar_generator:
generate_for:
- lib/main.dart
- lib/main_dev.dart
- lib/main_prod.dart

View file

@ -4,6 +4,7 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:ken_logger/ken_logger.dart';
import 'package:mzansi_innovation_hub/mih_hive/about_mih_hive_data.dart';
import 'package:mzansi_innovation_hub/mih_hive/mzansi_profile_hive_data.dart';
import 'package:mzansi_innovation_hub/mih_hive/mzansi_wallet_hive_data.dart';
import 'package:mzansi_innovation_hub/mih_providers/about_mih_provider.dart';
@ -151,7 +152,9 @@ class _MzansiInnovationHubState extends State<MzansiInnovationHub> {
create: (context) => MihCalendarProvider(),
),
ChangeNotifierProvider(
create: (context) => AboutMihProvider(),
create: (context) => AboutMihProvider(
AboutMihHiveData(),
),
),
ChangeNotifierProvider(
create: (context) => MihMineSweeperProvider(),

View file

@ -45,6 +45,7 @@ void main() async {
// Mzansi Wallet Data
await Hive.openBox<MIHLoyaltyCard>('loyalty_card_box');
await Hive.openBox<MIHLoyaltyCard>('fav_loyalty_card_box');
await Hive.openBox<int>('about_mih_box');
// await Firebase.initializeApp(
// // options: DefaultFirebaseOptions.currentPlatform,

View file

@ -0,0 +1,42 @@
import 'package:hive_ce_flutter/adapters.dart';
import 'package:ken_logger/ken_logger.dart';
import 'package:mzansi_innovation_hub/mih_services/mih_business_details_services.dart';
import 'package:mzansi_innovation_hub/mih_services/mih_user_services.dart';
class AboutMihHiveData {
final Box<int> _mihUserBusinessCountBox = Hive.box<int>('about_mih_box');
static const String kUserCountKey = 'current_user_count';
static const String kBusinessCountKey = 'current_user_count';
// Get Data from local storage
int? getcachedUserCount() => _mihUserBusinessCountBox.get(kUserCountKey);
int? getcachedBusinessCount() =>
_mihUserBusinessCountBox.get(kBusinessCountKey);
// Caching Data to local storage
Future<void> cacheUserCount(int remoteUserCount) async {
await _mihUserBusinessCountBox.put(kUserCountKey, remoteUserCount);
KenLogger.success("MIH User Count Cached");
}
Future<void> cacheBusinessCount(int remoteBusinessCount) async {
await _mihUserBusinessCountBox.put(kUserCountKey, remoteBusinessCount);
KenLogger.success("MIH Business Count Cached");
}
// Sync Local Data from data from MIH Server
Future<bool> syncAboutMihDataWithServer() async {
try {
int remoteUserCount = await MihUserServices().fetchUserCount();
cacheUserCount(remoteUserCount);
int remoteBusinessCount =
await MihBusinessDetailsServices().fetchBusinessCount();
cacheBusinessCount(remoteBusinessCount);
return true;
} catch (error) {
KenLogger.warning("MIH App Operating in Offline Mode. Sync Paused");
return false;
}
}
}

View file

@ -159,7 +159,7 @@ class MzansiProfileHiveData {
}
return true;
} catch (error) {
KenLogger.warning("App Operating in Offline Mode. Sync Paused");
KenLogger.warning("MIH App Operating in Offline Mode. Sync Paused");
return false;
// KenLogger.warning("App operating offline mode. Sync paused: $error");
}

View file

@ -51,7 +51,7 @@ class MzansiWalletHiveData {
cacheFavLoyaltyCardsData(remoteFavLoyaltyCards);
return true;
} catch (error) {
KenLogger.warning("App Operating in Offline Mode. Sync Paused");
KenLogger.warning("MIH App Operating in Offline Mode. Sync Paused");
return false;
// KenLogger.warning("App operating offline mode. Sync paused: $error");
}

View file

@ -0,0 +1,57 @@
import 'package:flutter/material.dart';
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
import 'package:mzansi_innovation_hub/mih_providers/about_mih_provider.dart';
import 'package:provider/provider.dart';
class AboutMihHeading extends StatefulWidget {
const AboutMihHeading({super.key});
@override
State<AboutMihHeading> createState() => _AboutMihHeadingState();
}
class _AboutMihHeadingState extends State<AboutMihHeading> {
@override
Widget build(BuildContext context) {
return Consumer<AboutMihProvider>(
builder: (BuildContext context, AboutMihProvider aboutProvider,
Widget? child) {
return Column(
children: [
SizedBox(
width: 165,
child: FittedBox(
child: Icon(
MihIcons.mihLogo,
color: MihColors.secondary(),
),
),
),
const SizedBox(
height: 10,
),
const Text(
"Mzansi Innovation Hub",
textAlign: TextAlign.center,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 30,
),
),
Text(
"MIH App Version: ${aboutProvider.version}",
textAlign: TextAlign.center,
style: const TextStyle(
fontWeight: FontWeight.normal,
fontSize: 15,
),
),
const SizedBox(
height: 10,
),
],
);
},
);
}
}

View file

@ -0,0 +1,239 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:go_router/go_router.dart';
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
import 'package:mzansi_innovation_hub/main.dart';
import 'package:mzansi_innovation_hub/mih_services/mih_install_services.dart';
import 'package:url_launcher/url_launcher.dart';
class CallToActionButtons extends StatefulWidget {
const CallToActionButtons({super.key});
@override
State<CallToActionButtons> createState() => _CallToActionButtonsState();
}
class _CallToActionButtonsState extends State<CallToActionButtons> {
Future<void> launchSocialUrl(Uri linkUrl) async {
if (!await launchUrl(linkUrl)) {
throw Exception('Could not launch $linkUrl');
}
}
Widget getInstallButtonText() {
final isWebAndroid =
kIsWeb && (defaultTargetPlatform == TargetPlatform.android);
final isWebIos = kIsWeb && (defaultTargetPlatform == TargetPlatform.iOS);
String btnText = "";
FaIconData platformIcon;
if (isWebAndroid) {
btnText = "Install MIH";
platformIcon = FontAwesomeIcons.googlePlay;
} else if (isWebIos) {
btnText = "Install MIH";
platformIcon = FontAwesomeIcons.appStoreIos;
} else if (MzansiInnovationHub.of(context)!.theme.getPlatform() ==
"Android") {
btnText = "Update MIH";
platformIcon = FontAwesomeIcons.googlePlay;
} else if (MzansiInnovationHub.of(context)!.theme.getPlatform() == "iOS") {
btnText = "Update MIH";
platformIcon = FontAwesomeIcons.appStoreIos;
} else {
btnText = "Install MIH";
platformIcon = FontAwesomeIcons.globe;
}
return Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
FaIcon(
platformIcon,
color: MihColors.primary(),
),
const SizedBox(width: 10),
Text(
btnText,
style: TextStyle(
color: MihColors.primary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
],
);
}
@override
Widget build(BuildContext context) {
return Column(
children: [
Wrap(
alignment: WrapAlignment.center,
crossAxisAlignment: WrapCrossAlignment.center,
spacing: 10,
runSpacing: 10,
children: [
MihButton(
onPressed: () {
if (MzansiInnovationHub.of(context)!.theme.getPlatform() ==
"Android") {
showDialog(
context: context,
builder: (context) {
return MihPackageWindow(
fullscreen: false,
windowTitle: "Select Option",
onWindowTapClose: () {
context.pop();
},
windowBody: Column(
children: [
Text(
"Please select the platform you want to install/ Update MIH from",
style: TextStyle(
color: MihColors.secondary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
const SizedBox(height: 25),
MihButton(
onPressed: () {
launchSocialUrl(
Uri.parse(
"https://play.google.com/store/apps/details?id=za.co.mzansiinnovationhub.mih",
),
);
},
buttonColor: MihColors.green(),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
FaIcon(
FontAwesomeIcons.googlePlay,
color: MihColors.primary(),
),
const SizedBox(width: 10),
Text(
"Play Store",
style: TextStyle(
color: MihColors.primary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
],
),
),
const SizedBox(
height: 10,
),
MihButton(
onPressed: () {
launchSocialUrl(
Uri.parse(
"https://appgallery.huawei.com/app/C113315335?pkgName=za.co.mzansiinnovationhub.mih",
),
);
},
buttonColor: MihColors.green(),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.store,
color: MihColors.primary(),
),
const SizedBox(width: 10),
Text(
"App Gallery",
style: TextStyle(
color: MihColors.primary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
],
),
),
],
),
);
},
);
} else {
MihInstallServices().installMihTrigger(context);
}
},
buttonColor: MihColors.green(),
width: 300,
child: getInstallButtonText(),
),
MihButton(
onPressed: () {
launchSocialUrl(
Uri.parse(
"https://www.youtube.com/playlist?list=PLuT35kJIui0H5kXjxNOZlHoOPZbQLr4qh",
),
);
},
buttonColor: MihColors.green(),
width: 300,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
FaIcon(
FontAwesomeIcons.youtube,
color: MihColors.primary(),
),
const SizedBox(width: 10),
Text(
"MIH Beginners Guide",
style: TextStyle(
color: MihColors.primary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
],
),
),
MihButton(
onPressed: () {
launchSocialUrl(
Uri.parse(
"https://patreon.com/MzansiInnovationHub?utm_medium=unknown&utm_source=join_link&utm_campaign=creatorshare_creator&utm_content=copyLink",
),
);
},
buttonColor: MihColors.green(),
width: 300,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
FaIcon(
FontAwesomeIcons.patreon,
color: MihColors.primary(),
),
const SizedBox(width: 10),
Text(
"Support Our Journey",
style: TextStyle(
color: MihColors.primary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
],
),
),
],
),
const SizedBox(
height: 10,
),
],
);
}
}

View file

@ -0,0 +1,97 @@
import 'package:flutter/material.dart';
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
class FounderDetails extends StatefulWidget {
const FounderDetails({super.key});
@override
State<FounderDetails> createState() => _FounderDetailsState();
}
class _FounderDetailsState extends State<FounderDetails> {
Widget founderTitle() {
String heading = "Yasien Meth (Founder & CEO)";
return Column(
children: [
Text(
heading,
textAlign: TextAlign.center,
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 25,
),
),
const SizedBox(
height: 10,
),
],
);
}
Widget founderBio() {
String bio = "";
bio += "BSc Computer Science & Information Systems\n";
bio += "(University of the Western Cape)\n";
bio +=
"6 Year of banking experience with one of the big 5 banks of South Africa.";
return Wrap(
alignment: WrapAlignment.center,
crossAxisAlignment: WrapCrossAlignment.center,
spacing: 10,
runSpacing: 10,
children: [
SizedBox(
width: 300,
child: Stack(
alignment: Alignment.center,
fit: StackFit.loose,
children: [
Padding(
padding: const EdgeInsets.only(left: 4.0),
child: CircleAvatar(
backgroundColor: MihColors.primary(),
backgroundImage: const AssetImage(
"lib/mih_package_components/assets/images/founder.jpg"),
//'https://media.licdn.com/dms/image/D4D03AQGd1-QhjtWWpA/profile-displayphoto-shrink_400_400/0/1671698053061?e=2147483647&v=beta&t=a3dJI5yxs5-KeXjj10LcNCFuC9IOfa8nNn3k_Qyr0CA'),
radius: 75,
),
),
Icon(
MihIcons.mihRing,
size: 165,
color: MihColors.secondary(),
),
],
),
),
SizedBox(
width: 400,
child: Text(
bio,
textAlign: TextAlign.center,
style: const TextStyle(
//fontWeight: FontWeight.bold,
fontSize: 17,
),
),
),
const SizedBox(
height: 10,
),
],
);
}
@override
Widget build(BuildContext context) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: [
founderTitle(),
founderBio(),
],
);
}
}

View file

@ -0,0 +1,137 @@
import 'package:flutter/material.dart';
import 'package:mzansi_innovation_hub/mih_objects/profile_link.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_profile_links.dart';
class MihSocialLinks extends StatefulWidget {
const MihSocialLinks({super.key});
@override
State<MihSocialLinks> createState() => _MihSocialLinksState();
}
class _MihSocialLinksState extends State<MihSocialLinks> {
List<ProfileLink> links = [
ProfileLink(
idprofile_links: 1,
app_id: "1234",
business_id: "",
site_name: "Youtube",
custom_name: "",
destination: "https://www.youtube.com/@MzansiInnovationHub",
order: 1,
),
ProfileLink(
idprofile_links: 1,
app_id: "1234",
business_id: "",
site_name: "TikTok",
custom_name: "",
destination: "https://www.tiktok.com/@mzansiinnovationhub",
order: 2,
),
ProfileLink(
idprofile_links: 1,
app_id: "1234",
business_id: "",
site_name: "Twitch",
custom_name: "",
destination: "https://www.twitch.tv/mzansiinnovationhub",
order: 3,
),
ProfileLink(
idprofile_links: 1,
app_id: "1234",
business_id: "",
site_name: "Threads",
custom_name: "",
destination: "https://www.threads.com/@mzansi.innovation.hub",
order: 4,
),
ProfileLink(
idprofile_links: 1,
app_id: "1234",
business_id: "",
site_name: "WhatsApp",
custom_name: "",
destination: "https://whatsapp.com/channel/0029Vax3INCIyPtMn8KgeM2F",
order: 5,
),
ProfileLink(
idprofile_links: 1,
app_id: "1234",
business_id: "",
site_name: "Instagram",
custom_name: "",
destination: "https://www.instagram.com/mzansi.innovation.hub/",
order: 6,
),
ProfileLink(
idprofile_links: 1,
app_id: "1234",
business_id: "",
site_name: "X",
custom_name: "",
destination: "https://x.com/mzansi_inno_hub",
order: 7,
),
ProfileLink(
idprofile_links: 1,
app_id: "1234",
business_id: "",
site_name: "LinkedIn",
custom_name: "",
destination: "https://www.linkedin.com/company/mzansi-innovation-hub/",
order: 8,
),
ProfileLink(
idprofile_links: 1,
app_id: "1234",
business_id: "",
site_name: "Facebook",
custom_name: "",
destination: "https://www.facebook.com/profile.php?id=61565345762136",
order: 9,
),
ProfileLink(
idprofile_links: 1,
app_id: "1234",
business_id: "",
site_name: "Reddit",
custom_name: "",
destination: "https://www.reddit.com/r/Mzani_Innovation_Hub/",
order: 10,
),
ProfileLink(
idprofile_links: 1,
app_id: "1234",
business_id: "",
site_name: "Git",
custom_name: "",
destination:
"https://git.mzansi-innovation-hub.co.za/yaso_meth/mih-project",
order: 11,
),
];
@override
Widget build(BuildContext context) {
return Column(
children: [
Text(
"Follow Our Journey",
textAlign: TextAlign.center,
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 25,
),
),
const SizedBox(
height: 10,
),
MihProfileLinks(links: links),
const SizedBox(
height: 75,
),
],
);
}
}

View file

@ -0,0 +1,101 @@
import 'package:flutter/material.dart';
class MissionAndVission extends StatefulWidget {
const MissionAndVission({super.key});
@override
State<MissionAndVission> createState() => _MissionAndVissionState();
}
class _MissionAndVissionState extends State<MissionAndVission> {
Widget ourVision() {
String heading = "Our Vision";
String vision =
"Digitizing Mzansi one process at a time. Discover essential Mzansi apps to streamline your personal and professional life. Simplify your daily tasks with our user-friendly solutions.";
return SizedBox(
width: 500,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: [
Text(
heading,
textAlign: TextAlign.center,
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 25,
),
),
const SizedBox(
height: 10,
),
Text(
vision,
textAlign: TextAlign.center,
style: const TextStyle(
//fontWeight: FontWeight.bold,
fontSize: 17,
),
),
],
),
);
}
Widget ourMission() {
String heading = "Our Mission";
String mission =
"Bridge the digital divide in Mzansi, ensuring that everyone can benefit from the power of technology. We empower lives by providing simple, elegant solutions that elevate daily experiences. With our user-friendly approach, we're making the digital world accessible to all, ensuring no one is left behind in the digital revolution.";
return SizedBox(
width: 500,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
heading,
textAlign: TextAlign.center,
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 25,
),
),
const SizedBox(
height: 10,
),
Text(
mission,
textAlign: TextAlign.center,
style: const TextStyle(
//fontWeight: FontWeight.bold,
fontSize: 17,
),
),
],
),
);
}
@override
Widget build(BuildContext context) {
return Column(
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25.0),
child: Wrap(
alignment: WrapAlignment.start,
crossAxisAlignment: WrapCrossAlignment.start,
spacing: 10,
runSpacing: 10,
children: [
ourVision(),
ourMission(),
],
),
),
const SizedBox(
height: 10,
),
],
);
}
}

View file

@ -1,18 +1,13 @@
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
import 'package:go_router/go_router.dart';
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
import 'package:mzansi_innovation_hub/main.dart';
import 'package:mzansi_innovation_hub/mih_objects/profile_link.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_profile_links.dart';
import 'package:mzansi_innovation_hub/mih_packages/about_mih/components/about_mih_heading.dart';
import 'package:mzansi_innovation_hub/mih_packages/about_mih/components/call_to_action_buttons.dart';
import 'package:mzansi_innovation_hub/mih_packages/about_mih/components/founder_details.dart';
import 'package:mzansi_innovation_hub/mih_packages/about_mih/components/mih_social_links.dart';
import 'package:mzansi_innovation_hub/mih_packages/about_mih/components/mission_and_vission.dart';
import 'package:mzansi_innovation_hub/mih_providers/about_mih_provider.dart';
import 'package:mzansi_innovation_hub/mih_services/mih_business_details_services.dart';
import 'package:mzansi_innovation_hub/mih_services/mih_install_services.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:mzansi_innovation_hub/mih_services/mih_user_services.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:redacted/redacted.dart';
import 'package:share_plus/share_plus.dart';
@ -24,199 +19,6 @@ class MihInfo extends StatefulWidget {
}
class _MihInfoState extends State<MihInfo> {
late Future<int> _futureUserCount;
late Future<int> _futureBusinessCount;
Widget founderBio() {
String bio = "";
bio += "BSc Computer Science & Information Systems\n";
bio += "(University of the Western Cape)\n";
bio +=
"6 Year of banking experience with one of the big 5 banks of South Africa.";
return Wrap(
alignment: WrapAlignment.center,
crossAxisAlignment: WrapCrossAlignment.center,
spacing: 10,
runSpacing: 10,
children: [
SizedBox(
width: 300,
child: Stack(
alignment: Alignment.center,
fit: StackFit.loose,
children: [
Padding(
padding: const EdgeInsets.only(left: 4.0),
child: CircleAvatar(
backgroundColor: MihColors.primary(),
backgroundImage: const AssetImage(
"lib/mih_package_components/assets/images/founder.jpg"),
//'https://media.licdn.com/dms/image/D4D03AQGd1-QhjtWWpA/profile-displayphoto-shrink_400_400/0/1671698053061?e=2147483647&v=beta&t=a3dJI5yxs5-KeXjj10LcNCFuC9IOfa8nNn3k_Qyr0CA'),
radius: 75,
),
),
Icon(
MihIcons.mihRing,
size: 165,
color: MihColors.secondary(),
),
],
),
),
SizedBox(
width: 400,
child: Text(
bio,
textAlign: TextAlign.center,
style: const TextStyle(
//fontWeight: FontWeight.bold,
fontSize: 17,
),
),
),
const SizedBox(
height: 10,
),
],
);
}
Widget founderTitle() {
String heading = "Yasien Meth (Founder & CEO)";
return Column(
children: [
Text(
heading,
textAlign: TextAlign.center,
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 25,
),
),
const SizedBox(
height: 10,
),
],
);
}
Widget ourVision() {
String heading = "Our Vision";
String vision =
"Digitizing Mzansi one process at a time. Discover essential Mzansi apps to streamline your personal and professional life. Simplify your daily tasks with our user-friendly solutions.";
return SizedBox(
width: 500,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: [
Text(
heading,
textAlign: TextAlign.center,
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 25,
),
),
const SizedBox(
height: 10,
),
Text(
vision,
textAlign: TextAlign.center,
style: const TextStyle(
//fontWeight: FontWeight.bold,
fontSize: 17,
),
),
],
),
);
}
Widget ourMission() {
String heading = "Our Mission";
String mission =
"Bridge the digital divide in Mzansi, ensuring that everyone can benefit from the power of technology. We empower lives by providing simple, elegant solutions that elevate daily experiences. With our user-friendly approach, we're making the digital world accessible to all, ensuring no one is left behind in the digital revolution.";
return SizedBox(
width: 500,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
heading,
textAlign: TextAlign.center,
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 25,
),
),
const SizedBox(
height: 10,
),
Text(
mission,
textAlign: TextAlign.center,
style: const TextStyle(
//fontWeight: FontWeight.bold,
fontSize: 17,
),
),
],
),
);
}
Future<void> launchSocialUrl(Uri linkUrl) async {
if (!await launchUrl(linkUrl)) {
throw Exception('Could not launch $linkUrl');
}
}
Widget getInstallButtonText() {
final isWebAndroid =
kIsWeb && (defaultTargetPlatform == TargetPlatform.android);
final isWebIos = kIsWeb && (defaultTargetPlatform == TargetPlatform.iOS);
String btnText = "";
FaIconData platformIcon;
if (isWebAndroid) {
btnText = "Install MIH";
platformIcon = FontAwesomeIcons.googlePlay;
} else if (isWebIos) {
btnText = "Install MIH";
platformIcon = FontAwesomeIcons.appStoreIos;
} else if (MzansiInnovationHub.of(context)!.theme.getPlatform() ==
"Android") {
btnText = "Update MIH";
platformIcon = FontAwesomeIcons.googlePlay;
} else if (MzansiInnovationHub.of(context)!.theme.getPlatform() == "iOS") {
btnText = "Update MIH";
platformIcon = FontAwesomeIcons.appStoreIos;
} else {
btnText = "Install MIH";
platformIcon = FontAwesomeIcons.globe;
}
return Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
FaIcon(
platformIcon,
color: MihColors.primary(),
),
const SizedBox(width: 10),
Text(
btnText,
style: TextStyle(
color: MihColors.primary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
],
);
}
void shareMIHLink(BuildContext context, String message, String link) {
String shareText = "$message: $link";
SharePlus.instance.share(
@ -224,45 +26,26 @@ class _MihInfoState extends State<MihInfo> {
);
}
Widget displayBusinessCount() {
Widget displayBusinessCount(AboutMihProvider aboutProvider) {
return Row(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
FutureBuilder<int>(
future: _futureBusinessCount,
builder: (context, snapshot) {
bool isLoading = true;
String userCount = "⚠️";
if (snapshot.connectionState == ConnectionState.waiting) {
isLoading = true;
} else if (snapshot.connectionState == ConnectionState.done &&
snapshot.hasError) {
isLoading = false;
} else if (snapshot.connectionState == ConnectionState.done &&
snapshot.hasData) {
isLoading = false;
userCount = snapshot.data.toString();
} else {
isLoading = true;
}
return SizedBox(
child: Text(
userCount,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 23,
),
),
).redacted(
context: context,
redact: isLoading,
configuration: RedactedConfiguration(
defaultBorderRadius: BorderRadius.circular(5),
redactedColor: MihColors.secondary(),
),
);
},
SizedBox(
child: Text(
"${aboutProvider.businessCount}",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 23,
),
),
).redacted(
context: context,
redact: aboutProvider.businessCount == null,
configuration: RedactedConfiguration(
defaultBorderRadius: BorderRadius.circular(5),
redactedColor: MihColors.secondary(),
),
),
const SizedBox(width: 10),
Text(
@ -277,45 +60,26 @@ class _MihInfoState extends State<MihInfo> {
);
}
Widget displayUserCount() {
Widget displayUserCount(AboutMihProvider aboutProvider) {
return Row(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
FutureBuilder<int>(
future: _futureUserCount,
builder: (context, snapshot) {
bool isLoading = true;
String userCount = "⚠️";
if (snapshot.connectionState == ConnectionState.waiting) {
isLoading = true;
} else if (snapshot.connectionState == ConnectionState.done &&
snapshot.hasError) {
isLoading = false;
} else if (snapshot.connectionState == ConnectionState.done &&
snapshot.hasData) {
isLoading = false;
userCount = snapshot.data.toString();
} else {
isLoading = true;
}
return SizedBox(
child: Text(
userCount,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 23,
),
),
).redacted(
context: context,
redact: isLoading,
configuration: RedactedConfiguration(
defaultBorderRadius: BorderRadius.circular(5),
redactedColor: MihColors.secondary(),
),
);
},
SizedBox(
child: Text(
"${aboutProvider.businessCount}",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 23,
),
),
).redacted(
context: context,
redact: aboutProvider.userCount == null,
configuration: RedactedConfiguration(
defaultBorderRadius: BorderRadius.circular(5),
redactedColor: MihColors.secondary(),
),
),
const SizedBox(width: 10),
Text(
@ -343,45 +107,7 @@ class _MihInfoState extends State<MihInfo> {
);
}
Widget aboutHeadings(AboutMihProvider aboutProvider) {
return Column(
children: [
SizedBox(
width: 165,
child: FittedBox(
child: Icon(
MihIcons.mihLogo,
color: MihColors.secondary(),
),
),
),
const SizedBox(
height: 10,
),
const Text(
"Mzansi Innovation Hub",
textAlign: TextAlign.center,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 30,
),
),
Text(
"MIH App Version: ${aboutProvider.version}",
textAlign: TextAlign.center,
style: const TextStyle(
fontWeight: FontWeight.normal,
fontSize: 15,
),
),
const SizedBox(
height: 10,
),
],
);
}
Widget communityCounter() {
Widget communityCounter(AboutMihProvider aboutProvider) {
return Column(
children: [
Wrap(
@ -390,8 +116,8 @@ class _MihInfoState extends State<MihInfo> {
spacing: 25,
runSpacing: 10,
children: [
displayUserCount(),
displayBusinessCount(),
displayUserCount(aboutProvider),
displayBusinessCount(aboutProvider),
],
),
Text(
@ -409,447 +135,18 @@ class _MihInfoState extends State<MihInfo> {
);
}
Widget callToActionsButtons() {
return Column(
children: [
Wrap(
alignment: WrapAlignment.center,
crossAxisAlignment: WrapCrossAlignment.center,
spacing: 10,
runSpacing: 10,
children: [
MihButton(
onPressed: () {
if (MzansiInnovationHub.of(context)!.theme.getPlatform() ==
"Android") {
showDialog(
context: context,
builder: (context) {
return MihPackageWindow(
fullscreen: false,
windowTitle: "Select Option",
onWindowTapClose: () {
context.pop();
},
windowBody: Column(
children: [
Text(
"Please select the platform you want to install/ Update MIH from",
style: TextStyle(
color: MihColors.secondary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
const SizedBox(height: 25),
MihButton(
onPressed: () {
launchSocialUrl(
Uri.parse(
"https://play.google.com/store/apps/details?id=za.co.mzansiinnovationhub.mih",
),
);
},
buttonColor: MihColors.green(),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
FaIcon(
FontAwesomeIcons.googlePlay,
color: MihColors.primary(),
),
const SizedBox(width: 10),
Text(
"Play Store",
style: TextStyle(
color: MihColors.primary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
],
),
),
const SizedBox(
height: 10,
),
MihButton(
onPressed: () {
launchSocialUrl(
Uri.parse(
"https://appgallery.huawei.com/app/C113315335?pkgName=za.co.mzansiinnovationhub.mih",
),
);
},
buttonColor: MihColors.green(),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.store,
color: MihColors.primary(),
),
const SizedBox(width: 10),
Text(
"App Gallery",
style: TextStyle(
color: MihColors.primary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
],
),
),
],
),
);
},
);
} else {
MihInstallServices().installMihTrigger(context);
}
},
buttonColor: MihColors.green(),
width: 300,
child: getInstallButtonText(),
),
MihButton(
onPressed: () {
launchSocialUrl(
Uri.parse(
"https://www.youtube.com/playlist?list=PLuT35kJIui0H5kXjxNOZlHoOPZbQLr4qh",
),
);
},
buttonColor: MihColors.green(),
width: 300,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
FaIcon(
FontAwesomeIcons.youtube,
color: MihColors.primary(),
),
const SizedBox(width: 10),
Text(
"MIH Beginners Guide",
style: TextStyle(
color: MihColors.primary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
],
),
),
MihButton(
onPressed: () {
launchSocialUrl(
Uri.parse(
"https://patreon.com/MzansiInnovationHub?utm_medium=unknown&utm_source=join_link&utm_campaign=creatorshare_creator&utm_content=copyLink",
),
);
},
buttonColor: MihColors.green(),
width: 300,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
FaIcon(
FontAwesomeIcons.patreon,
color: MihColors.primary(),
),
const SizedBox(width: 10),
Text(
"Support Our Journey",
style: TextStyle(
color: MihColors.primary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
],
),
),
],
),
const SizedBox(
height: 10,
),
],
);
}
Widget womenForChange() {
String heading = "MIH Stands with Women For Change SA";
String mission =
"South Africa is facing a devastating crisis of Gender-Based Violence and Femicide (GBVF), with at least 15 women murdered and 117 women reporting rape daily, often at the hands of known individuals, as highlighted by a shocking 33.8% rise in femicide in the last year, despite the existence of the National Strategic Plan on GBVF (NSP GBVF). Due to the government's lack of urgent action and funding for the NSP GBVF's implementation, organizations like Women For Change are urgently calling for the immediate declaration of GBVF as a National Disaster to mobilize resources and political will for decisive action, which must include judicial reforms (like opposing bail and implementing harsher sentences), immediate funding of the NSP GBVF and the new National Council, making the National Sex Offenders Register publicly accessible, and mandating comprehensive GBVF education and continuous public awareness campaigns.";
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 25.0),
child: SizedBox(
width: 500,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
heading,
textAlign: TextAlign.center,
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 25,
),
),
const SizedBox(
height: 10,
),
Wrap(
alignment: WrapAlignment.center,
crossAxisAlignment: WrapCrossAlignment.center,
spacing: 10,
runSpacing: 10,
children: [
MihButton(
onPressed: () {
launchSocialUrl(
Uri.parse(
"https://www.tiktok.com/@womenforchange.sa",
),
);
},
buttonColor: MihColors.green(),
width: 300,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
FaIcon(
FontAwesomeIcons.tiktok,
color: MihColors.primary(),
),
const SizedBox(width: 10),
Text(
"@womenforchange.sa",
style: TextStyle(
color: MihColors.primary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
],
),
),
MihButton(
onPressed: () {
launchSocialUrl(
Uri.parse(
"https://www.change.org/p/declare-gbvf-a-national-disaster-in-south-africa",
),
);
},
buttonColor: MihColors.green(),
width: 300,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.edit,
color: MihColors.primary(),
),
const SizedBox(width: 10),
Text(
"Sign Petition",
style: TextStyle(
color: MihColors.primary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
],
),
),
],
),
const SizedBox(
height: 10,
),
Text(
mission,
textAlign: TextAlign.center,
style: const TextStyle(
//fontWeight: FontWeight.bold,
fontSize: 17,
),
),
],
),
),
);
}
Widget missionAndVission() {
return Column(
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25.0),
child: Wrap(
alignment: WrapAlignment.start,
crossAxisAlignment: WrapCrossAlignment.start,
spacing: 10,
runSpacing: 10,
children: [
ourVision(),
ourMission(),
],
),
),
const SizedBox(
height: 10,
),
],
);
}
Widget founderDetails() {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: [
founderTitle(),
founderBio(),
],
);
}
Widget mihSocials() {
List<ProfileLink> links = [
ProfileLink(
idprofile_links: 1,
app_id: "1234",
business_id: "",
site_name: "Youtube",
custom_name: "",
destination: "https://www.youtube.com/@MzansiInnovationHub",
order: 1,
),
ProfileLink(
idprofile_links: 1,
app_id: "1234",
business_id: "",
site_name: "TikTok",
custom_name: "",
destination: "https://www.tiktok.com/@mzansiinnovationhub",
order: 2,
),
ProfileLink(
idprofile_links: 1,
app_id: "1234",
business_id: "",
site_name: "Twitch",
custom_name: "",
destination: "https://www.twitch.tv/mzansiinnovationhub",
order: 3,
),
ProfileLink(
idprofile_links: 1,
app_id: "1234",
business_id: "",
site_name: "Threads",
custom_name: "",
destination: "https://www.threads.com/@mzansi.innovation.hub",
order: 4,
),
ProfileLink(
idprofile_links: 1,
app_id: "1234",
business_id: "",
site_name: "WhatsApp",
custom_name: "",
destination: "https://whatsapp.com/channel/0029Vax3INCIyPtMn8KgeM2F",
order: 5,
),
ProfileLink(
idprofile_links: 1,
app_id: "1234",
business_id: "",
site_name: "Instagram",
custom_name: "",
destination: "https://www.instagram.com/mzansi.innovation.hub/",
order: 6,
),
ProfileLink(
idprofile_links: 1,
app_id: "1234",
business_id: "",
site_name: "X",
custom_name: "",
destination: "https://x.com/mzansi_inno_hub",
order: 7,
),
ProfileLink(
idprofile_links: 1,
app_id: "1234",
business_id: "",
site_name: "LinkedIn",
custom_name: "",
destination: "https://www.linkedin.com/company/mzansi-innovation-hub/",
order: 8,
),
ProfileLink(
idprofile_links: 1,
app_id: "1234",
business_id: "",
site_name: "Facebook",
custom_name: "",
destination: "https://www.facebook.com/profile.php?id=61565345762136",
order: 9,
),
ProfileLink(
idprofile_links: 1,
app_id: "1234",
business_id: "",
site_name: "Reddit",
custom_name: "",
destination: "https://www.reddit.com/r/Mzani_Innovation_Hub/",
order: 10,
),
ProfileLink(
idprofile_links: 1,
app_id: "1234",
business_id: "",
site_name: "Git",
custom_name: "",
destination:
"https://git.mzansi-innovation-hub.co.za/yaso_meth/mih-project",
order: 11,
),
];
return Column(
children: [
Text(
"Follow Our Journey",
textAlign: TextAlign.center,
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 25,
),
),
const SizedBox(
height: 10,
),
MihProfileLinks(links: links),
const SizedBox(
height: 75,
),
],
);
Future<void> _syncUserBizCountData() async {
AboutMihProvider aboutProvider = context.read<AboutMihProvider>();
aboutProvider.loadCachedAboutMihSate();
await aboutProvider.syncWithMihServerData();
}
@override
void initState() {
super.initState();
_futureUserCount = MihUserServices().fetchUserCount();
_futureBusinessCount = MihBusinessDetailsServices().fetchBusinessCount();
WidgetsBinding.instance.addPostFrameCallback((_) {
_syncUserBizCountData();
});
}
@override
@ -874,17 +171,15 @@ class _MihInfoState extends State<MihInfo> {
scrollbarOn: true,
child: Column(
children: [
aboutHeadings(aboutProvider),
communityCounter(),
callToActionsButtons(),
// mihDivider(),
// womenForChange(),
AboutMihHeading(),
communityCounter(aboutProvider),
CallToActionButtons(),
mihDivider(),
missionAndVission(),
MissionAndVission(),
mihDivider(),
founderDetails(),
FounderDetails(),
mihDivider(),
mihSocials(),
MihSocialLinks(),
],
),
),

View file

@ -2,11 +2,13 @@ import 'package:mih_package_toolkit/mih_package_toolkit.dart';
import 'package:mzansi_innovation_hub/mih_objects/user_consent.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_circle_avatar.dart';
import 'package:mzansi_innovation_hub/mih_packages/mih_home/components/mih_user_consent_window.dart';
import 'package:mzansi_innovation_hub/mih_providers/about_mih_provider.dart';
import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart';
import 'package:mzansi_innovation_hub/mih_packages/mih_home/components/mih_app_drawer.dart';
import 'package:mzansi_innovation_hub/mih_packages/mih_home/package_tools/mih_business_home.dart';
import 'package:mzansi_innovation_hub/mih_packages/mih_home/package_tools/mih_personal_home.dart';
import 'package:flutter/material.dart';
import 'package:mzansi_innovation_hub/mih_providers/mzansi_wallet_provider.dart';
import 'package:provider/provider.dart';
class MihHome extends StatefulWidget {
@ -88,8 +90,14 @@ class _MihHomeState extends State<MihHome> {
RefreshIndicator(
key: mzansiProfileProvider.refreshIndicatorKey,
onRefresh: () async {
bool success =
await mzansiProfileProvider.syncWithMihServerData();
MzansiWalletProvider walletProvider =
context.read<MzansiWalletProvider>();
AboutMihProvider aboutProvider =
context.read<AboutMihProvider>();
await mzansiProfileProvider.syncWithMihServerData();
await walletProvider
.syncWithMihServerData(mzansiProfileProvider);
bool success = await aboutProvider.syncWithMihServerData();
if (context.mounted) {
ScaffoldMessenger.of(context).showSnackBar(
MihSnackBar(

View file

@ -1,6 +1,8 @@
import 'package:flutter/material.dart';
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
import 'package:mzansi_innovation_hub/mih_providers/about_mih_provider.dart';
import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart';
import 'package:mzansi_innovation_hub/mih_providers/mzansi_wallet_provider.dart';
import 'package:provider/provider.dart';
class MihHomeRefreshTile extends StatefulWidget {
@ -17,35 +19,34 @@ class MihHomeRefreshTile extends StatefulWidget {
class _MihHomeRefreshTileState extends State<MihHomeRefreshTile> {
@override
Widget build(BuildContext context) {
return Consumer<MzansiProfileProvider>(
builder: (BuildContext context, MzansiProfileProvider profileProvider,
Widget? child) {
return MihPackageTile(
onTap: profileProvider.triggerRefresh,
packageName: "Sync Data",
packageIcon: Stack(
alignment: Alignment.center,
children: [
Icon(
MihIcons.mihRing,
return MihPackageTile(
onTap: () async {
MzansiProfileProvider profileProvider =
context.read<MzansiProfileProvider>();
profileProvider.triggerRefresh();
},
packageName: "Sync Data",
packageIcon: Stack(
alignment: Alignment.center,
children: [
Icon(
MihIcons.mihRing,
color: MihColors.secondary(),
),
Center(
child: Transform.scale(
scale: 0.75,
origin: Offset(-4, 0),
child: Icon(
Icons.cloud_sync_rounded,
color: MihColors.secondary(),
),
Center(
child: Transform.scale(
scale: 0.75,
origin: Offset(-4, 0),
child: Icon(
Icons.cloud_sync_rounded,
color: MihColors.secondary(),
),
),
),
],
),
),
iconSize: widget.packageSize,
textColor: MihColors.secondary(),
);
},
],
),
iconSize: widget.packageSize,
textColor: MihColors.secondary(),
);
}
}

View file

@ -4,7 +4,6 @@ import 'package:mzansi_innovation_hub/mih_providers/mzansi_ai_provider.dart';
import 'package:flutter/material.dart';
import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart';
import 'package:mzansi_innovation_hub/mih_packages/mzansi_ai/package_tools/mih_ai_chat.dart';
import 'package:mzansi_innovation_hub/mih_services/mih_data_helper_services.dart';
import 'package:provider/provider.dart';
class MzansiAi extends StatefulWidget {
@ -17,37 +16,36 @@ class MzansiAi extends StatefulWidget {
}
class _MzansiAiState extends State<MzansiAi> {
bool _isLoadingInitialData = true;
late final MihAiChat _aiChat;
Future<void> _loadInitialData() async {
setState(() {
_isLoadingInitialData = true;
});
Future<void> _syncProfileData() async {
MzansiProfileProvider mzansiProfileProvider =
context.read<MzansiProfileProvider>();
mzansiProfileProvider.loadCachedProfileState();
if (mzansiProfileProvider.user == null) {
await MihDataHelperServices().loadUserDataWithBusinessesData(
mzansiProfileProvider,
);
await mzansiProfileProvider.syncWithMihServerData();
} else {
await mzansiProfileProvider.syncWithMihServerData();
}
setState(() {
_isLoadingInitialData = false;
});
}
@override
void initState() {
super.initState();
_aiChat = MihAiChat();
_loadInitialData();
_syncProfileData();
}
@override
Widget build(BuildContext context) {
return Consumer<MzansiAiProvider>(
builder: (BuildContext context, MzansiAiProvider value, Widget? child) {
if (_isLoadingInitialData) {
return Consumer2<MzansiAiProvider, MzansiProfileProvider>(
builder: (
BuildContext context,
MzansiAiProvider aiProvider,
MzansiProfileProvider profileProvider,
Widget? child,
) {
if (profileProvider.user == null) {
return Scaffold(
body: Center(
child: Mihloadingcircle(),

View file

@ -5,8 +5,6 @@ import 'package:mzansi_innovation_hub/mih_providers/mzansi_wallet_provider.dart'
import 'package:flutter/material.dart';
import 'package:mzansi_innovation_hub/mih_packages/mzansi_wallet/package_tools/mih_card_favourites.dart';
import 'package:mzansi_innovation_hub/mih_packages/mzansi_wallet/package_tools/mih_cards.dart';
import 'package:mzansi_innovation_hub/mih_services/mih_data_helper_services.dart';
import 'package:mzansi_innovation_hub/mih_services/mih_mzansi_wallet_services.dart';
import 'package:provider/provider.dart';
class MihWallet extends StatefulWidget {

View file

@ -1,13 +1,34 @@
import 'package:flutter/foundation.dart';
import 'package:ken_logger/ken_logger.dart';
import 'package:mzansi_innovation_hub/mih_hive/about_mih_hive_data.dart';
class AboutMihProvider extends ChangeNotifier {
int toolIndex;
String version = "1.3.0";
final AboutMihHiveData _hiveData;
AboutMihProvider({
int toolIndex;
String version = "1.4.0";
int? userCount;
int? businessCount;
AboutMihProvider(
this._hiveData, {
this.toolIndex = 0,
});
void loadCachedAboutMihSate() {
userCount = _hiveData.getcachedUserCount();
businessCount = _hiveData.getcachedBusinessCount();
KenLogger.success("About Mih Data Loaded from Cache");
notifyListeners();
}
Future<bool> syncWithMihServerData() async {
bool success = await _hiveData.syncAboutMihDataWithServer();
loadCachedAboutMihSate();
return success;
}
void reset() {
toolIndex = 0;
notifyListeners();