'using provider : selector with list in flutter
My question is about using provider in flutter, now I have a list of 100 items and in every time I get any update, the provider replace the whole list. So, my question is how to use provider in a list without needing to re-rendering the whole list items?!!
Solution 1:[1]
see Consumer/Selector at https://pub.dev/packages/provider
Foo(
child: Consumer<A>(
builder: (_, a, child) {
return Bar(a: a, child: child);
},
child: Baz(),
),
)
In this example, only Bar will rebuild when A updates. Foo and Baz won't unnecessarily rebuild.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Mohamed Oussous |
