Add platform buttons
This commit is contained in:
parent
8019996911
commit
e6f482ae52
|
|
@ -24,10 +24,15 @@ const String kAppPlansURL =
|
|||
'https://www.invoiceninja.com/invoicing-pricing-plans/';
|
||||
const String kPrivacyPolicyURL = 'https://www.invoiceninja.com/privacy-policy';
|
||||
const String kTermsOfServiceURL = 'https://www.invoiceninja.com/terms';
|
||||
const String kAppleStoreUrl =
|
||||
'https://itunes.apple.com/us/app/invoice-ninja/id1435514417?ls=1&mt=8';
|
||||
const String kGoogleStoreUrl =
|
||||
'https://play.google.com/store/apps/details?id=com.invoiceninja.flutter';
|
||||
|
||||
//const String kAppleStoreUrl = 'https://itunes.apple.com/us/app/invoice-ninja/id1435514417?ls=1&mt=8';
|
||||
//const String kGoogleStoreUrl = 'https://play.google.com/store/apps/details?id=com.invoiceninja.flutter';
|
||||
|
||||
const String kAppleStoreUrl = 'https://testflight.apple.com/join/MJ6WpaXh';
|
||||
const String kGoogleStoreUrl = 'https://play.google.com/apps/testing/com.invoiceninja.app';
|
||||
const String kMacOSUrl = 'http://download.invoiceninja.com/macos';
|
||||
const String kLinuxUrl = 'http://download.invoiceninja.com/linux';
|
||||
|
||||
const String kCapterralUrl = 'https://www.capterra.com/p/145215/Invoice-Ninja/';
|
||||
const String kCronsHelpUrl =
|
||||
'https://invoiceninja.github.io/selfhost.html#cron-configuration';
|
||||
|
|
@ -761,4 +766,3 @@ const String kActivityEmailReminder1 = '63';
|
|||
const String kActivityEmailReminder2 = '64';
|
||||
const String kActivityEmailReminder3 = '65';
|
||||
const String kActivityEmailReminderEndless = '66';
|
||||
|
||||
|
|
|
|||
|
|
@ -818,12 +818,81 @@ void _showAbout(BuildContext context) async {
|
|||
),
|
||||
),
|
||||
),
|
||||
//if (!state.isProduction) // TODO enable this check
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 30),
|
||||
child: AppButton(
|
||||
label: localization.appPlatforms.toUpperCase(),
|
||||
iconData: MdiIcons.desktopMac,
|
||||
onPressed: () {
|
||||
showDialog<AlertDialog>(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
actions: [
|
||||
FlatButton(
|
||||
child: Text(localization.close.toUpperCase()),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
],
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Text('Mobile'),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 20),
|
||||
child: AppButton(
|
||||
label: 'Apple',
|
||||
iconData: MdiIcons.appleIos,
|
||||
onPressed: () => launch(kAppleStoreUrl),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 20),
|
||||
child: AppButton(
|
||||
label: 'Android',
|
||||
iconData: MdiIcons.android,
|
||||
onPressed: () => launch(kGoogleStoreUrl),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 30),
|
||||
child: Text('Desktop'),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 20),
|
||||
child: AppButton(
|
||||
label: 'Apple',
|
||||
iconData: MdiIcons.apple,
|
||||
onPressed: () => launch(kMacOSUrl),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 20),
|
||||
child: AppButton(
|
||||
label: 'Linux',
|
||||
iconData: MdiIcons.linux,
|
||||
onPressed: () => launch(kLinuxUrl),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 20),
|
||||
child: Text('Windows coming soon...'),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
//if (!state.isProduction) // TODO enable this check
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 20),
|
||||
child: AppButton(
|
||||
label: localization.healthCheck.toUpperCase(),
|
||||
iconData: MdiIcons.shield,
|
||||
color: Colors.green,
|
||||
onPressed: () {
|
||||
showDialog<HealthCheckDialog>(
|
||||
context: context,
|
||||
|
|
@ -838,7 +907,7 @@ void _showAbout(BuildContext context) async {
|
|||
child: AppButton(
|
||||
label: localization.forceUpdate.toUpperCase(),
|
||||
iconData: MdiIcons.update,
|
||||
color: Colors.grey,
|
||||
color: Colors.orange,
|
||||
onPressed: () => _showUpdate(context),
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
|||
static final Map<String, Map<String, String>> _localizedValues = {
|
||||
'en': {
|
||||
// STARTER: lang key - do not remove comment
|
||||
'app_platforms': 'App Platforms',
|
||||
'invoice_late': 'Invoice Late',
|
||||
'quote_expired': 'Quote Expired',
|
||||
'partial_due': 'Partial Due',
|
||||
|
|
@ -5186,6 +5187,9 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
|||
String get quoteExpired =>
|
||||
_localizedValues[localeCode]['quote_expired'] ?? '';
|
||||
|
||||
String get appPlatforms =>
|
||||
_localizedValues[localeCode]['app_platforms'] ?? '';
|
||||
|
||||
String lookup(String key) {
|
||||
final lookupKey = toSnakeCase(key);
|
||||
|
||||
|
|
|
|||
|
|
@ -31,12 +31,13 @@ String getPlatform(BuildContext context) =>
|
|||
Theme.of(context).platform == TargetPlatform.iOS ? 'ios' : 'android';
|
||||
|
||||
String getAppURL(BuildContext context) {
|
||||
if (kIsWeb) {
|
||||
return kCapterralUrl;
|
||||
} else if (isAndroid(context)) {
|
||||
switch (Theme.of(context).platform) {
|
||||
case TargetPlatform.android:
|
||||
return kGoogleStoreUrl;
|
||||
} else {
|
||||
case TargetPlatform.iOS:
|
||||
return kAppleStoreUrl;
|
||||
default:
|
||||
return kCapterralUrl;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue