Merge pull request #102 from yaso-meth/QOL--Update-MIH-button-in-about
add dymanic text for instal and update MIH
This commit is contained in:
commit
7f0a5dad15
1 changed files with 20 additions and 1 deletions
|
|
@ -549,6 +549,25 @@ class _MihInfoState extends State<MihInfo> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String getInstallButtonText() {
|
||||||
|
final isWebAndroid =
|
||||||
|
kIsWeb && (defaultTargetPlatform == TargetPlatform.android);
|
||||||
|
final isWebIos = kIsWeb && (defaultTargetPlatform == TargetPlatform.iOS);
|
||||||
|
|
||||||
|
if (isWebAndroid) {
|
||||||
|
return "Install MIH (Play Store)";
|
||||||
|
} else if (isWebIos) {
|
||||||
|
return "Install MIH (PWA)";
|
||||||
|
} else if (MzanziInnovationHub.of(context)!.theme.getPlatform() ==
|
||||||
|
"Android") {
|
||||||
|
return "Update MIH (Play Store)";
|
||||||
|
} else if (MzanziInnovationHub.of(context)!.theme.getPlatform() == "iOS") {
|
||||||
|
return "Update MIH (App Store)";
|
||||||
|
} else {
|
||||||
|
return "Install MIH (PWA)";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MihAppToolBody(
|
return MihAppToolBody(
|
||||||
|
|
@ -611,7 +630,7 @@ class _MihInfoState extends State<MihInfo> {
|
||||||
onTap: () {
|
onTap: () {
|
||||||
installMihTrigger();
|
installMihTrigger();
|
||||||
},
|
},
|
||||||
buttonText: "Install MIH",
|
buttonText: getInstallButtonText(),
|
||||||
buttonColor: MzanziInnovationHub.of(context)!
|
buttonColor: MzanziInnovationHub.of(context)!
|
||||||
.theme
|
.theme
|
||||||
.secondaryColor(),
|
.secondaryColor(),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue