River_pod: Error updating Todo item UI on todo example in profile or release mode

Created on 24 Aug 2020  路  3Comments  路  Source: rrousselGit/river_pod

The example works perfectly in debug mode, but does not rebuilds the UI in profile or release mode.
As the documentation says

/// A provider which exposes the [Todo] displayed by a [TodoItem].
///
/// By retreiving the [Todo] through a provider instead of through its
/// constructor, this allows [TodoItem] to be instantiated using the `const` keyword.
///
/// This ensures that when we add/remove/edit todos, only what the
/// impacted widgets rebuilds, instead of the entire list of items.
final _currentTodo = ScopedProvider<Todo>(null);

a provider is used instead of passing the Todo object to the constructor, but I tested and when passing the Todo object to the constructor (losing const) the UI does rebuild correctly.
My main question is why does it work in debug and not in release, and if any enhancements could be made in the docs for users to avoid this as ultimately all apps will be delivered in release mode.
Thanks for your hard work.

Additional context
Tested on flutter 1.20.2 stable and river_pod 0.7.0
file

bug

Most helpful comment

That was fast! and thank you for your contributions to the community.

All 3 comments

Thanks for the report, I can reproduce it.

It's definitely a bug. I'll investigate.

Eh, that was a dumb bug

It's fixed. Thanks again for the report!

That was fast! and thank you for your contributions to the community.

Was this page helpful?
0 / 5 - 0 ratings