-
-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace tasks list providers with id-based providing #2046
Replace tasks list providers with id-based providing #2046
Conversation
…s based on client.subscribeStream()
The following could fix issue that outer list page of tasklists is not updated when tasklist title changes:
Then |
… id and uses ref.watch in its rendering
…s simple id and uses ref.watch in its rendering
…s based on client.subscribeStream()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code wise look good to me. At some of place not sure about ref.invalidate
removal so would request @gnunicorn to review once before it gets merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's fine but the title of the PR doesn't describe this ...
return const ListTile( | ||
title: Text('failed'), | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should show the error for easier debugging
return const ListTile( | |
title: Text('failed'), | |
); | |
return ListTile( | |
title: Text('Loading failed: $error'), | |
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed by 0308002
@@ -193,13 +212,11 @@ class TaskItem extends ConsumerWidget { | |||
); | |||
} | |||
|
|||
Key doneKey() { | |||
final taskId = task.eventIdStr(); | |||
Key doneKey(String taskId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are not necessary. taskId
is an attribute of the widget, we don't have to pass it in.
Key doneKey(String taskId) { | |
Key doneKey() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed by 633f3a7
return Key('task-entry-$taskId-status-btn-done'); | ||
} | ||
|
||
Key notDoneKey() { | ||
final taskId = task.eventIdStr(); | ||
Key notDoneKey(String taskId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Key notDoneKey(String taskId) { | |
Key notDoneKey() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed by 633f3a7
_log.severe('failed to load tasklist', error, stack); | ||
return const Card( | ||
child: Text('failed'), | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed by 0308002
Widget title(BuildContext context, TaskList taskList) { | ||
final taskListId = taskList.eventIdStr(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnecessary, we already know taskListId
.
Widget title(BuildContext context, TaskList taskList) { | |
final taskListId = taskList.eventIdStr(); | |
Widget title(BuildContext context, TaskList taskList) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed by 633f3a7
ref.invalidate()
about parts that were added after 1st version ofsubscribeStream
replacing