Support setting contact.send_email
This commit is contained in:
parent
5d386f3a06
commit
0ba7c47496
|
|
@ -197,6 +197,7 @@ class ContactEditDetailsState extends State<ContactEditDetails> {
|
|||
|
||||
final _debouncer = Debouncer();
|
||||
List<TextEditingController> _controllers = [];
|
||||
bool _sendEmail = false;
|
||||
|
||||
void _onDoneContactPressed() {
|
||||
if (widget.isDialog) {
|
||||
|
|
@ -238,6 +239,7 @@ class ContactEditDetailsState extends State<ContactEditDetails> {
|
|||
_custom2Controller.text = contact.customValue2;
|
||||
_custom3Controller.text = contact.customValue3;
|
||||
_custom4Controller.text = contact.customValue4;
|
||||
_sendEmail = contact.sendEmail;
|
||||
|
||||
_controllers
|
||||
.forEach((dynamic controller) => controller.addListener(_onChanged));
|
||||
|
|
@ -389,6 +391,21 @@ class ContactEditDetailsState extends State<ContactEditDetails> {
|
|||
value: widget.contact.customValue4,
|
||||
onSavePressed: (_) => _onDoneContactPressed(),
|
||||
),
|
||||
if (widget.isDialog)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 20),
|
||||
child: SwitchListTile(
|
||||
activeColor: Theme.of(context).accentColor,
|
||||
title: Text(localization.addToInvoices),
|
||||
value: _sendEmail,
|
||||
onChanged: (value) {
|
||||
viewModel.onChangedContact(
|
||||
widget.contact.rebuild((b) => b..sendEmail = value),
|
||||
widget.index,
|
||||
);
|
||||
setState(() => _sendEmail = value);
|
||||
}),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
|||
static final Map<String, Map<String, String>> _localizedValues = {
|
||||
'en': {
|
||||
// STARTER: lang key - do not remove comment
|
||||
'add_to_invoices': 'Add to Invoices',
|
||||
'acss': 'ACSS',
|
||||
'becs': 'BECS',
|
||||
'bulk_download': 'Download',
|
||||
|
|
@ -62751,6 +62752,10 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
|||
String get becs =>
|
||||
_localizedValues[localeCode]['becs'] ?? _localizedValues['en']['becs'];
|
||||
|
||||
String get addToInvoices =>
|
||||
_localizedValues[localeCode]['add_to_invoices'] ??
|
||||
_localizedValues['en']['add_to_invoices'];
|
||||
|
||||
// STARTER: lang field - do not remove comment
|
||||
|
||||
String lookup(String key) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue