Last active
January 28, 2023 17:10
-
-
Save ayansg/4872b0b0611a38f2036d43fdf40c2575 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef RawDocument = Map<String,dynamic>; | |
typedef RawCollection = Iterable<RawDocument>; | |
void main() async { | |
final y = await _getIterable(); | |
print(y); | |
print(y.runtimeType); | |
} | |
Future<RawCollection> _getIterable() async { | |
final Iterable<Map<Object?,dynamic>> list = [ //Iterable<Map> should also work | |
{ | |
"x":5, | |
"y":"hi", | |
}, | |
{ | |
"x":6, | |
"y":"hello", | |
} | |
]; | |
return await Future.value(list.map((e)=>e.cast<String,dynamic>())); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment