Adjust change plans button logic

This commit is contained in:
Hillel Coren 2023-06-06 12:49:45 +03:00
parent b92cdc6ab9
commit 178d84ac8b
2 changed files with 14 additions and 6 deletions

View File

@ -366,11 +366,13 @@ class _AccountOverview extends StatelessWidget {
),
if (state.isHosted) ...[
if (state.isProPlan && account.hasIapPlan)
SizedBox()
else if (state.isProPlan &&
!account.hasIapPlan &&
supportsInAppPurchase())
SizedBox()
Padding(
padding: const EdgeInsets.all(20),
child: Text(
localization.useMobileToManagePlan,
textAlign: TextAlign.center,
),
)
else
Padding(
padding: const EdgeInsets.only(left: 16, top: 16, right: 16),
@ -387,7 +389,7 @@ class _AccountOverview extends StatelessWidget {
),
),
onPressed: () {
if (supportsInAppPurchase()) {
if (supportsInAppPurchase() && !account.hasIapPlan) {
showDialog<void>(
context: context,
builder: (context) => UpgradeDialog(),

View File

@ -18,6 +18,8 @@ mixin LocalizationsProvider on LocaleCodeAware {
static final Map<String, Map<String, String>> _localizedValues = {
'en': {
// STARTER: lang key - do not remove comment
'use_mobile_to_manage_plan':
'Use your phone subscription settings to manage your plan',
'show_task_billable': 'Show Task Billable',
'credit_item': 'Credit Item',
'drop_file_here': 'Drop file here',
@ -103261,6 +103263,10 @@ mixin LocalizationsProvider on LocaleCodeAware {
_localizedValues[localeCode]['show_task_billable'] ??
_localizedValues['en']['show_task_billable'];
String get useMobileToManagePlan =>
_localizedValues[localeCode]['use_mobile_to_manage_plan'] ??
_localizedValues['en']['use_mobile_to_manage_plan'];
// STARTER: lang field - do not remove comment
String lookup(String key) {