Skip to content

Instantly share code, notes, and snippets.

@leocavalcante
Created February 24, 2020 15:52
Show Gist options
  • Save leocavalcante/cce9cbc034daddad614940a67b982869 to your computer and use it in GitHub Desktop.
Save leocavalcante/cce9cbc034daddad614940a67b982869 to your computer and use it in GitHub Desktop.
class Foo {
String foo;
Foo(this.foo);
String toString() => foo;
}
void main() {
final map = <DateTime, List<dynamic>>{
DateTime(2010, 10, 10): [Foo("bar"), Foo("baz"), Foo("qux")],
DateTime(2011, 10, 10): [Foo("bar"), Foo("baz"), Foo("qux")],
DateTime(2012, 10, 10): [Foo("bar"), Foo("baz"), Foo("qux")],
};
map[DateTime.parse('2011-10-10')].removeWhere((foo) => foo.foo == "baz");
print(map);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment