Ok i think its newbie question I have map with datetime-list, if i do something like this its work perfect:
Map<DateTime, List> _activities;
_activities = {
_currentDay.add(Duration(days: 0)):activityNames.toList(),
_currentDay.add(Duration(days: 7)):activityNames.toList(),
_currentDay.add(Duration(days: 14)): activityNames.toList(),
_currentDay.add(Duration(days: 21)): activityNames.toList(),
_currentDay.add(Duration(days: 28)): activityNames.toList(),
}
But i want it like in 'for loop' => wrong example:
for( var i = 0 ; i <= 28; i=i+7 ) {
_activities[_currentDay.add(Duration(days:i))]=activityNames.toList();
}
looks good to me but says NoSuchMethedError: The method '[]=' was called null.