diff --git a/lib/constants.dart b/lib/constants.dart index ab74a2156..7c2d982a8 100644 --- a/lib/constants.dart +++ b/lib/constants.dart @@ -50,6 +50,7 @@ const String kCronsHelpUrl = 'https://invoiceninja.github.io/selfhost.html#cron-configuration'; const String kGitHubDiffUrl = 'https://github.com/invoiceninja/invoiceninja/compare/vVERSION...v5-stable'; +const String kGitHubLangUrl = 'https://github.com/invoiceninja/invoiceninja/blob/master/resources/lang/en/texts.php'; enum AppEnvironment { hosted, diff --git a/lib/data/models/company_model.dart b/lib/data/models/company_model.dart index 6848f82e5..c48327246 100644 --- a/lib/data/models/company_model.dart +++ b/lib/data/models/company_model.dart @@ -1239,9 +1239,6 @@ abstract class SettingsEntity emailBodyReminderEndless: clientSettings?.emailBodyReminderEndless ?? groupSettings?.emailBodyReminderEndless ?? companySettings?.emailBodyReminderEndless, - customPaymentTerms: clientSettings?.customPaymentTerms ?? - groupSettings?.customPaymentTerms ?? - companySettings?.customPaymentTerms, pdfVariables: clientSettings?.pdfVariables ?? groupSettings?.pdfVariables ?? companySettings?.pdfVariables, @@ -1966,11 +1963,6 @@ abstract class SettingsEntity @BuiltValueField(wireName: 'portal_custom_js') String get clientPortalCustomJs; - // TODO remove this field - @nullable - @BuiltValueField(wireName: 'custom_payment_terms') - BuiltList get customPaymentTerms; - // TODO remove this field @nullable @BuiltValueField(wireName: 'has_custom_design1_HIDDEN') diff --git a/lib/data/models/company_model.g.dart b/lib/data/models/company_model.g.dart index eac6897e5..13bd696dc 100644 --- a/lib/data/models/company_model.g.dart +++ b/lib/data/models/company_model.g.dart @@ -2117,13 +2117,6 @@ class _$SettingsEntitySerializer ..add(serializers.serialize(object.clientPortalCustomJs, specifiedType: const FullType(String))); } - if (object.customPaymentTerms != null) { - result - ..add('custom_payment_terms') - ..add(serializers.serialize(object.customPaymentTerms, - specifiedType: const FullType( - BuiltList, const [const FullType(PaymentTermEntity)]))); - } if (object.hasCustomDesign1 != null) { result ..add('has_custom_design1_HIDDEN') @@ -2846,12 +2839,6 @@ class _$SettingsEntitySerializer result.clientPortalCustomJs = serializers.deserialize(value, specifiedType: const FullType(String)) as String; break; - case 'custom_payment_terms': - result.customPaymentTerms.replace(serializers.deserialize(value, - specifiedType: const FullType( - BuiltList, const [const FullType(PaymentTermEntity)])) - as BuiltList); - break; case 'has_custom_design1_HIDDEN': result.hasCustomDesign1 = serializers.deserialize(value, specifiedType: const FullType(bool)) as bool; @@ -5279,8 +5266,6 @@ class _$SettingsEntity extends SettingsEntity { @override final String clientPortalCustomJs; @override - final BuiltList customPaymentTerms; - @override final bool hasCustomDesign1; @override final bool hasCustomDesign2; @@ -5462,7 +5447,6 @@ class _$SettingsEntity extends SettingsEntity { this.clientPortalCustomCss, this.clientPortalCustomFooter, this.clientPortalCustomJs, - this.customPaymentTerms, this.hasCustomDesign1, this.hasCustomDesign2, this.hasCustomDesign3}) @@ -5654,7 +5638,6 @@ class _$SettingsEntity extends SettingsEntity { clientPortalCustomCss == other.clientPortalCustomCss && clientPortalCustomFooter == other.clientPortalCustomFooter && clientPortalCustomJs == other.clientPortalCustomJs && - customPaymentTerms == other.customPaymentTerms && hasCustomDesign1 == other.hasCustomDesign1 && hasCustomDesign2 == other.hasCustomDesign2 && hasCustomDesign3 == other.hasCustomDesign3; @@ -5681,23 +5664,23 @@ class _$SettingsEntity extends SettingsEntity { $jc( $jc( $jc( - $jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc(0, timezoneId.hashCode), dateFormatId.hashCode), enableMilitaryTime.hashCode), languageId.hashCode), showCurrencyCode.hashCode), currencyId.hashCode), customValue1.hashCode), customValue2.hashCode), customValue3.hashCode), customValue4.hashCode), defaultPaymentTerms.hashCode), companyGatewayIds.hashCode), defaultTaskRate.hashCode), sendReminders.hashCode), enablePortal.hashCode), enablePortalDashboard.hashCode), enablePortalTasks.hashCode), emailStyle.hashCode), replyToEmail.hashCode), bccEmail.hashCode), pdfEmailAttachment.hashCode), ublEmailAttachment.hashCode), documentEmailAttachment.hashCode), emailStyleCustom.hashCode), customMessageDashboard.hashCode), customMessageUnpaidInvoice.hashCode), customMessagePaidInvoice.hashCode), customMessageUnapprovedQuote.hashCode), autoArchiveInvoice.hashCode), autoArchiveQuote.hashCode), autoEmailInvoice.hashCode), autoConvertQuote.hashCode), enableInclusiveTaxes.hashCode), translations.hashCode), taskNumberPattern.hashCode), taskNumberCounter.hashCode), expenseNumberPattern.hashCode), expenseNumberCounter.hashCode), vendorNumberPattern.hashCode), vendorNumberCounter.hashCode), ticketNumberPattern.hashCode), ticketNumberCounter.hashCode), paymentNumberPattern.hashCode), paymentNumberCounter.hashCode), projectNumberPattern.hashCode), projectNumberCounter.hashCode), invoiceNumberPattern.hashCode), invoiceNumberCounter.hashCode), recurringInvoiceNumberPattern.hashCode), recurringInvoiceNumberCounter.hashCode), quoteNumberPattern.hashCode), quoteNumberCounter.hashCode), clientNumberPattern.hashCode), clientNumberCounter.hashCode), creditNumberPattern.hashCode), creditNumberCounter.hashCode), recurringNumberPrefix.hashCode), resetCounterFrequencyId.hashCode), resetCounterDate.hashCode), counterPadding.hashCode), sharedInvoiceQuoteCounter.hashCode), defaultInvoiceTerms.hashCode), defaultQuoteTerms.hashCode), defaultQuoteFooter.hashCode), defaultCreditTerms.hashCode), defaultCreditFooter.hashCode), defaultInvoiceDesignId.hashCode), defaultQuoteDesignId.hashCode), defaultCreditDesignId.hashCode), defaultInvoiceFooter.hashCode), defaultTaxName1.hashCode), defaultTaxRate1.hashCode), defaultTaxName2.hashCode), defaultTaxRate2.hashCode), defaultTaxName3.hashCode), defaultTaxRate3.hashCode), defaultPaymentTypeId.hashCode), invoiceFields.hashCode), pdfVariables.hashCode), emailSignature.hashCode), emailSubjectInvoice.hashCode), emailSubjectQuote.hashCode), emailSubjectPayment.hashCode), emailSubjectPaymentPartial.hashCode), emailBodyInvoice.hashCode), emailBodyQuote.hashCode), emailBodyPayment.hashCode), emailBodyPaymentPartial.hashCode), emailSubjectReminder1.hashCode), emailSubjectReminder2.hashCode), emailSubjectReminder3.hashCode), emailBodyReminder1.hashCode), emailBodyReminder2.hashCode), emailBodyReminder3.hashCode), emailSubjectCustom1.hashCode), emailBodyCustom1.hashCode), emailSubjectCustom2.hashCode), emailBodyCustom2.hashCode), emailSubjectCustom3.hashCode), emailBodyCustom3.hashCode), emailSubjectStatement.hashCode), emailBodyStatement.hashCode), enablePortalPassword.hashCode), signatureOnPdf.hashCode), enableEmailMarkup.hashCode), showAcceptInvoiceTerms.hashCode), showAcceptQuoteTerms.hashCode), requireInvoiceSignature.hashCode), requireQuoteSignature.hashCode), name.hashCode), companyLogo.hashCode), website.hashCode), address1.hashCode), address2.hashCode), city.hashCode), state.hashCode), postalCode.hashCode), phone.hashCode), email.hashCode), countryId.hashCode), vatNumber.hashCode), idNumber.hashCode), pageSize.hashCode), fontSize.hashCode), primaryColor.hashCode), secondaryColor.hashCode), primaryFont.hashCode), secondaryFont.hashCode), hidePaidToDate.hashCode), embedDocuments.hashCode), allPagesHeader.hashCode), allPagesFooter.hashCode), enableReminder1.hashCode), enableReminder2.hashCode), enableReminder3.hashCode), enableReminderEndless.hashCode), numDaysReminder1.hashCode), numDaysReminder2.hashCode), numDaysReminder3.hashCode), scheduleReminder1.hashCode), scheduleReminder2.hashCode), scheduleReminder3.hashCode), endlessReminderFrequencyId.hashCode), lateFeeAmount1.hashCode), lateFeeAmount2.hashCode), lateFeeAmount3.hashCode), lateFeeAmountEndless.hashCode), lateFeePercent1.hashCode), lateFeePercent2.hashCode), lateFeePercent3.hashCode), lateFeePercentEndless.hashCode), emailSubjectReminderEndless.hashCode), emailBodyReminderEndless.hashCode), clientOnlinePaymentNotification.hashCode), clientManualPaymentNotification.hashCode), counterNumberApplied.hashCode), - emailSendingMethod.hashCode), - gmailSendingUserId.hashCode), - clientPortalTerms.hashCode), - clientPortalPrivacy.hashCode), - lockInvoices.hashCode), - autoBill.hashCode), - clientPortalAllowUnderPayment.hashCode), - clientPortalAllowOverPayment.hashCode), - autoBillDate.hashCode), - clientPortalUnderPaymentMinimum.hashCode), - useCreditsPayment.hashCode), - clientPortalCustomHeader.hashCode), - clientPortalCustomCss.hashCode), - clientPortalCustomFooter.hashCode), - clientPortalCustomJs.hashCode), - customPaymentTerms.hashCode), + $jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc(0, timezoneId.hashCode), dateFormatId.hashCode), enableMilitaryTime.hashCode), languageId.hashCode), showCurrencyCode.hashCode), currencyId.hashCode), customValue1.hashCode), customValue2.hashCode), customValue3.hashCode), customValue4.hashCode), defaultPaymentTerms.hashCode), companyGatewayIds.hashCode), defaultTaskRate.hashCode), sendReminders.hashCode), enablePortal.hashCode), enablePortalDashboard.hashCode), enablePortalTasks.hashCode), emailStyle.hashCode), replyToEmail.hashCode), bccEmail.hashCode), pdfEmailAttachment.hashCode), ublEmailAttachment.hashCode), documentEmailAttachment.hashCode), emailStyleCustom.hashCode), customMessageDashboard.hashCode), customMessageUnpaidInvoice.hashCode), customMessagePaidInvoice.hashCode), customMessageUnapprovedQuote.hashCode), autoArchiveInvoice.hashCode), autoArchiveQuote.hashCode), autoEmailInvoice.hashCode), autoConvertQuote.hashCode), enableInclusiveTaxes.hashCode), translations.hashCode), taskNumberPattern.hashCode), taskNumberCounter.hashCode), expenseNumberPattern.hashCode), expenseNumberCounter.hashCode), vendorNumberPattern.hashCode), vendorNumberCounter.hashCode), ticketNumberPattern.hashCode), ticketNumberCounter.hashCode), paymentNumberPattern.hashCode), paymentNumberCounter.hashCode), projectNumberPattern.hashCode), projectNumberCounter.hashCode), invoiceNumberPattern.hashCode), invoiceNumberCounter.hashCode), recurringInvoiceNumberPattern.hashCode), recurringInvoiceNumberCounter.hashCode), quoteNumberPattern.hashCode), quoteNumberCounter.hashCode), clientNumberPattern.hashCode), clientNumberCounter.hashCode), creditNumberPattern.hashCode), creditNumberCounter.hashCode), recurringNumberPrefix.hashCode), resetCounterFrequencyId.hashCode), resetCounterDate.hashCode), counterPadding.hashCode), sharedInvoiceQuoteCounter.hashCode), defaultInvoiceTerms.hashCode), defaultQuoteTerms.hashCode), defaultQuoteFooter.hashCode), defaultCreditTerms.hashCode), defaultCreditFooter.hashCode), defaultInvoiceDesignId.hashCode), defaultQuoteDesignId.hashCode), defaultCreditDesignId.hashCode), defaultInvoiceFooter.hashCode), defaultTaxName1.hashCode), defaultTaxRate1.hashCode), defaultTaxName2.hashCode), defaultTaxRate2.hashCode), defaultTaxName3.hashCode), defaultTaxRate3.hashCode), defaultPaymentTypeId.hashCode), invoiceFields.hashCode), pdfVariables.hashCode), emailSignature.hashCode), emailSubjectInvoice.hashCode), emailSubjectQuote.hashCode), emailSubjectPayment.hashCode), emailSubjectPaymentPartial.hashCode), emailBodyInvoice.hashCode), emailBodyQuote.hashCode), emailBodyPayment.hashCode), emailBodyPaymentPartial.hashCode), emailSubjectReminder1.hashCode), emailSubjectReminder2.hashCode), emailSubjectReminder3.hashCode), emailBodyReminder1.hashCode), emailBodyReminder2.hashCode), emailBodyReminder3.hashCode), emailSubjectCustom1.hashCode), emailBodyCustom1.hashCode), emailSubjectCustom2.hashCode), emailBodyCustom2.hashCode), emailSubjectCustom3.hashCode), emailBodyCustom3.hashCode), emailSubjectStatement.hashCode), emailBodyStatement.hashCode), enablePortalPassword.hashCode), signatureOnPdf.hashCode), enableEmailMarkup.hashCode), showAcceptInvoiceTerms.hashCode), showAcceptQuoteTerms.hashCode), requireInvoiceSignature.hashCode), requireQuoteSignature.hashCode), name.hashCode), companyLogo.hashCode), website.hashCode), address1.hashCode), address2.hashCode), city.hashCode), state.hashCode), postalCode.hashCode), phone.hashCode), email.hashCode), countryId.hashCode), vatNumber.hashCode), idNumber.hashCode), pageSize.hashCode), fontSize.hashCode), primaryColor.hashCode), secondaryColor.hashCode), primaryFont.hashCode), secondaryFont.hashCode), hidePaidToDate.hashCode), embedDocuments.hashCode), allPagesHeader.hashCode), allPagesFooter.hashCode), enableReminder1.hashCode), enableReminder2.hashCode), enableReminder3.hashCode), enableReminderEndless.hashCode), numDaysReminder1.hashCode), numDaysReminder2.hashCode), numDaysReminder3.hashCode), scheduleReminder1.hashCode), scheduleReminder2.hashCode), scheduleReminder3.hashCode), endlessReminderFrequencyId.hashCode), lateFeeAmount1.hashCode), lateFeeAmount2.hashCode), lateFeeAmount3.hashCode), lateFeeAmountEndless.hashCode), lateFeePercent1.hashCode), lateFeePercent2.hashCode), lateFeePercent3.hashCode), lateFeePercentEndless.hashCode), emailSubjectReminderEndless.hashCode), emailBodyReminderEndless.hashCode), clientOnlinePaymentNotification.hashCode), clientManualPaymentNotification.hashCode), + counterNumberApplied.hashCode), + emailSendingMethod.hashCode), + gmailSendingUserId.hashCode), + clientPortalTerms.hashCode), + clientPortalPrivacy.hashCode), + lockInvoices.hashCode), + autoBill.hashCode), + clientPortalAllowUnderPayment.hashCode), + clientPortalAllowOverPayment.hashCode), + autoBillDate.hashCode), + clientPortalUnderPaymentMinimum.hashCode), + useCreditsPayment.hashCode), + clientPortalCustomHeader.hashCode), + clientPortalCustomCss.hashCode), + clientPortalCustomFooter.hashCode), + clientPortalCustomJs.hashCode), hasCustomDesign1.hashCode), hasCustomDesign2.hashCode), hasCustomDesign3.hashCode)); @@ -5880,7 +5863,6 @@ class _$SettingsEntity extends SettingsEntity { ..add('clientPortalCustomCss', clientPortalCustomCss) ..add('clientPortalCustomFooter', clientPortalCustomFooter) ..add('clientPortalCustomJs', clientPortalCustomJs) - ..add('customPaymentTerms', customPaymentTerms) ..add('hasCustomDesign1', hasCustomDesign1) ..add('hasCustomDesign2', hasCustomDesign2) ..add('hasCustomDesign3', hasCustomDesign3)) @@ -6724,12 +6706,6 @@ class SettingsEntityBuilder set clientPortalCustomJs(String clientPortalCustomJs) => _$this._clientPortalCustomJs = clientPortalCustomJs; - ListBuilder _customPaymentTerms; - ListBuilder get customPaymentTerms => - _$this._customPaymentTerms ??= new ListBuilder(); - set customPaymentTerms(ListBuilder customPaymentTerms) => - _$this._customPaymentTerms = customPaymentTerms; - bool _hasCustomDesign1; bool get hasCustomDesign1 => _$this._hasCustomDesign1; set hasCustomDesign1(bool hasCustomDesign1) => @@ -6920,7 +6896,6 @@ class SettingsEntityBuilder _clientPortalCustomCss = _$v.clientPortalCustomCss; _clientPortalCustomFooter = _$v.clientPortalCustomFooter; _clientPortalCustomJs = _$v.clientPortalCustomJs; - _customPaymentTerms = _$v.customPaymentTerms?.toBuilder(); _hasCustomDesign1 = _$v.hasCustomDesign1; _hasCustomDesign2 = _$v.hasCustomDesign2; _hasCustomDesign3 = _$v.hasCustomDesign3; @@ -7119,7 +7094,6 @@ class SettingsEntityBuilder clientPortalCustomCss: clientPortalCustomCss, clientPortalCustomFooter: clientPortalCustomFooter, clientPortalCustomJs: clientPortalCustomJs, - customPaymentTerms: _customPaymentTerms?.build(), hasCustomDesign1: hasCustomDesign1, hasCustomDesign2: hasCustomDesign2, hasCustomDesign3: hasCustomDesign3); @@ -7131,9 +7105,6 @@ class SettingsEntityBuilder _$failedField = 'pdfVariables'; _pdfVariables?.build(); - - _$failedField = 'customPaymentTerms'; - _customPaymentTerms?.build(); } catch (e) { throw new BuiltValueNestedFieldError( 'SettingsEntity', _$failedField, e.toString()); diff --git a/lib/data/models/serializers.g.dart b/lib/data/models/serializers.g.dart index 20b701ce4..9ece5ee5f 100644 --- a/lib/data/models/serializers.g.dart +++ b/lib/data/models/serializers.g.dart @@ -525,7 +525,6 @@ Serializers _$serializers = (new Serializers().toBuilder() const FullType(BuiltList, const [const FullType(String)]) ]), () => new MapBuilder>()) - ..addBuilderFactory(const FullType(BuiltList, const [const FullType(PaymentTermEntity)]), () => new ListBuilder()) ..addBuilderFactory(const FullType(BuiltMap, const [const FullType(String), const FullType(TaskEntity)]), () => new MapBuilder()) ..addBuilderFactory(const FullType(BuiltList, const [const FullType(String)]), () => new ListBuilder()) ..addBuilderFactory(const FullType(BuiltMap, const [const FullType(String), const FullType(TaskStatusEntity)]), () => new MapBuilder()) diff --git a/lib/ui/settings/localization_settings.dart b/lib/ui/settings/localization_settings.dart index 2948ab5d8..170fd8727 100644 --- a/lib/ui/settings/localization_settings.dart +++ b/lib/ui/settings/localization_settings.dart @@ -15,9 +15,11 @@ import 'package:invoiceninja_flutter/ui/app/forms/app_form.dart'; import 'package:invoiceninja_flutter/ui/app/forms/bool_dropdown_button.dart'; import 'package:invoiceninja_flutter/ui/settings/localization_vm.dart'; import 'package:invoiceninja_flutter/ui/app/edit_scaffold.dart'; +import 'package:invoiceninja_flutter/utils/dialogs.dart'; import 'package:invoiceninja_flutter/utils/formatting.dart'; import 'package:invoiceninja_flutter/utils/localization.dart'; import 'package:material_design_icons_flutter/material_design_icons_flutter.dart'; +import 'package:url_launcher/url_launcher.dart'; class LocalizationSettings extends StatefulWidget { const LocalizationSettings({ @@ -251,20 +253,44 @@ class _LocalizationSettingsState extends State FormCard( crossAxisAlignment: CrossAxisAlignment.start, children: [ - DropdownButtonHideUnderline( - child: DropdownButton( - items: customLabels - .map((key) => DropdownMenuItem( - child: Text(localization.lookup(key)), - value: key, - )) - .toList(), - hint: Text(localization.selectLabel), - onChanged: (value) { - viewModel.onSettingsChanged(settings - .rebuild((b) => b..translations[value] = '')); - }, - ), + Row( + children: [ + DropdownButtonHideUnderline( + child: DropdownButton( + items: customLabels + .map((key) => DropdownMenuItem( + child: Text(localization.lookup(key)), + value: key, + )) + .toList(), + hint: Text(localization.selectLabel), + onChanged: (value) { + viewModel.onSettingsChanged(settings + .rebuild((b) => b..translations[value] = '')); + }, + ), + ), + SizedBox(width: 8), + FlatButton( + child: Text(localization.addCustom), + onPressed: () { + fieldCallback( + context: context, + callback: (value) { + viewModel.onSettingsChanged(settings.rebuild( + (b) => b..translations[value] = '')); + }, + field: localization.label, + title: localization.addCustom, + secondaryActions: [ + FlatButton( + child: Text(localization.labels.toUpperCase()), + onPressed: () => launch(kGitHubLangUrl), + ) + ]); + }, + ) + ], ), SizedBox(height: 16), for (var key in translations.keys) diff --git a/lib/utils/dialogs.dart b/lib/utils/dialogs.dart index 4e237e4c5..37696c9ba 100644 --- a/lib/utils/dialogs.dart +++ b/lib/utils/dialogs.dart @@ -156,6 +156,7 @@ void fieldCallback({ String field, Function(String) callback, int maxLength, + List secondaryActions, }) { showDialog( context: context, @@ -166,6 +167,7 @@ void fieldCallback({ field: field, title: title, maxLength: maxLength, + secondaryActions: secondaryActions, ); }, ); @@ -177,12 +179,14 @@ class FieldConfirmation extends StatefulWidget { @required this.title, @required this.field, this.maxLength, + this.secondaryActions, }); final Function(String) callback; final String title; final String field; final int maxLength; + final List secondaryActions; @override _FieldConfirmationState createState() => _FieldConfirmationState(); @@ -213,6 +217,8 @@ class _FieldConfirmationState extends State { onSubmitted: (value) => _submit(), ), actions: [ + ...widget.secondaryActions ?? [], + SizedBox(width: 6), SaveCancelButtons( isHeader: false, saveLabel: localization.save.toUpperCase(), diff --git a/lib/utils/i18n.dart b/lib/utils/i18n.dart index acf8f3a07..942689322 100644 --- a/lib/utils/i18n.dart +++ b/lib/utils/i18n.dart @@ -15,6 +15,8 @@ mixin LocalizationsProvider on LocaleCodeAware { static final Map> _localizedValues = { 'en': { // STARTER: lang key - do not remove comment + 'labels': 'Labels', + 'add_custom': 'Add Custom', 'payment_tax': 'Payment Tax', 'unpaid': 'Unpaid', 'white_label': 'White Label', @@ -5217,6 +5219,10 @@ mixin LocalizationsProvider on LocaleCodeAware { String get paymentTax => _localizedValues[localeCode]['payment_tax'] ?? ''; + String get addCustom => _localizedValues[localeCode]['add_custom'] ?? ''; + + String get labels => _localizedValues[localeCode]['labels'] ?? ''; + String lookup(String key) { final lookupKey = toSnakeCase(key); diff --git a/pubspec.lock b/pubspec.lock index b66a31379..5839f2049 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -557,7 +557,7 @@ packages: name: intl url: "https://pub.dartlang.org" source: hosted - version: "0.17.0-nullsafety.2" + version: "0.16.1" io: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index ab329ed26..387f77e16 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -64,8 +64,8 @@ dependencies: extended_image: 1.3.1-dev #TODO remove # https://github.com/flutter/flutter/issues/70433#issuecomment-727154345 -dependency_overrides: - intl: ^0.17.0-nullsafety.2 +#dependency_overrides: +#vf intl: ^0.17.0-nullsafety.2 dev_dependencies: flutter_driver: