Settings
This commit is contained in:
parent
7338e5abce
commit
a45c28e203
|
|
@ -109,6 +109,11 @@ const String kGatewayTypeCustom3 = '12';
|
||||||
|
|
||||||
const String kGatewayStripe = 'd14dd26a37cecc30fdd65700bfb55b23';
|
const String kGatewayStripe = 'd14dd26a37cecc30fdd65700bfb55b23';
|
||||||
|
|
||||||
|
const String kEmailDesignPlain = 'plain';
|
||||||
|
const String kEmailDesignLight = 'light';
|
||||||
|
const String kEmailDesignDark = 'dark';
|
||||||
|
const String kEmailDesignCustom = 'custom';
|
||||||
|
|
||||||
const String kEntityStateActive = 'active';
|
const String kEntityStateActive = 'active';
|
||||||
const String kEntityStateArchived = 'archived';
|
const String kEntityStateArchived = 'archived';
|
||||||
const String kEntityStateDeleted = 'deleted';
|
const String kEntityStateDeleted = 'deleted';
|
||||||
|
|
|
||||||
|
|
@ -8,11 +8,13 @@ class BoolDropdownButton extends StatelessWidget {
|
||||||
@required this.onChanged,
|
@required this.onChanged,
|
||||||
@required this.showBlank,
|
@required this.showBlank,
|
||||||
this.enabledLabel,
|
this.enabledLabel,
|
||||||
|
this.helpLabel,
|
||||||
this.disabledLabel,
|
this.disabledLabel,
|
||||||
this.iconData,
|
this.iconData,
|
||||||
});
|
});
|
||||||
|
|
||||||
final String label;
|
final String label;
|
||||||
|
final String helpLabel;
|
||||||
final bool value;
|
final bool value;
|
||||||
final Function(bool) onChanged;
|
final Function(bool) onChanged;
|
||||||
final IconData iconData;
|
final IconData iconData;
|
||||||
|
|
@ -28,13 +30,14 @@ class BoolDropdownButton extends StatelessWidget {
|
||||||
|
|
||||||
if (!showBlank && enabledLabel == null) {
|
if (!showBlank && enabledLabel == null) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.only(top: 10),
|
padding: const EdgeInsets.only(top: 12),
|
||||||
child: SwitchListTile(
|
child: SwitchListTile(
|
||||||
title: Text(label),
|
title: Text(label),
|
||||||
value: value,
|
value: value,
|
||||||
secondary: iconData != null ? Icon(iconData) : null,
|
secondary: iconData != null ? Icon(iconData) : null,
|
||||||
onChanged: (value) => onChanged(value),
|
onChanged: (value) => onChanged(value),
|
||||||
activeColor: Theme.of(context).accentColor,
|
activeColor: Theme.of(context).accentColor,
|
||||||
|
subtitle: helpLabel != null ? Text(helpLabel) : null,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
|
import 'package:invoiceninja_flutter/constants.dart';
|
||||||
import 'package:invoiceninja_flutter/data/models/entities.dart';
|
import 'package:invoiceninja_flutter/data/models/entities.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/form_card.dart';
|
import 'package:invoiceninja_flutter/ui/app/form_card.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/forms/app_form.dart';
|
import 'package:invoiceninja_flutter/ui/app/forms/app_form.dart';
|
||||||
|
|
@ -96,7 +97,7 @@ class _EmailSettingsState extends State<EmailSettings> {
|
||||||
controller: _bccEmailController,
|
controller: _bccEmailController,
|
||||||
keyboardType: TextInputType.emailAddress,
|
keyboardType: TextInputType.emailAddress,
|
||||||
),
|
),
|
||||||
SizedBox(height: 20),
|
SizedBox(height: 10),
|
||||||
BoolDropdownButton(
|
BoolDropdownButton(
|
||||||
label: localization.attachPdf,
|
label: localization.attachPdf,
|
||||||
value: false,
|
value: false,
|
||||||
|
|
@ -119,9 +120,49 @@ class _EmailSettingsState extends State<EmailSettings> {
|
||||||
),
|
),
|
||||||
FormCard(
|
FormCard(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
|
InputDecorator(
|
||||||
|
decoration: InputDecoration(
|
||||||
|
labelText: localization.emailDesign,
|
||||||
|
),
|
||||||
|
isEmpty: false,
|
||||||
|
child: DropdownButtonHideUnderline(
|
||||||
|
child: DropdownButton<String>(
|
||||||
|
value: kEmailDesignPlain,
|
||||||
|
onChanged: (value) => null,
|
||||||
|
isExpanded: true,
|
||||||
|
isDense: true,
|
||||||
|
items: [
|
||||||
|
DropdownMenuItem(
|
||||||
|
child: Text(localization.plain),
|
||||||
|
value: kEmailDesignPlain,
|
||||||
|
),
|
||||||
|
DropdownMenuItem(
|
||||||
|
child: Text(localization.light),
|
||||||
|
value: kEmailDesignLight,
|
||||||
|
),
|
||||||
|
DropdownMenuItem(
|
||||||
|
child: Text(localization.dark),
|
||||||
|
value: kEmailDesignDark,
|
||||||
|
),
|
||||||
|
DropdownMenuItem(
|
||||||
|
child: Text(localization.custom),
|
||||||
|
value: kEmailDesignCustom,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 10),
|
||||||
|
BoolDropdownButton(
|
||||||
|
label: localization.enableMarkup,
|
||||||
|
helpLabel: localization.enableMarkupHelp,
|
||||||
|
value: false,
|
||||||
|
iconData: FontAwesomeIcons.link,
|
||||||
|
showBlank: state.settingsUIState.isFiltered,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -14,11 +14,17 @@ abstract class LocaleCodeAware {
|
||||||
mixin LocalizationsProvider on LocaleCodeAware {
|
mixin LocalizationsProvider on LocaleCodeAware {
|
||||||
static final Map<String, Map<String, String>> _localizedValues = {
|
static final Map<String, Map<String, String>> _localizedValues = {
|
||||||
'en': {
|
'en': {
|
||||||
|
'enable_email_markup_help':
|
||||||
|
'Make it easier for your clients to pay you by adding schema.org markup to your emails.',
|
||||||
|
'plain': 'Plain',
|
||||||
|
'light': 'Light',
|
||||||
|
'dark': 'Dark',
|
||||||
|
'email_design': 'Email Design',
|
||||||
'attach_pdf': 'Attach PDF',
|
'attach_pdf': 'Attach PDF',
|
||||||
'attach_documents': 'Attach Documents',
|
'attach_documents': 'Attach Documents',
|
||||||
'attach_ubl': 'Attach UBL',
|
'attach_ubl': 'Attach UBL',
|
||||||
'email_style': 'Email Style',
|
'email_style': 'Email Style',
|
||||||
'enable_markup': 'Enable Markup',
|
'enable_email_markup': 'Enable Markup',
|
||||||
'reply_to_email': 'Reply-To Email',
|
'reply_to_email': 'Reply-To Email',
|
||||||
'bcc_email': 'BCC Email',
|
'bcc_email': 'BCC Email',
|
||||||
'processed': 'Processed',
|
'processed': 'Processed',
|
||||||
|
|
@ -15028,7 +15034,19 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
||||||
|
|
||||||
String get emailStyle => _localizedValues[localeCode]['email_style'];
|
String get emailStyle => _localizedValues[localeCode]['email_style'];
|
||||||
|
|
||||||
String get enableMarkup => _localizedValues[localeCode]['enable_markup'];
|
String get enableMarkup =>
|
||||||
|
_localizedValues[localeCode]['enable_email_markup'];
|
||||||
|
|
||||||
|
String get enableMarkupHelp =>
|
||||||
|
_localizedValues[localeCode]['enable_email_markup_help'];
|
||||||
|
|
||||||
|
String get emailDesign => _localizedValues[localeCode]['email_design'];
|
||||||
|
|
||||||
|
String get plain => _localizedValues[localeCode]['plain'];
|
||||||
|
|
||||||
|
String get light => _localizedValues[localeCode]['light'];
|
||||||
|
|
||||||
|
String get dark => _localizedValues[localeCode]['dark'];
|
||||||
|
|
||||||
String lookup(String key) {
|
String lookup(String key) {
|
||||||
final lookupKey = toSnakeCase(key);
|
final lookupKey = toSnakeCase(key);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue