This commit is contained in:
Hillel Coren 2021-05-06 17:03:34 +03:00
parent f13f471d58
commit 16b7e9bf13
2 changed files with 39 additions and 19 deletions

View File

@ -87,24 +87,36 @@ class _TaskSettingsState extends State<TaskSettings> {
formKey: _formKey,
focusNode: _focusNode,
children: <Widget>[
FormCard(
children: <Widget>[
DecoratedFormField(
controller: _taskRateController,
label: localization.defaultTaskRate,
onSavePressed: viewModel.onSavePressed,
isMoney: true,
FormCard(children: <Widget>[
DecoratedFormField(
controller: _taskRateController,
label: localization.defaultTaskRate,
onSavePressed: viewModel.onSavePressed,
isMoney: true,
),
if (!viewModel.state.settingsUIState.isFiltered) ...[
SizedBox(height: 32),
SwitchListTile(
activeColor: Theme.of(context).accentColor,
title: Text(localization.autoStartTasks),
value: company.autoStartTasks,
subtitle: Text(localization.autoStartTasksHelp),
onChanged: (value) => viewModel.onCompanyChanged(
company.rebuild((b) => b..autoStartTasks = value)),
),
if (!viewModel.state.settingsUIState.isFiltered) ...[
SizedBox(height: 32),
SwitchListTile(
activeColor: Theme.of(context).accentColor,
title: Text(localization.autoStartTasks),
value: company.autoStartTasks,
subtitle: Text(localization.autoStartTasksHelp),
onChanged: (value) => viewModel.onCompanyChanged(
company.rebuild((b) => b..autoStartTasks = value)),
),
SwitchListTile(
activeColor: Theme.of(context).accentColor,
title: Text(localization.showTaskEndDate),
value: company.showTaskEndDate,
subtitle: Text(localization.showTaskEndDateHelp),
onChanged: (value) => viewModel.onCompanyChanged(
company.rebuild((b) => b..showTaskEndDate = value)),
),
]
]),
if (!viewModel.state.settingsUIState.isFiltered)
FormCard(
children: <Widget>[
SwitchListTile(
activeColor: Theme.of(context).accentColor,
title: Text(localization.showTasksTable),
@ -138,8 +150,7 @@ class _TaskSettingsState extends State<TaskSettings> {
company.rebuild((b) => b..invoiceTaskDocuments = value)),
),
],
],
),
),
if (!viewModel.state.settingsUIState.isFiltered)
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),

View File

@ -15,6 +15,8 @@ mixin LocalizationsProvider on LocaleCodeAware {
static final Map<String, Map<String, String>> _localizedValues = {
'en': {
// STARTER: lang key - do not remove comment
'show_task_end_date': 'Show Task End Date',
'show_task_end_date_help': 'Enable specifying the task end date',
'gateway_setup': 'Gateway Setup',
'preview_sidebar': 'Preview Sidebar',
'number_years_active': 'Number Years Active',
@ -60327,6 +60329,13 @@ mixin LocalizationsProvider on LocaleCodeAware {
_localizedValues[localeCode]['gateway_setup'] ??
_localizedValues['en']['gateway_setup'];
String get showTaskEndDate =>
_localizedValues[localeCode]['show_task_end_date'] ??
_localizedValues['en']['show_task_end_date'];
String get showTaskEndDateHelp =>
_localizedValues[localeCode]['show_task_end_date_help'] ??
_localizedValues['en']['show_task_end_date_help'];
String lookup(String key) {
final lookupKey = toSnakeCase(key);