Full width task editor
This commit is contained in:
parent
33cf1d76c5
commit
4b514e04c5
|
|
@ -43,6 +43,11 @@ class _TaskEditDesktopState extends State<TaskEditDesktop> {
|
||||||
final _debouncer = Debouncer();
|
final _debouncer = Debouncer();
|
||||||
List<TextEditingController> _controllers = [];
|
List<TextEditingController> _controllers = [];
|
||||||
|
|
||||||
|
int _dateUpdatedAt = 0;
|
||||||
|
int _startUpdatedAt = 0;
|
||||||
|
int _endUpdatedAt = 0;
|
||||||
|
int _durationUpdateAt = 0;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void didChangeDependencies() {
|
void didChangeDependencies() {
|
||||||
_controllers = [
|
_controllers = [
|
||||||
|
|
@ -276,6 +281,9 @@ class _TaskEditDesktopState extends State<TaskEditDesktop> {
|
||||||
print('## date - onSelected: $date');
|
print('## date - onSelected: $date');
|
||||||
final taskTime = taskTimes[index].copyWithDate(date);
|
final taskTime = taskTimes[index].copyWithDate(date);
|
||||||
viewModel.onUpdatedTaskTime(taskTime, index);
|
viewModel.onUpdatedTaskTime(taskTime, index);
|
||||||
|
setState(() {
|
||||||
|
_dateUpdatedAt = DateTime.now().millisecondsSinceEpoch;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
@ -289,6 +297,9 @@ class _TaskEditDesktopState extends State<TaskEditDesktop> {
|
||||||
print('## start date - onSelected: $timeOfDay');
|
print('## start date - onSelected: $timeOfDay');
|
||||||
final taskTime = taskTimes[index].copyWithStartDateTime(timeOfDay);
|
final taskTime = taskTimes[index].copyWithStartDateTime(timeOfDay);
|
||||||
viewModel.onUpdatedTaskTime(taskTime, index);
|
viewModel.onUpdatedTaskTime(taskTime, index);
|
||||||
|
setState(() {
|
||||||
|
_startUpdatedAt = DateTime.now().millisecondsSinceEpoch;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
@ -298,23 +309,23 @@ class _TaskEditDesktopState extends State<TaskEditDesktop> {
|
||||||
//key: ValueKey('$_startDate$_durationChanged'),
|
//key: ValueKey('$_startDate$_durationChanged'),
|
||||||
selectedDate: taskTimes[index].startDate,
|
selectedDate: taskTimes[index].startDate,
|
||||||
selectedDateTime: taskTimes[index].endDate,
|
selectedDateTime: taskTimes[index].endDate,
|
||||||
//allowClearing: true,
|
|
||||||
onSelected: (timeOfDay) {
|
onSelected: (timeOfDay) {
|
||||||
print('## end date - onSelected: $timeOfDay');
|
print('## end date - onSelected: $timeOfDay');
|
||||||
final taskTime = taskTimes[index].copyWithEndDateTime(timeOfDay);
|
final taskTime = taskTimes[index].copyWithEndDateTime(timeOfDay);
|
||||||
viewModel.onUpdatedTaskTime(taskTime, index);
|
viewModel.onUpdatedTaskTime(taskTime, index);
|
||||||
|
setState(() {
|
||||||
|
_endUpdatedAt = DateTime.now().millisecondsSinceEpoch;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(right: kTableColumnGap),
|
padding: const EdgeInsets.only(right: kTableColumnGap),
|
||||||
child: DurationPicker(
|
child: DurationPicker(
|
||||||
//key: ValueKey(_endDateChanged),
|
key: ValueKey('__${_startUpdatedAt}_${_endUpdatedAt}__'),
|
||||||
//allowClearing: true,
|
|
||||||
onSelected: (Duration duration) {
|
onSelected: (Duration duration) {
|
||||||
setState(() {
|
setState(() {
|
||||||
//_endDate = _startDate.add(duration);
|
_durationUpdateAt = DateTime.now().millisecondsSinceEpoch;
|
||||||
//_durationChanged = DateTime.now();
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
selectedDuration: (taskTimes[index].startDate == null ||
|
selectedDuration: (taskTimes[index].startDate == null ||
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue