mirror of
https://github.com/go-vikunja/app
synced 2024-06-05 20:19:51 +00:00
maintain updated task states
This commit is contained in:
parent
c3a7962679
commit
ad30897bb3
|
@ -17,7 +17,7 @@ class BucketTaskCard extends StatefulWidget {
|
|||
State<BucketTaskCard> createState() => _BucketTaskCardState(this.task);
|
||||
}
|
||||
|
||||
class _BucketTaskCardState extends State<BucketTaskCard> {
|
||||
class _BucketTaskCardState extends State<BucketTaskCard> with AutomaticKeepAliveClientMixin {
|
||||
Task _currentTask;
|
||||
|
||||
_BucketTaskCardState(this._currentTask)
|
||||
|
@ -25,6 +25,7 @@ class _BucketTaskCardState extends State<BucketTaskCard> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
super.build(context);
|
||||
// default chip height: 32
|
||||
const double chipHeight = 28;
|
||||
final chipConstraints = BoxConstraints(maxHeight: chipHeight);
|
||||
|
@ -185,4 +186,7 @@ class _BucketTaskCardState extends State<BucketTaskCard> {
|
|||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
bool get wantKeepAlive => _currentTask != widget.task;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import 'dart:async';
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:vikunja_app/global.dart';
|
||||
|
@ -30,7 +29,7 @@ class TaskTile extends StatefulWidget {
|
|||
TaskTileState createState() => TaskTileState(this.task);
|
||||
}
|
||||
|
||||
class TaskTileState extends State<TaskTile> {
|
||||
class TaskTileState extends State<TaskTile> with AutomaticKeepAliveClientMixin {
|
||||
Task _currentTask;
|
||||
|
||||
TaskTileState(this._currentTask)
|
||||
|
@ -38,6 +37,7 @@ class TaskTileState extends State<TaskTile> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
super.build(context);
|
||||
Duration durationUntilDue = _currentTask.dueDate.difference(DateTime.now());
|
||||
if (_currentTask.loading) {
|
||||
return ListTile(
|
||||
|
@ -113,6 +113,9 @@ class TaskTileState extends State<TaskTile> {
|
|||
done: checked,
|
||||
));
|
||||
}
|
||||
|
||||
@override
|
||||
bool get wantKeepAlive => _currentTask != widget.task;
|
||||
}
|
||||
|
||||
typedef Future<void> TaskChanged(Task task, bool newValue);
|
||||
|
|
Loading…
Reference in New Issue
Block a user