Student Reviews
( 5 Of 5 )
1 review
Video of 97- Flutter State Management - Provider - select extension method(Arabic) in Flutter course by Code2Start - Mohamed Fathy Taha channel, video No. 97 free certified online
In this lecture I'ill talk about provider select extension method.
Watch a value of type T exposed from a provider, and listen only partially to changes.
select must be used only inside the build method of a widget. It will not work inside other life-cycles, including State.didChangeDependencies.
By using select, instead of watching the entire object, the listener will rebuild only if the value returned by selector changes.
When a provider emits an update, it will call synchronously all selector.
Then, if they return a value different from the previously returned value, the dependent will be marked as needing to rebuild.
source code
https://github.com/code2start/Flutter-State-Management/tree/lesson20-provider-lesson7