Compare commits
6 Commits
V.1.2.5
...
f8a722eb50
| Author | SHA1 | Date | |
|---|---|---|---|
| f8a722eb50 | |||
| fdb28080e3 | |||
| 8a384921c5 | |||
| 4b47bf5288 | |||
| 141611b84d | |||
| a29d0afeb8 |
11
.vscode/launch.json
vendored
11
.vscode/launch.json
vendored
@@ -11,6 +11,17 @@
|
|||||||
"type": "dart",
|
"type": "dart",
|
||||||
"program": "lib/main_dev.dart"
|
"program": "lib/main_dev.dart"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "Debug (web)",
|
||||||
|
"cwd": "mih_ui",
|
||||||
|
"request": "launch",
|
||||||
|
"type": "dart",
|
||||||
|
"program": "lib/main_dev.dart",
|
||||||
|
"args": [
|
||||||
|
"--web-port",
|
||||||
|
"1995"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "Profile",
|
"name": "Profile",
|
||||||
"cwd": "mih_ui",
|
"cwd": "mih_ui",
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ st_api_key = os.getenv("SUPERTOKENS_API_KEY")
|
|||||||
origins = [
|
origins = [
|
||||||
"http://localhost",
|
"http://localhost",
|
||||||
"http://localhost:80",
|
"http://localhost:80",
|
||||||
|
"http://localhost:1995",
|
||||||
"http://localhost:8080",
|
"http://localhost:8080",
|
||||||
"http://MIH-API-Hub:80",
|
"http://MIH-API-Hub:80",
|
||||||
"http://MIH-API-Hub",
|
"http://MIH-API-Hub",
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class MihTheme {
|
|||||||
late String loadingAssetText;
|
late String loadingAssetText;
|
||||||
late TargetPlatform platform;
|
late TargetPlatform platform;
|
||||||
bool kIsWeb = const bool.fromEnvironment('dart.library.js_util');
|
bool kIsWeb = const bool.fromEnvironment('dart.library.js_util');
|
||||||
String latestVersion = "1.2.5";
|
String latestVersion = "1.2.6";
|
||||||
MihTheme() {
|
MihTheme() {
|
||||||
mode = "Dark";
|
mode = "Dark";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
|||||||
import 'package:mzansi_innovation_hub/main.dart';
|
import 'package:mzansi_innovation_hub/main.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_objects/profile_link.dart';
|
import 'package:mzansi_innovation_hub/mih_objects/profile_link.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_tile.dart';
|
import 'package:mzansi_innovation_hub/mih_package_components/mih_button.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart';
|
import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
@@ -26,72 +26,87 @@ class MihProfileLinks extends StatefulWidget {
|
|||||||
class _MihProfileLinksState extends State<MihProfileLinks> {
|
class _MihProfileLinksState extends State<MihProfileLinks> {
|
||||||
Widget displayLinkButton(ProfileLink link) {
|
Widget displayLinkButton(ProfileLink link) {
|
||||||
IconData iconData;
|
IconData iconData;
|
||||||
Color iconColor;
|
Color btnColor;
|
||||||
|
Color iconColor = Colors.white;
|
||||||
switch (link.destination.toLowerCase()) {
|
switch (link.destination.toLowerCase()) {
|
||||||
case "youtube":
|
case "youtube":
|
||||||
iconData = FontAwesomeIcons.youtube;
|
iconData = FontAwesomeIcons.youtube;
|
||||||
iconColor = const Color(0xFFFF0000);
|
btnColor = const Color(0xFFFF0000);
|
||||||
break;
|
break;
|
||||||
case "tiktok":
|
case "tiktok":
|
||||||
iconData = FontAwesomeIcons.tiktok;
|
iconData = FontAwesomeIcons.tiktok;
|
||||||
iconColor = const Color(0xFF000000);
|
btnColor = const Color(0xFF000000);
|
||||||
break;
|
break;
|
||||||
case "twitch":
|
case "twitch":
|
||||||
iconData = FontAwesomeIcons.twitch;
|
iconData = FontAwesomeIcons.twitch;
|
||||||
iconColor = const Color(0xFF6441a5);
|
btnColor = const Color(0xFF6441a5);
|
||||||
break;
|
break;
|
||||||
case "threads":
|
case "threads":
|
||||||
iconData = FontAwesomeIcons.threads;
|
iconData = FontAwesomeIcons.threads;
|
||||||
iconColor = const Color(0xFF000000);
|
btnColor = const Color(0xFF000000);
|
||||||
break;
|
break;
|
||||||
case "whatsapp":
|
case "whatsapp":
|
||||||
iconData = FontAwesomeIcons.whatsapp;
|
iconData = FontAwesomeIcons.whatsapp;
|
||||||
iconColor = const Color(0xFF25D366);
|
btnColor = const Color(0xFF25D366);
|
||||||
break;
|
break;
|
||||||
case "instagram":
|
case "instagram":
|
||||||
iconData = FontAwesomeIcons.instagram;
|
iconData = FontAwesomeIcons.instagram;
|
||||||
iconColor = const Color(0xFFF56040);
|
btnColor = const Color(0xFFF56040);
|
||||||
break;
|
break;
|
||||||
case "x":
|
case "x":
|
||||||
iconData = FontAwesomeIcons.xTwitter;
|
iconData = FontAwesomeIcons.xTwitter;
|
||||||
iconColor = const Color(0xFF000000);
|
btnColor = const Color(0xFF000000);
|
||||||
break;
|
break;
|
||||||
case "linkedin":
|
case "linkedin":
|
||||||
iconData = FontAwesomeIcons.linkedin;
|
iconData = FontAwesomeIcons.linkedin;
|
||||||
iconColor = const Color(0xFF0a66c2);
|
btnColor = const Color(0xFF0a66c2);
|
||||||
break;
|
break;
|
||||||
case "facebook":
|
case "facebook":
|
||||||
iconData = FontAwesomeIcons.facebook;
|
iconData = FontAwesomeIcons.facebook;
|
||||||
iconColor = const Color(0xFF4267B2);
|
btnColor = const Color(0xFF4267B2);
|
||||||
break;
|
break;
|
||||||
case "reddit":
|
case "reddit":
|
||||||
iconData = FontAwesomeIcons.reddit;
|
iconData = FontAwesomeIcons.reddit;
|
||||||
iconColor = const Color(0xFFFF4500);
|
btnColor = const Color(0xFFFF4500);
|
||||||
break;
|
break;
|
||||||
case "discord":
|
case "discord":
|
||||||
iconData = FontAwesomeIcons.discord;
|
iconData = FontAwesomeIcons.discord;
|
||||||
iconColor = const Color(0xFF5865F2);
|
btnColor = const Color(0xFF5865F2);
|
||||||
|
break;
|
||||||
|
case "git":
|
||||||
|
iconData = FontAwesomeIcons.git;
|
||||||
|
btnColor = const Color(0xFF73A952);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
iconData = FontAwesomeIcons.link;
|
iconData = FontAwesomeIcons.link;
|
||||||
iconColor = MihColors.getPrimaryColor(
|
btnColor = MihColors.getPrimaryColor(
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark");
|
MzansiInnovationHub.of(context)!.theme.mode == "Dark");
|
||||||
}
|
}
|
||||||
|
return MihButton(
|
||||||
return MihPackageTile(
|
onPressed: () {
|
||||||
onTap: () {
|
|
||||||
launchSocialUrl(Uri.parse(link.web_link));
|
launchSocialUrl(Uri.parse(link.web_link));
|
||||||
},
|
},
|
||||||
appName: link.destination,
|
buttonColor: btnColor,
|
||||||
appIcon: Icon(
|
child: FaIcon(
|
||||||
iconData,
|
iconData,
|
||||||
color: iconColor,
|
color: iconColor,
|
||||||
|
size: 33,
|
||||||
),
|
),
|
||||||
iconSize: 200,
|
|
||||||
textColor: Colors.black,
|
|
||||||
// MihColors.getPrimaryColor(
|
|
||||||
// MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
);
|
);
|
||||||
|
// return MihPackageTile(
|
||||||
|
// onTap: () {
|
||||||
|
// launchSocialUrl(Uri.parse(link.web_link));
|
||||||
|
// },
|
||||||
|
// appName: link.destination,
|
||||||
|
// appIcon: Icon(
|
||||||
|
// iconData,
|
||||||
|
// color: btnColor,
|
||||||
|
// ),
|
||||||
|
// iconSize: 200,
|
||||||
|
// textColor: Colors.black,
|
||||||
|
// // MihColors.getPrimaryColor(
|
||||||
|
// // MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||||
|
// );
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> launchSocialUrl(Uri linkUrl) async {
|
Future<void> launchSocialUrl(Uri linkUrl) async {
|
||||||
@@ -112,52 +127,35 @@ class _MihProfileLinksState extends State<MihProfileLinks> {
|
|||||||
? EdgeInsets.symmetric(horizontal: width * 0.2)
|
? EdgeInsets.symmetric(horizontal: width * 0.2)
|
||||||
: EdgeInsets.symmetric(horizontal: width * 0.075)
|
: EdgeInsets.symmetric(horizontal: width * 0.075)
|
||||||
: EdgeInsetsGeometry.all(0),
|
: EdgeInsetsGeometry.all(0),
|
||||||
child: Material(
|
child: widget.links.isEmpty
|
||||||
color: MihColors.getSecondaryColor(
|
? SizedBox(
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark")
|
height: 35,
|
||||||
.withValues(alpha: 0.6),
|
child: Text(
|
||||||
borderRadius: BorderRadius.circular(25),
|
"No Profile Links",
|
||||||
elevation: 10,
|
textAlign: TextAlign.center,
|
||||||
shadowColor: Colors.black,
|
style: TextStyle(
|
||||||
child: Container(
|
fontSize: 25,
|
||||||
width: 500,
|
fontWeight: FontWeight.bold,
|
||||||
padding: EdgeInsets.all(10),
|
color: MihColors.getPrimaryColor(
|
||||||
decoration: BoxDecoration(
|
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||||
color: MihColors.getSecondaryColor(
|
"Dark"),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
borderRadius: BorderRadius.circular(10),
|
|
||||||
),
|
|
||||||
child: widget.links.isEmpty
|
|
||||||
? SizedBox(
|
|
||||||
height: 35,
|
|
||||||
child: Text(
|
|
||||||
"No Profile Links",
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 25,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
color: MihColors.getPrimaryColor(
|
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
: Wrap(
|
|
||||||
alignment: WrapAlignment.center,
|
|
||||||
runSpacing: 15,
|
|
||||||
spacing: 15,
|
|
||||||
children: widget.links.map(
|
|
||||||
(link) {
|
|
||||||
return SizedBox(
|
|
||||||
width: widget.buttonSize ?? 80,
|
|
||||||
height: widget.buttonSize ?? 80,
|
|
||||||
child: displayLinkButton(link),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
).toList(),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
)
|
||||||
|
: Wrap(
|
||||||
|
alignment: WrapAlignment.center,
|
||||||
|
runSpacing: 15,
|
||||||
|
spacing: 15,
|
||||||
|
children: widget.links.map(
|
||||||
|
(link) {
|
||||||
|
return SizedBox(
|
||||||
|
width: widget.buttonSize ?? 80,
|
||||||
|
height: widget.buttonSize ?? 80,
|
||||||
|
child: displayLinkButton(link),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
).toList(),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
||||||
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:mzansi_innovation_hub/main.dart';
|
import 'package:mzansi_innovation_hub/main.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_objects/profile_link.dart';
|
import 'package:mzansi_innovation_hub/mih_objects/profile_link.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||||
|
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_window.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_profile_links.dart';
|
import 'package:mzansi_innovation_hub/mih_package_components/mih_profile_links.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_services/mih_business_details_services.dart';
|
import 'package:mzansi_innovation_hub/mih_services/mih_business_details_services.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_services/mih_install_services.dart';
|
import 'package:mzansi_innovation_hub/mih_services/mih_install_services.dart';
|
||||||
@@ -432,7 +434,119 @@ class _MihInfoState extends State<MihInfo> {
|
|||||||
children: [
|
children: [
|
||||||
MihButton(
|
MihButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
MihInstallServices().installMihTrigger(context);
|
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.getSecondaryColor(
|
||||||
|
MzansiInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.mode ==
|
||||||
|
"Dark"),
|
||||||
|
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.getGreenColor(
|
||||||
|
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||||
|
"Dark"),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
FaIcon(
|
||||||
|
FontAwesomeIcons.googlePlay,
|
||||||
|
color: MihColors.getPrimaryColor(
|
||||||
|
MzansiInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.mode ==
|
||||||
|
"Dark"),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 10),
|
||||||
|
Text(
|
||||||
|
"Play Store",
|
||||||
|
style: TextStyle(
|
||||||
|
color: MihColors.getPrimaryColor(
|
||||||
|
MzansiInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.mode ==
|
||||||
|
"Dark"),
|
||||||
|
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.getGreenColor(
|
||||||
|
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||||
|
"Dark"),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
FaIcon(
|
||||||
|
Icons.store,
|
||||||
|
color: MihColors.getPrimaryColor(
|
||||||
|
MzansiInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.mode ==
|
||||||
|
"Dark"),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 10),
|
||||||
|
Text(
|
||||||
|
"App Gallery",
|
||||||
|
style: TextStyle(
|
||||||
|
color: MihColors.getPrimaryColor(
|
||||||
|
MzansiInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.mode ==
|
||||||
|
"Dark"),
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
MihInstallServices().installMihTrigger(context);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getGreenColor(
|
buttonColor: MihColors.getGreenColor(
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||||
@@ -736,6 +850,14 @@ class _MihInfoState extends State<MihInfo> {
|
|||||||
destination: "Reddit",
|
destination: "Reddit",
|
||||||
web_link: "https://www.reddit.com/r/Mzani_Innovation_Hub/",
|
web_link: "https://www.reddit.com/r/Mzani_Innovation_Hub/",
|
||||||
),
|
),
|
||||||
|
ProfileLink(
|
||||||
|
idprofile_links: 1,
|
||||||
|
app_id: "1234",
|
||||||
|
business_id: "",
|
||||||
|
destination: "Git",
|
||||||
|
web_link:
|
||||||
|
"https://git.mzansi-innovation-hub.co.za/yaso_meth/mih-project",
|
||||||
|
),
|
||||||
];
|
];
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class MzansiAiProvider extends ChangeNotifier {
|
|||||||
ollamaProvider = OllamaProvider(
|
ollamaProvider = OllamaProvider(
|
||||||
baseUrl: "${AppEnviroment.baseAiUrl}/api",
|
baseUrl: "${AppEnviroment.baseAiUrl}/api",
|
||||||
model: AppEnviroment.getEnv() == "Prod"
|
model: AppEnviroment.getEnv() == "Prod"
|
||||||
? 'qwen3-vl:8b'
|
? 'qwen3-vl:8b-instruct'
|
||||||
: "qwen3-vl:2b-instruct",
|
: "qwen3-vl:2b-instruct",
|
||||||
think: false,
|
think: false,
|
||||||
systemPrompt: "---INSTRUCTION START---\n"
|
systemPrompt: "---INSTRUCTION START---\n"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
name: mzansi_innovation_hub
|
name: mzansi_innovation_hub
|
||||||
description: ""
|
description: ""
|
||||||
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||||
version: 1.2.5+126
|
version: 1.2.6+127
|
||||||
# version: 1.1.1+97 #--- Updated version for upgrader package testing
|
# version: 1.1.1+97 #--- Updated version for upgrader package testing
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
Reference in New Issue
Block a user