📱 Flutter Intermediate

What is the Provider package in Flutter?

Why Interviewers Ask This

Candidates at the intermediate level are expected to not only know this concept but explain the trade-offs involved. Interviewers use this question to see if you can reason about design decisions, not just recall facts.

Answer

Provider is the officially recommended state management package for Flutter. It builds on top of InheritedWidget to propagate data down the widget tree efficiently. You wrap a part of the tree with a ChangeNotifierProvider, expose a ChangeNotifier model, and any widget can access it via context.read() (one-time access) or context.watch() (subscribes to changes). When notifyListeners() is called, only the widgets watching that provider rebuild.

Pro Tip

If you're unsure about a detail, say so honestly and explain your reasoning. Interviewers respect candidates who can think through uncertainty rather than bluffing.