Are global variables bad?
Well, it depends.
In my projects, I often create global variables such as const widgets or Riverpod providers, and there鈥檚 nothing wrong with that!
But global MUTABLE state IS dangerous (hard to know who changed it and which widgets should rebuild).
Found this useful? Show some love and share the original tweet 馃檹
Previous | Next |
---|---|
Measuring execution time in Dart | Inspecting Network Requests (DevTools) |