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/';
|
'https://www.invoiceninja.com/invoicing-pricing-plans/';
|
||||||
const String kPrivacyPolicyURL = 'https://www.invoiceninja.com/privacy-policy';
|
const String kPrivacyPolicyURL = 'https://www.invoiceninja.com/privacy-policy';
|
||||||
const String kTermsOfServiceURL = 'https://www.invoiceninja.com/terms';
|
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 kAppleStoreUrl = 'https://itunes.apple.com/us/app/invoice-ninja/id1435514417?ls=1&mt=8';
|
||||||
const String kGoogleStoreUrl =
|
//const String kGoogleStoreUrl = 'https://play.google.com/store/apps/details?id=com.invoiceninja.flutter';
|
||||||
'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 kCapterralUrl = 'https://www.capterra.com/p/145215/Invoice-Ninja/';
|
||||||
const String kCronsHelpUrl =
|
const String kCronsHelpUrl =
|
||||||
'https://invoiceninja.github.io/selfhost.html#cron-configuration';
|
'https://invoiceninja.github.io/selfhost.html#cron-configuration';
|
||||||
|
|
@ -761,4 +766,3 @@ const String kActivityEmailReminder1 = '63';
|
||||||
const String kActivityEmailReminder2 = '64';
|
const String kActivityEmailReminder2 = '64';
|
||||||
const String kActivityEmailReminder3 = '65';
|
const String kActivityEmailReminder3 = '65';
|
||||||
const String kActivityEmailReminderEndless = '66';
|
const String kActivityEmailReminderEndless = '66';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -818,12 +818,81 @@ void _showAbout(BuildContext context) async {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
//if (!state.isProduction) // TODO enable this check
|
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(top: 30),
|
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(
|
child: AppButton(
|
||||||
label: localization.healthCheck.toUpperCase(),
|
label: localization.healthCheck.toUpperCase(),
|
||||||
iconData: MdiIcons.shield,
|
iconData: MdiIcons.shield,
|
||||||
|
color: Colors.green,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
showDialog<HealthCheckDialog>(
|
showDialog<HealthCheckDialog>(
|
||||||
context: context,
|
context: context,
|
||||||
|
|
@ -838,7 +907,7 @@ void _showAbout(BuildContext context) async {
|
||||||
child: AppButton(
|
child: AppButton(
|
||||||
label: localization.forceUpdate.toUpperCase(),
|
label: localization.forceUpdate.toUpperCase(),
|
||||||
iconData: MdiIcons.update,
|
iconData: MdiIcons.update,
|
||||||
color: Colors.grey,
|
color: Colors.orange,
|
||||||
onPressed: () => _showUpdate(context),
|
onPressed: () => _showUpdate(context),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
||||||
static final Map<String, Map<String, String>> _localizedValues = {
|
static final Map<String, Map<String, String>> _localizedValues = {
|
||||||
'en': {
|
'en': {
|
||||||
// STARTER: lang key - do not remove comment
|
// STARTER: lang key - do not remove comment
|
||||||
|
'app_platforms': 'App Platforms',
|
||||||
'invoice_late': 'Invoice Late',
|
'invoice_late': 'Invoice Late',
|
||||||
'quote_expired': 'Quote Expired',
|
'quote_expired': 'Quote Expired',
|
||||||
'partial_due': 'Partial Due',
|
'partial_due': 'Partial Due',
|
||||||
|
|
@ -5186,6 +5187,9 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
||||||
String get quoteExpired =>
|
String get quoteExpired =>
|
||||||
_localizedValues[localeCode]['quote_expired'] ?? '';
|
_localizedValues[localeCode]['quote_expired'] ?? '';
|
||||||
|
|
||||||
|
String get appPlatforms =>
|
||||||
|
_localizedValues[localeCode]['app_platforms'] ?? '';
|
||||||
|
|
||||||
String lookup(String key) {
|
String lookup(String key) {
|
||||||
final lookupKey = toSnakeCase(key);
|
final lookupKey = toSnakeCase(key);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,12 +31,13 @@ String getPlatform(BuildContext context) =>
|
||||||
Theme.of(context).platform == TargetPlatform.iOS ? 'ios' : 'android';
|
Theme.of(context).platform == TargetPlatform.iOS ? 'ios' : 'android';
|
||||||
|
|
||||||
String getAppURL(BuildContext context) {
|
String getAppURL(BuildContext context) {
|
||||||
if (kIsWeb) {
|
switch (Theme.of(context).platform) {
|
||||||
return kCapterralUrl;
|
case TargetPlatform.android:
|
||||||
} else if (isAndroid(context)) {
|
return kGoogleStoreUrl;
|
||||||
return kGoogleStoreUrl;
|
case TargetPlatform.iOS:
|
||||||
} else {
|
return kAppleStoreUrl;
|
||||||
return kAppleStoreUrl;
|
default:
|
||||||
|
return kCapterralUrl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue