It’s a bit of a pain to actually need to share or send code so that someone else can run it. There’s an easy way to actually sidestep the issue and make it dead simple when it comes to both Dart & Flutter code.
For this you’ll need to have a Github account and head over to Gist.
You’ll just need to save your script, give it a filename finishing with .dart and don’t forget to add a short description explaining your code before saving it.
For the tricky part, I’ll be explaining using one of my older gist scripts which can be found in this gist.