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

@ -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,
),
],
);
}
}