Steps to create an IterableEntity / Iterable2Entity
Declare your class this way :
/// ListEntity example
///
/// This will hold a list of [Todo]s
class TodoList extends ListEntity<InvalidTodoList, ValidTodoList>
with _$TodoList {}
/// MapEntity example
///
/// This will hold a map where the keys are [Author]s and values
/// are [Book]s
class BookMap extends MapEntity<InvalidBookMap, ValidBookMap>
with _$BookMap {}
Add the , the (don't forget including the contentValidation), and the .
Add the . The factory constructor should have only one member parameter, which type should match the .
You can now run the generator, and then override and implement the . Note that the "validate" method of the contentValidation is automatically generated, and you should never override it (Your IDE's Quick Fix won't override it neither).