Clarify setting default design
This commit is contained in:
parent
5ede246086
commit
d8bcd0a227
|
|
@ -139,88 +139,104 @@ class _InvoiceDesignState extends State<InvoiceDesign>
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
FormCard(
|
FormCard(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
if (company.isModuleEnabled(EntityType.invoice)) ...[
|
if (state.isProPlan) ...[
|
||||||
DesignPicker(
|
if (company.isModuleEnabled(EntityType.invoice)) ...[
|
||||||
label: localization.invoiceDesign,
|
DesignPicker(
|
||||||
initialValue: settings.defaultInvoiceDesignId,
|
label: localization.invoiceDesign,
|
||||||
onSelected: (value) {
|
initialValue: settings.defaultInvoiceDesignId,
|
||||||
setState(() {
|
onSelected: (value) {
|
||||||
_wasInvoiceDesignChanged = true;
|
setState(() {
|
||||||
});
|
_wasInvoiceDesignChanged = true;
|
||||||
viewModel.onSettingsChanged(settings.rebuild(
|
});
|
||||||
(b) => b..defaultInvoiceDesignId = value.id));
|
viewModel.onSettingsChanged(settings.rebuild(
|
||||||
},
|
(b) => b..defaultInvoiceDesignId = value.id));
|
||||||
),
|
},
|
||||||
if (!isFiltered &&
|
),
|
||||||
_wasInvoiceDesignChanged &&
|
if (!isFiltered &&
|
||||||
state.userCompany.isAdmin)
|
_wasInvoiceDesignChanged &&
|
||||||
Padding(
|
state.userCompany.isAdmin)
|
||||||
padding: const EdgeInsets.only(bottom: 8),
|
Padding(
|
||||||
child: CheckboxListTile(
|
padding: const EdgeInsets.only(bottom: 8),
|
||||||
activeColor: Theme.of(context).colorScheme.secondary,
|
child: CheckboxListTile(
|
||||||
title: Text(localization.updateAllRecords),
|
activeColor:
|
||||||
value: _updateAllInvoiceDesigns,
|
Theme.of(context).colorScheme.secondary,
|
||||||
onChanged: (value) => setState(
|
title: Text(localization.updateAllRecords),
|
||||||
() => _updateAllInvoiceDesigns = value,
|
value: _updateAllInvoiceDesigns,
|
||||||
|
onChanged: (value) => setState(
|
||||||
|
() => _updateAllInvoiceDesigns = value,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
],
|
||||||
|
if (company.isModuleEnabled(EntityType.quote)) ...[
|
||||||
|
DesignPicker(
|
||||||
|
label: localization.quoteDesign,
|
||||||
|
initialValue: settings.defaultQuoteDesignId,
|
||||||
|
onSelected: (value) {
|
||||||
|
setState(() {
|
||||||
|
_wasQuoteDesignChanged = true;
|
||||||
|
});
|
||||||
|
viewModel.onSettingsChanged(settings.rebuild(
|
||||||
|
(b) => b..defaultQuoteDesignId = value.id));
|
||||||
|
},
|
||||||
),
|
),
|
||||||
],
|
if (!isFiltered &&
|
||||||
if (company.isModuleEnabled(EntityType.quote)) ...[
|
_wasQuoteDesignChanged &&
|
||||||
DesignPicker(
|
state.userCompany.isAdmin)
|
||||||
label: localization.quoteDesign,
|
Padding(
|
||||||
initialValue: settings.defaultQuoteDesignId,
|
padding: const EdgeInsets.only(bottom: 8),
|
||||||
onSelected: (value) {
|
child: CheckboxListTile(
|
||||||
setState(() {
|
activeColor:
|
||||||
_wasQuoteDesignChanged = true;
|
Theme.of(context).colorScheme.secondary,
|
||||||
});
|
title: Text(localization.updateAllRecords),
|
||||||
viewModel.onSettingsChanged(settings.rebuild(
|
value: _updateAllQuoteDesigns,
|
||||||
(b) => b..defaultQuoteDesignId = value.id));
|
onChanged: (value) => setState(
|
||||||
},
|
() => _updateAllQuoteDesigns = value,
|
||||||
),
|
),
|
||||||
if (!isFiltered &&
|
|
||||||
_wasQuoteDesignChanged &&
|
|
||||||
state.userCompany.isAdmin)
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(bottom: 8),
|
|
||||||
child: CheckboxListTile(
|
|
||||||
activeColor: Theme.of(context).colorScheme.secondary,
|
|
||||||
title: Text(localization.updateAllRecords),
|
|
||||||
value: _updateAllQuoteDesigns,
|
|
||||||
onChanged: (value) => setState(
|
|
||||||
() => _updateAllQuoteDesigns = value,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
],
|
||||||
|
if (company.isModuleEnabled(EntityType.credit)) ...[
|
||||||
|
DesignPicker(
|
||||||
|
label: localization.creditDesign,
|
||||||
|
initialValue: settings.defaultCreditDesignId,
|
||||||
|
onSelected: (value) {
|
||||||
|
setState(() {
|
||||||
|
_wasCreditDesignChanged = true;
|
||||||
|
});
|
||||||
|
viewModel.onSettingsChanged(settings.rebuild(
|
||||||
|
(b) => b..defaultCreditDesignId = value.id));
|
||||||
|
},
|
||||||
),
|
),
|
||||||
],
|
if (!isFiltered &&
|
||||||
if (company.isModuleEnabled(EntityType.credit)) ...[
|
_wasCreditDesignChanged &&
|
||||||
DesignPicker(
|
state.userCompany.isAdmin)
|
||||||
label: localization.creditDesign,
|
Padding(
|
||||||
initialValue: settings.defaultCreditDesignId,
|
padding: const EdgeInsets.only(bottom: 8),
|
||||||
onSelected: (value) {
|
child: CheckboxListTile(
|
||||||
setState(() {
|
activeColor:
|
||||||
_wasCreditDesignChanged = true;
|
Theme.of(context).colorScheme.secondary,
|
||||||
});
|
title: Text(localization.updateAllRecords),
|
||||||
viewModel.onSettingsChanged(settings.rebuild(
|
value: _updateAllCreditDesigns,
|
||||||
(b) => b..defaultCreditDesignId = value.id));
|
onChanged: (value) => setState(
|
||||||
},
|
() => _updateAllCreditDesigns = value,
|
||||||
),
|
),
|
||||||
if (!isFiltered &&
|
|
||||||
_wasCreditDesignChanged &&
|
|
||||||
state.userCompany.isAdmin)
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(bottom: 8),
|
|
||||||
child: CheckboxListTile(
|
|
||||||
activeColor: Theme.of(context).colorScheme.secondary,
|
|
||||||
title: Text(localization.updateAllRecords),
|
|
||||||
value: _updateAllCreditDesigns,
|
|
||||||
onChanged: (value) => setState(
|
|
||||||
() => _updateAllCreditDesigns = value,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
] else
|
||||||
|
OutlinedButton(
|
||||||
|
child: Text(localization.setDefaultDesign.toUpperCase()),
|
||||||
|
onPressed: () {
|
||||||
|
store.dispatch(ViewSettings(
|
||||||
|
company: state.company,
|
||||||
|
section: kSettingsCompanyDetails,
|
||||||
|
tabIndex: 3,
|
||||||
|
));
|
||||||
|
},
|
||||||
|
),
|
||||||
AppDropdownButton(
|
AppDropdownButton(
|
||||||
labelText: localization.pageLayout,
|
labelText: localization.pageLayout,
|
||||||
value: settings.pageLayout,
|
value: settings.pageLayout,
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,8 @@ 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
|
||||||
'add_gateway': 'Add Gateway',
|
'set_default_design': 'Set Default Design',
|
||||||
|
'add_gateway': 'Add Gateway',
|
||||||
'add_gateway_help_message':
|
'add_gateway_help_message':
|
||||||
'Add a payment gateway (ie. Stripe, WePay or PayPal) to accept online payments',
|
'Add a payment gateway (ie. Stripe, WePay or PayPal) to accept online payments',
|
||||||
'left': 'Left',
|
'left': 'Left',
|
||||||
|
|
@ -70523,6 +70524,10 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
||||||
_localizedValues[localeCode]['add_gateway'] ??
|
_localizedValues[localeCode]['add_gateway'] ??
|
||||||
_localizedValues['en']['add_gateway'];
|
_localizedValues['en']['add_gateway'];
|
||||||
|
|
||||||
|
String get setDefaultDesign =>
|
||||||
|
_localizedValues[localeCode]['set_default_design'] ??
|
||||||
|
_localizedValues['en']['set_default_design'];
|
||||||
|
|
||||||
String get addGatewayHelpMessage =>
|
String get addGatewayHelpMessage =>
|
||||||
_localizedValues[localeCode]['add_gateway_help_message'] ??
|
_localizedValues[localeCode]['add_gateway_help_message'] ??
|
||||||
_localizedValues['en']['add_gateway_help_message'];
|
_localizedValues['en']['add_gateway_help_message'];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue