Generators
Last updated
Was this helpful?
Last updated
Was this helpful?
In simple words , iterable is something you can loop over or a collection of values that can be accessed sequentially
Iterator is something that remember can "where it is " i.e. current position during iteration
There are two types of Generators in Dart
In a normal function you would expect the function body to execute when you call the function , but in case of generator it doesn't execute
Synchronous Generator Returns an iterable
Asynchronous Generator Returns a stream