From f7a802ee5d8d28be0d505289abeb95ff613a1cbb Mon Sep 17 00:00:00 2001 From: Yasien Mac Mini Date: Thu, 7 Aug 2025 14:09:08 +0200 Subject: [PATCH] Update button Text --- .../about_mih/package_tools/mih_info.dart | 92 ++++++++++++------- 1 file changed, 60 insertions(+), 32 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 d693b230..c2014619 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 @@ -419,23 +419,47 @@ class _MihInfoState extends State { } } - String getInstallButtonText() { + Widget getInstallButtonText() { final isWebAndroid = kIsWeb && (defaultTargetPlatform == TargetPlatform.android); final isWebIos = kIsWeb && (defaultTargetPlatform == TargetPlatform.iOS); - + String btnText = ""; + IconData platformIcon; if (isWebAndroid) { - return "Install MIH (Play Store)"; + btnText = "Install MIH"; + platformIcon = FontAwesomeIcons.googlePlay; } else if (isWebIos) { - return "Install MIH (PWA)"; + btnText = "Install MIH"; + platformIcon = FontAwesomeIcons.appStoreIos; } else if (MzansiInnovationHub.of(context)!.theme.getPlatform() == "Android") { - return "Update MIH (Play Store)"; + btnText = "Update MIH"; + platformIcon = FontAwesomeIcons.googlePlay; } else if (MzansiInnovationHub.of(context)!.theme.getPlatform() == "iOS") { - return "Update MIH (App Store)"; + btnText = "Update MIH"; + platformIcon = FontAwesomeIcons.appStoreIos; } else { - return "Install MIH (PWA)"; + btnText = "Install MIH"; + platformIcon = FontAwesomeIcons.globe; } + return Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + FaIcon( + platformIcon, + color: MzansiInnovationHub.of(context)!.theme.primaryColor(), + ), + const SizedBox(width: 10), + Text( + btnText, + style: TextStyle( + color: MzansiInnovationHub.of(context)!.theme.primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + ], + ); } void shareMIHLink(BuildContext context, String message, String link) { @@ -520,16 +544,7 @@ class _MihInfoState extends State { buttonColor: MzansiInnovationHub.of(context)!.theme.successColor(), width: 300, - child: Text( - getInstallButtonText(), - style: TextStyle( - color: MzansiInnovationHub.of(context)! - .theme - .primaryColor(), - fontSize: 20, - fontWeight: FontWeight.bold, - ), - ), + child: getInstallButtonText(), ), MihButton( onPressed: () { @@ -542,15 +557,27 @@ class _MihInfoState extends State { buttonColor: MzansiInnovationHub.of(context)!.theme.successColor(), width: 300, - child: Text( - "MIH Beginners Guide", - style: TextStyle( - color: MzansiInnovationHub.of(context)! - .theme - .primaryColor(), - fontSize: 20, - fontWeight: FontWeight.bold, - ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + FaIcon( + FontAwesomeIcons.youtube, + color: MzansiInnovationHub.of(context)! + .theme + .primaryColor(), + ), + const SizedBox(width: 10), + Text( + "MIH Beginners Guide", + style: TextStyle( + color: MzansiInnovationHub.of(context)! + .theme + .primaryColor(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + ], ), ), MihButton( @@ -567,12 +594,13 @@ class _MihInfoState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - // FaIcon( - // FontAwesomeIcons.patreon, - // color: MzansiInnovationHub.of(context)! - // .theme - // .primaryColor(), - // ), + FaIcon( + FontAwesomeIcons.patreon, + color: MzansiInnovationHub.of(context)! + .theme + .primaryColor(), + ), + const SizedBox(width: 10), Text( "Support Our Journey", style: TextStyle(