From 8ca8ac5aa96f09fbf76a125fdb8827af25d924a6 Mon Sep 17 00:00:00 2001 From: Yasien Mac Mini Date: Wed, 9 Apr 2025 10:31:00 +0200 Subject: [PATCH] add App Store link for iOS users --- .../about_mih/package_tools/mih_info.dart | 310 +++++++++--------- 1 file changed, 160 insertions(+), 150 deletions(-) diff --git a/Frontend/lib/mih_packages/about_mih/package_tools/mih_info.dart b/Frontend/lib/mih_packages/about_mih/package_tools/mih_info.dart index 6442c9e2..5fd30006 100644 --- a/Frontend/lib/mih_packages/about_mih/package_tools/mih_info.dart +++ b/Frontend/lib/mih_packages/about_mih/package_tools/mih_info.dart @@ -3,7 +3,6 @@ import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_ import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_single_child_scroll.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_tile.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih-app_tool_body.dart'; -import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_app_window.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; @@ -50,7 +49,12 @@ class _MihInfoState extends State { ); } else if (isWebIos) { //Show pop up for IOS - _showIOSInstallationGuide(); + // _showIOSInstallationGuide(); + launchSocialUrl( + Uri.parse( + "https://apps.apple.com/za/app/mzansi-innovation-hub/id6743310890", + ), + ); } else if (MzanziInnovationHub.of(context)!.theme.getPlatform() == "Android") { //Installed Android App @@ -60,160 +64,166 @@ class _MihInfoState extends State { "https://play.google.com/store/apps/details?id=za.co.mzansiinnovationhub.mih", ), ); + } else if (MzanziInnovationHub.of(context)!.theme.getPlatform() == "iOS") { + launchSocialUrl( + Uri.parse( + "https://apps.apple.com/za/app/mzansi-innovation-hub/id6743310890", + ), + ); } else { //Web js.context.callMethod("presentAddToHome"); } } - void _showIOSInstallationGuide() { - double windowFontSize = 17.0; - showDialog( - context: context, - barrierDismissible: false, - builder: (context) { - return MihAppWindow( - fullscreen: false, - windowTitle: "MIH Installation Guide (iOS)", - windowTools: const [], - onWindowTapClose: () { - Navigator.of(context).pop(); - }, - windowBody: [ - Align( - alignment: Alignment.centerLeft, - child: Text( - "In order to install MIH on your iPhone, please follow the below steps:- ", - textAlign: TextAlign.left, - style: TextStyle( - color: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - fontSize: windowFontSize, - fontWeight: FontWeight.bold, - ), - ), - ), - const SizedBox(height: 10), - Align( - alignment: Alignment.centerLeft, - child: Text( - "1. Launch MIH on Safari.", - textAlign: TextAlign.left, - style: TextStyle( - color: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - fontSize: windowFontSize, - fontWeight: FontWeight.bold, - ), - ), - ), - const SizedBox(height: 10), - Align( - alignment: Alignment.centerLeft, - child: Text( - "2. Tap the Share Button.", - textAlign: TextAlign.left, - style: TextStyle( - color: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - fontSize: windowFontSize, - fontWeight: FontWeight.bold, - ), - ), - ), - const SizedBox(height: 10), - Align( - alignment: Alignment.centerLeft, - child: Text( - "3. Scroll down and tap \"Add to Home Screen\".", - textAlign: TextAlign.left, - style: TextStyle( - color: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - fontSize: windowFontSize, - fontWeight: FontWeight.bold, - ), - ), - ), - const SizedBox(height: 10), - Align( - alignment: Alignment.centerLeft, - child: Text( - "4. Choose a name for the shortcut (Optional).", - textAlign: TextAlign.left, - style: TextStyle( - color: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - fontSize: windowFontSize, - fontWeight: FontWeight.bold, - ), - ), - ), - const SizedBox(height: 10), - Align( - alignment: Alignment.centerLeft, - child: Text( - "5. Tap \"Add\".", - textAlign: TextAlign.left, - style: TextStyle( - color: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - fontSize: windowFontSize, - fontWeight: FontWeight.bold, - ), - ), - ), - const SizedBox(height: 10), - Align( - alignment: Alignment.centerLeft, - child: Text( - "That's it! Now you can tap the MIH icon on your home screen to open it quickly.", - textAlign: TextAlign.left, - style: TextStyle( - color: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - fontSize: windowFontSize, - fontWeight: FontWeight.bold, - ), - ), - ), - const SizedBox(height: 10), - Align( - alignment: Alignment.centerLeft, - child: Text( - "If you are still having trouble, please click on the button below to view a video guide.", - textAlign: TextAlign.left, - style: TextStyle( - color: MzanziInnovationHub.of(context)!.theme.errorColor(), - fontSize: windowFontSize, - fontWeight: FontWeight.bold, - ), - ), - ), - const SizedBox(height: 15), - SizedBox( - width: 300, - height: 50, - child: MIHButton( - onTap: () { - launchSocialUrl( - Uri.parse( - "https://www.youtube.com/watch?v=KVK78IV28JY", - ), - ); - }, - buttonText: "Video Guide", - buttonColor: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - textColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), - ), - ), - ], - ); - }, - ); - } + // void _showIOSInstallationGuide() { + // double windowFontSize = 17.0; + // showDialog( + // context: context, + // barrierDismissible: false, + // builder: (context) { + // return MihAppWindow( + // fullscreen: false, + // windowTitle: "MIH Installation Guide (iOS)", + // windowTools: const [], + // onWindowTapClose: () { + // Navigator.of(context).pop(); + // }, + // windowBody: [ + // Align( + // alignment: Alignment.centerLeft, + // child: Text( + // "In order to install MIH on your iPhone, please follow the below steps:- ", + // textAlign: TextAlign.left, + // style: TextStyle( + // color: + // MzanziInnovationHub.of(context)!.theme.secondaryColor(), + // fontSize: windowFontSize, + // fontWeight: FontWeight.bold, + // ), + // ), + // ), + // const SizedBox(height: 10), + // Align( + // alignment: Alignment.centerLeft, + // child: Text( + // "1. Launch MIH on Safari.", + // textAlign: TextAlign.left, + // style: TextStyle( + // color: + // MzanziInnovationHub.of(context)!.theme.secondaryColor(), + // fontSize: windowFontSize, + // fontWeight: FontWeight.bold, + // ), + // ), + // ), + // const SizedBox(height: 10), + // Align( + // alignment: Alignment.centerLeft, + // child: Text( + // "2. Tap the Share Button.", + // textAlign: TextAlign.left, + // style: TextStyle( + // color: + // MzanziInnovationHub.of(context)!.theme.secondaryColor(), + // fontSize: windowFontSize, + // fontWeight: FontWeight.bold, + // ), + // ), + // ), + // const SizedBox(height: 10), + // Align( + // alignment: Alignment.centerLeft, + // child: Text( + // "3. Scroll down and tap \"Add to Home Screen\".", + // textAlign: TextAlign.left, + // style: TextStyle( + // color: + // MzanziInnovationHub.of(context)!.theme.secondaryColor(), + // fontSize: windowFontSize, + // fontWeight: FontWeight.bold, + // ), + // ), + // ), + // const SizedBox(height: 10), + // Align( + // alignment: Alignment.centerLeft, + // child: Text( + // "4. Choose a name for the shortcut (Optional).", + // textAlign: TextAlign.left, + // style: TextStyle( + // color: + // MzanziInnovationHub.of(context)!.theme.secondaryColor(), + // fontSize: windowFontSize, + // fontWeight: FontWeight.bold, + // ), + // ), + // ), + // const SizedBox(height: 10), + // Align( + // alignment: Alignment.centerLeft, + // child: Text( + // "5. Tap \"Add\".", + // textAlign: TextAlign.left, + // style: TextStyle( + // color: + // MzanziInnovationHub.of(context)!.theme.secondaryColor(), + // fontSize: windowFontSize, + // fontWeight: FontWeight.bold, + // ), + // ), + // ), + // const SizedBox(height: 10), + // Align( + // alignment: Alignment.centerLeft, + // child: Text( + // "That's it! Now you can tap the MIH icon on your home screen to open it quickly.", + // textAlign: TextAlign.left, + // style: TextStyle( + // color: + // MzanziInnovationHub.of(context)!.theme.secondaryColor(), + // fontSize: windowFontSize, + // fontWeight: FontWeight.bold, + // ), + // ), + // ), + // const SizedBox(height: 10), + // Align( + // alignment: Alignment.centerLeft, + // child: Text( + // "If you are still having trouble, please click on the button below to view a video guide.", + // textAlign: TextAlign.left, + // style: TextStyle( + // color: MzanziInnovationHub.of(context)!.theme.errorColor(), + // fontSize: windowFontSize, + // fontWeight: FontWeight.bold, + // ), + // ), + // ), + // const SizedBox(height: 15), + // SizedBox( + // width: 300, + // height: 50, + // child: MIHButton( + // onTap: () { + // launchSocialUrl( + // Uri.parse( + // "https://www.youtube.com/watch?v=KVK78IV28JY", + // ), + // ); + // }, + // buttonText: "Video Guide", + // buttonColor: + // MzanziInnovationHub.of(context)!.theme.secondaryColor(), + // textColor: + // MzanziInnovationHub.of(context)!.theme.primaryColor(), + // ), + // ), + // ], + // ); + // }, + // ); + // } Widget founderBio() { String bio = "";