Merge pull request #243 from yaso-meth/NEW--Patreon-button
NEW--Patreon-button
This commit is contained in:
@@ -419,23 +419,47 @@ class _MihInfoState extends State<MihInfo> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String getInstallButtonText() {
|
Widget getInstallButtonText() {
|
||||||
final isWebAndroid =
|
final isWebAndroid =
|
||||||
kIsWeb && (defaultTargetPlatform == TargetPlatform.android);
|
kIsWeb && (defaultTargetPlatform == TargetPlatform.android);
|
||||||
final isWebIos = kIsWeb && (defaultTargetPlatform == TargetPlatform.iOS);
|
final isWebIos = kIsWeb && (defaultTargetPlatform == TargetPlatform.iOS);
|
||||||
|
String btnText = "";
|
||||||
|
IconData platformIcon;
|
||||||
if (isWebAndroid) {
|
if (isWebAndroid) {
|
||||||
return "Install MIH (Play Store)";
|
btnText = "Install MIH";
|
||||||
|
platformIcon = FontAwesomeIcons.googlePlay;
|
||||||
} else if (isWebIos) {
|
} else if (isWebIos) {
|
||||||
return "Install MIH (PWA)";
|
btnText = "Install MIH";
|
||||||
|
platformIcon = FontAwesomeIcons.appStoreIos;
|
||||||
} else if (MzansiInnovationHub.of(context)!.theme.getPlatform() ==
|
} else if (MzansiInnovationHub.of(context)!.theme.getPlatform() ==
|
||||||
"Android") {
|
"Android") {
|
||||||
return "Update MIH (Play Store)";
|
btnText = "Update MIH";
|
||||||
|
platformIcon = FontAwesomeIcons.googlePlay;
|
||||||
} else if (MzansiInnovationHub.of(context)!.theme.getPlatform() == "iOS") {
|
} else if (MzansiInnovationHub.of(context)!.theme.getPlatform() == "iOS") {
|
||||||
return "Update MIH (App Store)";
|
btnText = "Update MIH";
|
||||||
|
platformIcon = FontAwesomeIcons.appStoreIos;
|
||||||
} else {
|
} 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) {
|
void shareMIHLink(BuildContext context, String message, String link) {
|
||||||
@@ -508,8 +532,8 @@ class _MihInfoState extends State<MihInfo> {
|
|||||||
height: 10,
|
height: 10,
|
||||||
),
|
),
|
||||||
Wrap(
|
Wrap(
|
||||||
alignment: WrapAlignment.start,
|
alignment: WrapAlignment.center,
|
||||||
crossAxisAlignment: WrapCrossAlignment.start,
|
crossAxisAlignment: WrapCrossAlignment.center,
|
||||||
spacing: 10,
|
spacing: 10,
|
||||||
runSpacing: 10,
|
runSpacing: 10,
|
||||||
children: [
|
children: [
|
||||||
@@ -520,16 +544,7 @@ class _MihInfoState extends State<MihInfo> {
|
|||||||
buttonColor:
|
buttonColor:
|
||||||
MzansiInnovationHub.of(context)!.theme.successColor(),
|
MzansiInnovationHub.of(context)!.theme.successColor(),
|
||||||
width: 300,
|
width: 300,
|
||||||
child: Text(
|
child: getInstallButtonText(),
|
||||||
getInstallButtonText(),
|
|
||||||
style: TextStyle(
|
|
||||||
color: MzansiInnovationHub.of(context)!
|
|
||||||
.theme
|
|
||||||
.primaryColor(),
|
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
MihButton(
|
MihButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
@@ -542,15 +557,61 @@ class _MihInfoState extends State<MihInfo> {
|
|||||||
buttonColor:
|
buttonColor:
|
||||||
MzansiInnovationHub.of(context)!.theme.successColor(),
|
MzansiInnovationHub.of(context)!.theme.successColor(),
|
||||||
width: 300,
|
width: 300,
|
||||||
child: Text(
|
child: Row(
|
||||||
"MIH Beginners Guide",
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
style: TextStyle(
|
children: [
|
||||||
color: MzansiInnovationHub.of(context)!
|
FaIcon(
|
||||||
.theme
|
FontAwesomeIcons.youtube,
|
||||||
.primaryColor(),
|
color: MzansiInnovationHub.of(context)!
|
||||||
fontSize: 20,
|
.theme
|
||||||
fontWeight: FontWeight.bold,
|
.primaryColor(),
|
||||||
),
|
),
|
||||||
|
const SizedBox(width: 10),
|
||||||
|
Text(
|
||||||
|
"MIH Beginners Guide",
|
||||||
|
style: TextStyle(
|
||||||
|
color: MzansiInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.primaryColor(),
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
MihButton(
|
||||||
|
onPressed: () {
|
||||||
|
launchSocialUrl(
|
||||||
|
Uri.parse(
|
||||||
|
"https://patreon.com/MzansiInnovationHub?utm_medium=unknown&utm_source=join_link&utm_campaign=creatorshare_creator&utm_content=copyLink",
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
buttonColor:
|
||||||
|
MzansiInnovationHub.of(context)!.theme.successColor(),
|
||||||
|
width: 300,
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
FaIcon(
|
||||||
|
FontAwesomeIcons.patreon,
|
||||||
|
color: MzansiInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.primaryColor(),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 10),
|
||||||
|
Text(
|
||||||
|
"Support Our Journey",
|
||||||
|
style: TextStyle(
|
||||||
|
color: MzansiInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.primaryColor(),
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
|
|||||||
Reference in New Issue
Block a user