Clarify setting default design

This commit is contained in:
Hillel Coren 2022-05-27 12:38:13 +03:00
parent 5ede246086
commit d8bcd0a227
2 changed files with 95 additions and 74 deletions

View File

@ -139,7 +139,9 @@ class _InvoiceDesignState extends State<InvoiceDesign>
),
),
FormCard(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
if (state.isProPlan) ...[
if (company.isModuleEnabled(EntityType.invoice)) ...[
DesignPicker(
label: localization.invoiceDesign,
@ -158,7 +160,8 @@ class _InvoiceDesignState extends State<InvoiceDesign>
Padding(
padding: const EdgeInsets.only(bottom: 8),
child: CheckboxListTile(
activeColor: Theme.of(context).colorScheme.secondary,
activeColor:
Theme.of(context).colorScheme.secondary,
title: Text(localization.updateAllRecords),
value: _updateAllInvoiceDesigns,
onChanged: (value) => setState(
@ -185,7 +188,8 @@ class _InvoiceDesignState extends State<InvoiceDesign>
Padding(
padding: const EdgeInsets.only(bottom: 8),
child: CheckboxListTile(
activeColor: Theme.of(context).colorScheme.secondary,
activeColor:
Theme.of(context).colorScheme.secondary,
title: Text(localization.updateAllRecords),
value: _updateAllQuoteDesigns,
onChanged: (value) => setState(
@ -212,7 +216,8 @@ class _InvoiceDesignState extends State<InvoiceDesign>
Padding(
padding: const EdgeInsets.only(bottom: 8),
child: CheckboxListTile(
activeColor: Theme.of(context).colorScheme.secondary,
activeColor:
Theme.of(context).colorScheme.secondary,
title: Text(localization.updateAllRecords),
value: _updateAllCreditDesigns,
onChanged: (value) => setState(
@ -221,6 +226,17 @@ class _InvoiceDesignState extends State<InvoiceDesign>
),
),
],
] else
OutlinedButton(
child: Text(localization.setDefaultDesign.toUpperCase()),
onPressed: () {
store.dispatch(ViewSettings(
company: state.company,
section: kSettingsCompanyDetails,
tabIndex: 3,
));
},
),
AppDropdownButton(
labelText: localization.pageLayout,
value: settings.pageLayout,

View File

@ -16,6 +16,7 @@ mixin LocalizationsProvider on LocaleCodeAware {
static final Map<String, Map<String, String>> _localizedValues = {
'en': {
// STARTER: lang key - do not remove comment
'set_default_design': 'Set Default Design',
'add_gateway': 'Add Gateway',
'add_gateway_help_message':
'Add a payment gateway (ie. Stripe, WePay or PayPal) to accept online payments',
@ -70523,6 +70524,10 @@ mixin LocalizationsProvider on LocaleCodeAware {
_localizedValues[localeCode]['add_gateway'] ??
_localizedValues['en']['add_gateway'];
String get setDefaultDesign =>
_localizedValues[localeCode]['set_default_design'] ??
_localizedValues['en']['set_default_design'];
String get addGatewayHelpMessage =>
_localizedValues[localeCode]['add_gateway_help_message'] ??
_localizedValues['en']['add_gateway_help_message'];