diff --git a/lib/content_views/task_list_page.dart b/lib/content_views/task_list_page.dart index c9e0119..eee2361 100644 --- a/lib/content_views/task_list_page.dart +++ b/lib/content_views/task_list_page.dart @@ -419,20 +419,24 @@ class _TaskListPageState extends State { } bool isTaskActive(int index) { - var currentTaskInfo = _taskList[index]; + if (!widget.readOnly) { + var currentTaskInfo = _taskList[index]; - if (currentTaskInfo.completed && !currentTaskInfo.task.reenter!) return false; + if (currentTaskInfo.completed && !currentTaskInfo.task.reenter!) return false; - for (var taskInfo in _taskList) - { - if (taskInfo == currentTaskInfo) break; + for (var taskInfo in _taskList) + { + if (taskInfo == currentTaskInfo) break; - if (!taskInfo.task.opt! && !taskInfo.completed) return false; + if (!taskInfo.task.opt! && !taskInfo.completed) return false; + } + + if (currentTaskInfo.task.reenter!) return true; + + return true; } - if (currentTaskInfo.task.reenter!) return true; - - return true; + return false; } _sendArrivedMessage(TaskInfo taskInfo) { diff --git a/lib/content_views/tour_list_page.dart b/lib/content_views/tour_list_page.dart index a0e3d2e..ab3e6f2 100644 --- a/lib/content_views/tour_list_page.dart +++ b/lib/content_views/tour_list_page.dart @@ -162,7 +162,9 @@ class _TourListPageState extends State { contentPadding: const EdgeInsets.all(0), onTap: () { if (tourActive) { - _clicked(tour); + _clicked(tour, false); + } else { + _clicked(tour, true); } }, title: Container( @@ -198,8 +200,7 @@ class _TourListPageState extends State { return tourWidgets; } - void _clicked(JobTour tour) { - MessageService().publish(Constants.messageTopicPushContentView, - arguments: TourDetailsPage(job: widget.job, tour: tour, readOnly: tour.state != 0)); + void _clicked(JobTour tour, bool readOnly) { + MessageService().publish(Constants.messageTopicPushContentView, arguments: TourDetailsPage(job: widget.job, tour: tour, readOnly: readOnly)); } } diff --git a/pubspec.lock b/pubspec.lock index 8d54706..3f80b43 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -34,7 +34,7 @@ packages: source: hosted version: "1.2.2" archive: - dependency: transitive + dependency: "direct main" description: name: archive sha256: "22600aa1e926be775fa5fe7e6894e7fb3df9efda8891c73f70fb3262399a432d"