From 374d143aa5b516ceb64b61a6c2827e12208ed60c Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 10 Oct 2022 23:54:21 +0300 Subject: [PATCH] Changes for Apple --- lib/constants.dart | 2 +- lib/ui/app/review_app.dart | 21 ++++++++++++++++----- lib/utils/i18n.dart | 5 +++++ pubspec.foss.yaml | 2 +- pubspec.next.yaml | 2 +- pubspec.yaml | 2 +- snap/snapcraft.yaml | 2 +- 7 files changed, 26 insertions(+), 10 deletions(-) diff --git a/lib/constants.dart b/lib/constants.dart index e804b9a7c..ad1118455 100644 --- a/lib/constants.dart +++ b/lib/constants.dart @@ -4,7 +4,7 @@ class Constants { } // TODO remove version once #46609 is fixed -const String kClientVersion = '5.0.97'; +const String kClientVersion = '5.0.98'; const String kMinServerVersion = '5.0.4'; const String kAppName = 'Invoice Ninja'; diff --git a/lib/ui/app/review_app.dart b/lib/ui/app/review_app.dart index 099e39ebf..697a3a5d9 100644 --- a/lib/ui/app/review_app.dart +++ b/lib/ui/app/review_app.dart @@ -20,6 +20,15 @@ class ReviewApp extends StatefulWidget { class _ReviewAppState extends State { bool _likesTheApp; + @override + void initState() { + super.initState(); + + if (isApple()) { + _likesTheApp = true; + } + } + @override Widget build(BuildContext context) { final localization = AppLocalization.of(context); @@ -41,11 +50,13 @@ class _ReviewAppState extends State { children: [ SizedBox(height: 12), Text( - _likesTheApp == null - ? localization.areYouEnjoyingTheApp - : _likesTheApp == true - ? localization.wouldYouRateIt - : localization.wouldYouTellUsMore, + isApple() + ? localization.wouldYouRateTheApp + : _likesTheApp == null + ? localization.areYouEnjoyingTheApp + : _likesTheApp == true + ? localization.wouldYouRateIt + : localization.wouldYouTellUsMore, style: Theme.of(context).textTheme.subtitle1, textAlign: TextAlign.center, ), diff --git a/lib/utils/i18n.dart b/lib/utils/i18n.dart index d50a54641..8cc324cd1 100644 --- a/lib/utils/i18n.dart +++ b/lib/utils/i18n.dart @@ -16,6 +16,7 @@ mixin LocalizationsProvider on LocaleCodeAware { static final Map> _localizedValues = { 'en': { // STARTER: lang key - do not remove comment + 'would_you_rate_the_app': 'Would you like to rate the app?', 'include_deleted': 'Include Deleted', 'include_deleted_help': 'Include deleted records in reports', 'due_on': 'Due On', @@ -87438,6 +87439,10 @@ mixin LocalizationsProvider on LocaleCodeAware { _localizedValues[localeCode]['include_deleted_help'] ?? _localizedValues['en']['include_deleted_help']; +String get wouldYouRateTheApp => + _localizedValues[localeCode]['would_you_rate_the_app'] ?? + _localizedValues['en']['would_you_rate_the_app']; + // STARTER: lang field - do not remove comment String lookup(String key) { diff --git a/pubspec.foss.yaml b/pubspec.foss.yaml index 96c592d4f..80bc85d1d 100644 --- a/pubspec.foss.yaml +++ b/pubspec.foss.yaml @@ -1,6 +1,6 @@ name: invoiceninja_flutter description: Client for Invoice Ninja -version: 5.0.97+97 +version: 5.0.98+98 homepage: https://invoiceninja.com documentation: https://invoiceninja.github.io publish_to: none diff --git a/pubspec.next.yaml b/pubspec.next.yaml index 8fd370dde..6d1fc7261 100644 --- a/pubspec.next.yaml +++ b/pubspec.next.yaml @@ -1,6 +1,6 @@ name: invoiceninja_flutter description: Client for Invoice Ninja -version: 5.0.97+97 +version: 5.0.98+98 homepage: https://invoiceninja.com documentation: https://invoiceninja.github.io publish_to: none diff --git a/pubspec.yaml b/pubspec.yaml index 4755ac874..d434aeeae 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: invoiceninja_flutter description: Client for Invoice Ninja -version: 5.0.97+97 +version: 5.0.98+98 homepage: https://invoiceninja.com documentation: https://invoiceninja.github.io publish_to: none diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 1a738dc2e..c12a80f08 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,5 +1,5 @@ name: invoiceninja -version: '5.0.97' +version: '5.0.98' summary: Create invoices, accept payments, track expenses & time-tasks description: "### Note: if the app fails to run using `snap run invoiceninja` it may help to run `/snap/invoiceninja/current/bin/invoiceninja` instead