I'm using the new async/await syntax in my code, and everything is working great if I run my application directly from dart using something like C:\dart\dart-sdk\bin\dart.exe --enable_async --checked C:\code\dart-app\main.dart
When I try to run pub run main.dart on the same application, however, I get an error message error: line XX pos XX: use flag --enable-async to enable async/await features. The --enable-async flag seems to be something for Dart itself, so I can't add it to the pub command. How can I build my application using pub in a way that allows me to us the async/await syntax?
The pub run command loads and executes the transformers registered in your pubspec.yaml file, before executing the app. So you can use the async-await transformer to handle async/await instructions. See Async/Await feature in Dart 1.8
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With