Every example of async code I have tried in Dart, mostly from their site does not seem to work for me.
import 'dart:io';
main() async {
var socket = await Socket.connect('127.0.0.1', 4041);
print(socket.runtimeType);
socket.write('Hello, World!');
}
Example code from their cookbook
And it throws me
error: line 3 pos 1: unexpected token 'main'
main() async {
I think its looking for a return type for the function? But I can't find any kind of documentmentation where you can tell what it is looking for, thanks for the help!
1.5.3I run the install aschoco install dart-sdk -version 1.18.1