Your Dart code in index.dart, running on Cloudflare Workers
In addition to Wrangler you will need to install Dart.
To generate using wrangler
wrangler generate projectname https://github.com/cloudflare/dart-worker-hello-world
Further documentation for Wrangler can be found here.
After installing Dart per the linked instructions above,
cd projectname
# run once to get dependencies
pub get
dart2js -O2 -o index.js index.dart
That will compile your code into index.js, after which you can run wrangler publish to push it to Cloudflare.
For more information on how Dart translates to JavaScript, see the docs for dart2js and the interop guide.