config and use new install service
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_native_splash/flutter_native_splash.dart';
|
import 'package:flutter_native_splash/flutter_native_splash.dart';
|
||||||
|
import 'package:pwa_install/pwa_install.dart';
|
||||||
import '../mih_env/env.dart';
|
import '../mih_env/env.dart';
|
||||||
import '../../main.dart';
|
import '../../main.dart';
|
||||||
import 'package:supertokens_flutter/supertokens.dart';
|
import 'package:supertokens_flutter/supertokens.dart';
|
||||||
@@ -14,6 +15,9 @@ void main() async {
|
|||||||
apiBasePath: "/auth",
|
apiBasePath: "/auth",
|
||||||
);
|
);
|
||||||
// setUrlStrategy(PathUrlStrategy());
|
// setUrlStrategy(PathUrlStrategy());
|
||||||
|
PWAInstall().setup(installCallback: () {
|
||||||
|
debugPrint('APP INSTALLED!');
|
||||||
|
});
|
||||||
FlutterNativeSplash.remove();
|
FlutterNativeSplash.remove();
|
||||||
runApp(const MzanziInnovationHub());
|
runApp(const MzanziInnovationHub());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_native_splash/flutter_native_splash.dart';
|
import 'package:flutter_native_splash/flutter_native_splash.dart';
|
||||||
|
import 'package:pwa_install/pwa_install.dart';
|
||||||
import '../mih_env/env.dart';
|
import '../mih_env/env.dart';
|
||||||
import '../../main.dart';
|
import '../../main.dart';
|
||||||
import 'package:supertokens_flutter/supertokens.dart';
|
import 'package:supertokens_flutter/supertokens.dart';
|
||||||
@@ -15,5 +16,8 @@ void main() async {
|
|||||||
);
|
);
|
||||||
// setUrlStrategy(PathUrlStrategy());
|
// setUrlStrategy(PathUrlStrategy());
|
||||||
FlutterNativeSplash.remove();
|
FlutterNativeSplash.remove();
|
||||||
|
PWAInstall().setup(installCallback: () {
|
||||||
|
debugPrint('APP INSTALLED!');
|
||||||
|
});
|
||||||
runApp(const MzanziInnovationHub());
|
runApp(const MzanziInnovationHub());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
||||||
import 'package:mzansi_innovation_hub/main.dart';
|
import 'package:mzansi_innovation_hub/main.dart';
|
||||||
|
import 'package:mzansi_innovation_hub/mih_apis/mih_install_services.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_single_child_scroll.dart';
|
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_layout/mih_tile.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart';
|
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart';
|
||||||
@@ -9,7 +10,6 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_floating_menu.dart';
|
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_floating_menu.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
|
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
|
||||||
import "package:universal_html/js.dart" as js;
|
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
import 'package:share_plus/share_plus.dart';
|
import 'package:share_plus/share_plus.dart';
|
||||||
|
|
||||||
@@ -41,46 +41,6 @@ class _MihInfoState extends State<MihInfo> {
|
|||||||
final Uri _redditUrl =
|
final Uri _redditUrl =
|
||||||
Uri.parse('https://www.reddit.com/r/Mzani_Innovation_Hub/');
|
Uri.parse('https://www.reddit.com/r/Mzani_Innovation_Hub/');
|
||||||
|
|
||||||
void installMihTrigger() {
|
|
||||||
final isWebAndroid =
|
|
||||||
kIsWeb && (defaultTargetPlatform == TargetPlatform.android);
|
|
||||||
final isWebIos = kIsWeb && (defaultTargetPlatform == TargetPlatform.iOS);
|
|
||||||
|
|
||||||
if (isWebAndroid) {
|
|
||||||
launchSocialUrl(
|
|
||||||
Uri.parse(
|
|
||||||
"https://play.google.com/store/apps/details?id=za.co.mzansiinnovationhub.mih",
|
|
||||||
),
|
|
||||||
);
|
|
||||||
} else if (isWebIos) {
|
|
||||||
//Show pop up for IOS
|
|
||||||
// _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
|
|
||||||
// _showIOSInstallationGuide();
|
|
||||||
launchSocialUrl(
|
|
||||||
Uri.parse(
|
|
||||||
"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");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget founderBio() {
|
Widget founderBio() {
|
||||||
String bio = "";
|
String bio = "";
|
||||||
bio += "BSc Computer Science & Information Systems\n";
|
bio += "BSc Computer Science & Information Systems\n";
|
||||||
@@ -553,7 +513,7 @@ class _MihInfoState extends State<MihInfo> {
|
|||||||
children: [
|
children: [
|
||||||
MihButton(
|
MihButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
installMihTrigger();
|
MihInstallServices().installMihTrigger(context);
|
||||||
},
|
},
|
||||||
buttonColor: MzanziInnovationHub.of(context)!
|
buttonColor: MzanziInnovationHub.of(context)!
|
||||||
.theme
|
.theme
|
||||||
|
|||||||
Reference in New Issue
Block a user