So Im creating this Event Tracker app and I have two screens which are the map and the events list. I am trying to get the place list to be equal to my places in my App state. B
A common workaround to requiring constant values for default arguments is to instead provide a sentinel argument as the default that can be const
. Typically that sentinel argument can be null
:
class AppState {
AppState({
List<Place> places,
...
}) : places = places ?? PlaceMapState.placeList,
assert(places != null),
assert(selectedCategory != null);