You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
UnmodifiableListView is there for safety. It's immutable, so consumers of the Cartclass cannot change the items in the class via the Cart.items getter. They have to go through Cart.add() and Cart.remove() (which make sure to do the right thing).
So, this is just a bit of encapsulation. For a smaller project and for learning purposes, it's okay to use a List.
I'm closing this but feel free to reopen if it's not clear or helpful.
state_experiments/shared/lib/common/models/cart.dart
Line 36 in 19c321b
I prefer to try bloc_start architecture.
Is it okay to change this to normal ListView ?
What is the purpose of this actually ?
The text was updated successfully, but these errors were encountered: