16 Commits

Author SHA1 Message Date
fd4c34c59d Merge pull request 'linux flatpak config pt5' (#25) from V.1.2.6 into main
Reviewed-on: #25
2026-02-25 13:50:19 +00:00
5e003a4d71 linux flatpak config pt5 2026-02-25 15:50:02 +02:00
dca595bf60 Merge pull request 'linux flatpak config pt4' (#24) from V.1.2.6 into main
Reviewed-on: #24
2026-02-25 13:44:37 +00:00
fcf1bbbb15 linux flatpak config pt4 2026-02-25 15:44:10 +02:00
8a0c0d7dba Merge pull request 'linux flatpak config pt3' (#23) from V.1.2.6 into main
Reviewed-on: #23
2026-02-25 13:36:22 +00:00
ff7f363983 linux flatpak config pt3 2026-02-25 15:35:45 +02:00
a54f1c61ae Merge pull request 'linux flatpak config pt2' (#22) from V.1.2.6 into main
Reviewed-on: #22
2026-02-25 13:10:05 +00:00
843997e58c linux flatpak config pt2 2026-02-25 15:09:23 +02:00
cbe70e2e44 Merge pull request 'linux flatpak config' (#21) from V.1.2.6 into main
Reviewed-on: #21
2026-02-25 12:52:15 +00:00
3778ebb261 linux flatpak config 2026-02-25 14:51:15 +02:00
c911e88453 Merge pull request 'linux name change' (#20) from V.1.2.6 into main
Reviewed-on: #20
2026-02-25 11:59:39 +00:00
b1487839a7 linux name change 2026-02-25 13:58:42 +02:00
518dd1300e Merge pull request 'fix platform specific code not working on web pt2' (#19) from V.1.2.6 into main
Reviewed-on: #19
2026-02-25 10:19:05 +00:00
221030eff3 fix platform specific code not working on web pt2 2026-02-25 12:16:53 +02:00
707b49c088 Merge pull request 'fix platform specific code not working on web' (#18) from V.1.2.6 into main
Reviewed-on: #18
2026-02-25 10:05:42 +00:00
5135629b33 fix platform specific code not working on web 2026-02-25 12:05:07 +02:00
17 changed files with 125 additions and 16 deletions

View File

@@ -20,7 +20,15 @@ abstract class AppEnviroment {
switch (env) {
case Enviroment.dev:
{
if (kIsWeb || Platform.isIOS || Platform.isLinux) {
if (kIsWeb) {
//================= Web Dev Urls =================
baseAppUrl = "http://localhost:80";
baseApiUrl = "http://localhost:8080";
baseFileUrl = "http://localhost:9000";
baseAiUrl = "http://localhost:11434";
bannerAdUnitId = 'ca-app-pub-3940256099942544/2435281174'; // IOS ID
break;
} else if (Platform.isIOS || Platform.isLinux) {
//================= Web Dev Urls =================
baseAppUrl = "http://localhost:80";
baseApiUrl = "http://localhost:8080";

View File

@@ -2,6 +2,7 @@ import 'dart:io';
import 'package:country_code_picker/country_code_picker.dart';
import 'package:file_picker/file_picker.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
import 'package:geolocator/geolocator.dart';
@@ -453,7 +454,8 @@ class _PackageToolOneState extends State<PackageToolOne> {
),
],
),
if (Platform.isAndroid || Platform.isIOS) MihBannerAd(),
if (!kIsWeb && (Platform.isAndroid || Platform.isIOS))
MihBannerAd(),
const SizedBox(height: 10),
Divider(
color: MihColors.getSecondaryColor(

View File

@@ -1,5 +1,6 @@
import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
import 'package:go_router/go_router.dart';
import 'package:ken_logger/ken_logger.dart';
@@ -101,7 +102,7 @@ class _MihPackageState extends State<MihPackage>
// _peakAnimation();
// });
// }
if (Platform.isAndroid || Platform.isIOS) {
if (!kIsWeb && (Platform.isAndroid || Platform.isIOS)) {
// Trigger the peak animation only AFTER the route transition is complete
WidgetsBinding.instance.addPostFrameCallback((_) {
final ModalRoute? currentRoute = ModalRoute.of(context);

View File

@@ -1,5 +1,6 @@
import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:mzansi_innovation_hub/main.dart';
@@ -159,7 +160,7 @@ class _CurrencyExchangeRateState extends State<CurrencyExchangeRate> {
),
SizedBox(height: 10),
Consumer(builder: (context, bannerAdDisplay, child) {
if (Platform.isAndroid || Platform.isIOS) {
if (!kIsWeb && (Platform.isAndroid || Platform.isIOS)) {
return MihBannerAd();
} else {
return const SizedBox(height: 0);

View File

@@ -1,5 +1,6 @@
import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:mzansi_innovation_hub/main.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_banner_ad.dart';
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
@@ -231,7 +232,7 @@ class _TipCalcState extends State<TipCalc> {
),
SizedBox(height: 10),
Consumer(builder: (context, bannerAdDisplay, child) {
if (Platform.isAndroid || Platform.isIOS) {
if (!kIsWeb && (Platform.isAndroid || Platform.isIOS)) {
return MihBannerAd();
} else {
return const SizedBox(height: 0);

View File

@@ -1,6 +1,7 @@
import 'dart:async';
import 'dart:io';
import 'dart:math';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
@@ -852,7 +853,7 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
],
),
),
_timer != null && (Platform.isAndroid || Platform.isIOS)
_timer != null && !kIsWeb && (Platform.isAndroid || Platform.isIOS)
? MihBannerAd()
: SizedBox(),
SizedBox(height: 15),

View File

@@ -129,7 +129,7 @@ class _MihAiChatState extends State<MihAiChat> with WidgetsBindingObserver {
}
if (textToSpeak != null) {
if (Platform.isLinux) {
if (!kIsWeb && Platform.isLinux) {
// Linux Workaround: Use Speech Dispatcher (standard on most distros)
// '-t female1' is optional for voice variety
Process.run('spd-say', [textToSpeak]);
@@ -204,7 +204,7 @@ class _MihAiChatState extends State<MihAiChat> with WidgetsBindingObserver {
// }
void stopTTS(MzansiAiProvider aiProvider) {
if (Platform.isLinux) {
if (!kIsWeb && Platform.isLinux) {
Process.run('spd-say', ['-S']); // The -S flag stops current speech
} else {
_flutterTts.stop();
@@ -213,7 +213,7 @@ class _MihAiChatState extends State<MihAiChat> with WidgetsBindingObserver {
}
Future<void> initTts(MzansiAiProvider aiProvider) async {
if (Platform.isLinux) return;
if (!kIsWeb && Platform.isLinux) return;
try {
await _flutterTts.setSpeechRate(!kIsWeb ? 0.55 : 1);
// await _flutterTts.setLanguage("en-US");
@@ -284,7 +284,7 @@ class _MihAiChatState extends State<MihAiChat> with WidgetsBindingObserver {
@override
void dispose() {
if (!Platform.isLinux) {
if (!kIsWeb && !Platform.isLinux) {
_flutterTts.stop();
}
WidgetsBinding.instance.removeObserver(this);

View File

@@ -547,7 +547,7 @@ class _BuildLoyaltyCardListState extends State<BuildLoyaltyCardList> {
),
),
SizedBox(height: 10),
if (Platform.isAndroid || Platform.isIOS) MihBannerAd()
if (!kIsWeb && (Platform.isAndroid || Platform.isIOS)) MihBannerAd()
// MihBannerAd(),
],
),

View File

@@ -30,7 +30,7 @@ class MihBannerAdProvider extends ChangeNotifier {
}
void loadBannerAd() {
if (Platform.isAndroid || Platform.isIOS) {
if (!kIsWeb && (Platform.isAndroid || Platform.isIOS)) {
if (bannerAd != null) {
bannerAd!.dispose();
bannerAd = null;

View File

@@ -1,5 +1,6 @@
import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:mzansi_innovation_hub/main.dart';
@@ -136,7 +137,7 @@ class MihAlertServices {
),
const SizedBox(height: 15),
Text(
Platform.isLinux
!kIsWeb && Platform.isLinux
? "To get the most out of MIH, we need your location. Please go to your System Settings and enable location services. Once you do that, we can start showing you relevant information based on your location."
: "To get the most out of MIH, we need your location. Please go to the site settings of the app and enable location services. Once you do that, we can start showing you relevant information based on your location.",
style: TextStyle(

View File

@@ -1,5 +1,6 @@
import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart';
import 'package:mzansi_innovation_hub/mih_services/mih_alert_services.dart';
@@ -16,7 +17,7 @@ class MIHLocationAPI {
///if user has granted permission (while in use), function will return Position object.
Future<Position?> getGPSPosition(BuildContext context) async {
bool serviceEnabled = await Geolocator.isLocationServiceEnabled();
if (!serviceEnabled && Platform.isLinux) {
if (!serviceEnabled && !kIsWeb && Platform.isLinux) {
// Direct the user to their System Settings
MihAlertServices().locationPermissionAlert(context);
return null;

View File

@@ -4,10 +4,10 @@ project(runner LANGUAGES CXX)
# The name of the executable created for the application. Change this to change
# the on-disk name of your application.
set(BINARY_NAME "patient_manager")
set(BINARY_NAME "mzansi_innovation_hub")
# The unique GTK application identifier for this application. See:
# https://wiki.gnome.org/HowDoI/ChooseApplicationID
set(APPLICATION_ID "com.example.patient_manager")
set(APPLICATION_ID "za.co.mzansiinnovationhub.mih")
# Explicitly opt in to modern CMake behaviors to avoid warnings with recent
# versions of CMake.

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB

View File

@@ -0,0 +1,11 @@
[Desktop Entry]
Version=1.2.6
Type=Application
Name=MIH App
Comment=First Super App of Mzansi
Exec=mzansi_innovation_hub
Icon=za.co.mzansiinnovationhub.mih
Terminal=false
Categories=Utility;
Keywords=Mzansi;Innovation;Hub;App;
StartupWMClass=mzansi_innovation_hub

View File

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>za.co.mzansiinnovationhub.mih</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0</project_license>
<name>MIH App</name>
<summary>First Super App of Mzansi</summary>
<developer_name>Mzansi Innovation Hub</developer_name>
<description>
<p>
The Mzansi Innovation Hub (MIH) App is a multipurpose platform designed to
empower users with integrated digital services.
</p>
</description>
<launchable type="desktop-id">za.co.mzansiinnovationhub.mih.desktop</launchable>
<screenshots>
<screenshot type="default">
<caption>The main dashboard of the MIH App</caption>
<image>https://git.mzansi-innovation-hub.co.za/yaso_meth/mih-project/raw/branch/main/mih_ui/mih_app_flatpak/main.png</image>
</screenshot>
</screenshots>
<url type="homepage">https://mzansi-innovation-hub.co.za</url>
<url type="bugtracker">https://git.mzansi-innovation-hub.co.za/yaso_meth/mih-project/issues</url>
<content_rating type="oars-1.1" />
<releases>
<release version="1.2.6" date="2026-02-25" />
</releases>
</component>

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -0,0 +1,46 @@
app-id: za.co.mzansiinnovationhub.mih
runtime: org.gnome.Platform
runtime-version: '49' # Matches a more modern GNOME stack
sdk: org.gnome.Sdk
command: mzansi_innovation_hub
finish-args:
- --share=ipc
- --socket=fallback-x11
- --socket=wayland
- --device=dri
- --socket=pulseaudio
- --share=network
- --talk-name=org.freedesktop.Notifications
# Filesystem access for documents
- --filesystem=xdg-documents:ro
modules:
- name: mih-app
buildsystem: simple
build-commands:
# Create directory structure
- mkdir -p /app/bin /app/share/mih-app /app/share/applications /app/share/metainfo /app/share/icons/hicolor/256x256/apps
# Install everything to the share folder
- cp -r * /app/share/mih-app/
- find /app/share/mih-app -name "mzansi_innovation_hub" -exec chmod +x {} +
# Link the binary to /app/bin so Flatpak can find it
- ln -s /app/share/mih-app/mzansi_innovation_hub /app/bin/mzansi_innovation_hub
# Install Integration Files
- install -Dm644 za.co.mzansiinnovationhub.mih.desktop /app/share/applications/za.co.mzansiinnovationhub.mih.desktop
- install -Dm644 za.co.mzansiinnovationhub.mih.metainfo.xml /app/share/metainfo/za.co.mzansiinnovationhub.mih.metainfo.xml
- install -Dm644 za.co.mzansiinnovationhub.mih.png /app/share/icons/hicolor/256x256/apps/za.co.mzansiinnovationhub.mih.png
sources:
- type: archive
url: https://git.mzansi-innovation-hub.co.za/yaso_meth/mih-project/releases/download/V.1.2.6/mzansi_innovation_hub.tar.gz
sha256: cd610351f334fccce2d279f3112a5ac21bfa18b39d3c59e2cb0334fe2e8019b3
- type: file
path: za.co.mzansiinnovationhub.mih.desktop
- type: file
path: za.co.mzansiinnovationhub.mih.metainfo.xml
- type: file
path: za.co.mzansiinnovationhub.mih.png