Schedules
This commit is contained in:
parent
679e3ee6bb
commit
ec1274b6b5
|
|
@ -102,6 +102,7 @@ class _ScheduleEditState extends State<ScheduleEdit> {
|
||||||
return ScrollableListView(
|
return ScrollableListView(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
FormCard(
|
FormCard(
|
||||||
|
isLast: schedule.template.isEmpty,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
DecoratedFormField(
|
DecoratedFormField(
|
||||||
keyboardType: TextInputType.text,
|
keyboardType: TextInputType.text,
|
||||||
|
|
@ -123,6 +124,15 @@ class _ScheduleEditState extends State<ScheduleEdit> {
|
||||||
child: Text(localization.lookup(entry.value)),
|
child: Text(localization.lookup(entry.value)),
|
||||||
))
|
))
|
||||||
.toList()),
|
.toList()),
|
||||||
|
DatePicker(
|
||||||
|
labelText: localization.nextRun,
|
||||||
|
onSelected: (date, _) {
|
||||||
|
viewModel.onChanged(
|
||||||
|
schedule.rebuild((b) => b..nextRun = date));
|
||||||
|
},
|
||||||
|
selectedDate: schedule.nextRun,
|
||||||
|
firstDate: DateTime.now(),
|
||||||
|
),
|
||||||
AppDropdownButton<String>(
|
AppDropdownButton<String>(
|
||||||
labelText: localization.frequency,
|
labelText: localization.frequency,
|
||||||
value: schedule.frequencyId,
|
value: schedule.frequencyId,
|
||||||
|
|
@ -140,16 +150,8 @@ class _ScheduleEditState extends State<ScheduleEdit> {
|
||||||
.toList()),
|
.toList()),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
if (schedule.template.isNotEmpty) ...[
|
||||||
FormCard(children: [
|
FormCard(children: [
|
||||||
DatePicker(
|
|
||||||
labelText: localization.nextSendDate,
|
|
||||||
onSelected: (date, _) {
|
|
||||||
viewModel.onChanged(
|
|
||||||
schedule.rebuild((b) => b..nextRun = date));
|
|
||||||
},
|
|
||||||
selectedDate: schedule.nextRun,
|
|
||||||
firstDate: DateTime.now(),
|
|
||||||
),
|
|
||||||
AppDropdownButton<DateRange>(
|
AppDropdownButton<DateRange>(
|
||||||
labelText: localization.dateRange,
|
labelText: localization.dateRange,
|
||||||
blankValue: null,
|
blankValue: null,
|
||||||
|
|
@ -208,7 +210,8 @@ class _ScheduleEditState extends State<ScheduleEdit> {
|
||||||
isLast: true,
|
isLast: true,
|
||||||
children: [
|
children: [
|
||||||
ClientPicker(
|
ClientPicker(
|
||||||
key: ValueKey('__client_picker_${_clientClearedAt}__'),
|
key:
|
||||||
|
ValueKey('__client_picker_${_clientClearedAt}__'),
|
||||||
isRequired: false,
|
isRequired: false,
|
||||||
clientId: null,
|
clientId: null,
|
||||||
clientState: state.clientState,
|
clientState: state.clientState,
|
||||||
|
|
@ -218,7 +221,8 @@ class _ScheduleEditState extends State<ScheduleEdit> {
|
||||||
(b) => b..parameters.clients.add(value.id)));
|
(b) => b..parameters.clients.add(value.id)));
|
||||||
}
|
}
|
||||||
setState(() {
|
setState(() {
|
||||||
_clientClearedAt = DateTime.now().toIso8601String();
|
_clientClearedAt =
|
||||||
|
DateTime.now().toIso8601String();
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
SizedBox(height: 20),
|
SizedBox(height: 20),
|
||||||
|
|
@ -231,14 +235,15 @@ class _ScheduleEditState extends State<ScheduleEdit> {
|
||||||
trailing: IconButton(
|
trailing: IconButton(
|
||||||
icon: Icon(Icons.clear),
|
icon: Icon(Icons.clear),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
viewModel.onChanged(schedule.rebuild(
|
viewModel.onChanged(schedule.rebuild((b) =>
|
||||||
(b) => b..parameters.clients.remove(clientId)));
|
b..parameters.clients.remove(clientId)));
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
],
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ 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
|
||||||
|
'next_run': 'Next Run',
|
||||||
'all_clients': 'All Clients',
|
'all_clients': 'All Clients',
|
||||||
'show_aging_table': 'Show Aging Table',
|
'show_aging_table': 'Show Aging Table',
|
||||||
'show_payments_table': 'Show Payments Table',
|
'show_payments_table': 'Show Payments Table',
|
||||||
|
|
@ -94529,6 +94530,10 @@ String get allClients =>
|
||||||
_localizedValues[localeCode]['all_clients'] ??
|
_localizedValues[localeCode]['all_clients'] ??
|
||||||
_localizedValues['en']['all_clients'];
|
_localizedValues['en']['all_clients'];
|
||||||
|
|
||||||
|
String get nextRun =>
|
||||||
|
_localizedValues[localeCode]['next_run'] ??
|
||||||
|
_localizedValues['en']['next_run'];
|
||||||
|
|
||||||
// STARTER: lang field - do not remove comment
|
// STARTER: lang field - do not remove comment
|
||||||
|
|
||||||
String lookup(String key) {
|
String lookup(String key) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue