Compare commits
3 Commits
4b47bf5288
...
f8a722eb50
| Author | SHA1 | Date | |
|---|---|---|---|
| f8a722eb50 | |||
| fdb28080e3 | |||
| 8a384921c5 |
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",
|
||||||
|
|||||||
@@ -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(),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -850,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: [
|
||||||
|
|||||||
Reference in New Issue
Block a user