Consumer theo dõi toàn bộ provider và rebuild bất cứ khi nào nó thay đổi. Selector cho phép chỉ theo dõi một phần cụ thể của state: Selector<UserProvider, String>(selector: (_, user) => user.name, ...) chỉ rebuild khi name thay đổi, không phải khi age thay đổi.
Kiểm soát chi tiết này ngăn rebuild không cần thiết và cải thiện hiệu năng trong provider phức tạp.
Consumer watches an entire provider and rebuilds whenever it changes. Selector lets you watch only a specific part of state, rebuilding only when that specific slice changes.
This fine-grained control prevents unnecessary rebuilds and improves performance in complex providers.