Skip to content

Instantly share code, notes, and snippets.

@RandalSchwartz
Last active June 5, 2021 22:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RandalSchwartz/a99817e4ce6589523ab242fc8c1e6820 to your computer and use it in GitHub Desktop.
Save RandalSchwartz/a99817e4ce6589523ab242fc8c1e6820 to your computer and use it in GitHub Desktop.
fplay and dplay, for quick flexible "dart pad" tinkering
#!/bin/sh
p=${1-d_$(uuidgen | tr A-Z- a-z_)}
cd /tmp || exit 1
dart create $p || exit 1
cd $p || exit 1
flutter pub add riverpod
code .
#!/bin/sh
p=${1-f_$(uuidgen | tr A-Z- a-z_)}
cd /tmp || exit 1
flutter create --org=com.stonehenge $p || exit 1
cd $p || exit 1
flutter pub add hooks_riverpod
flutter pub add flutter_hooks
code .

fplay and dplay

Great when you just want a quick place to play with flutter or dart.

Presumes Visual Studio Code is available from the code command.

Creates a new project in /tmp.

By default, the project name is a uuid (made into a suitable project name), preceded by either d_ for dart, or f_ for flutter. If you specify a name, that takes precedence.

RiverPod packages are added by default. Because.

You'll want to edit your own --org into fplay for flutter create....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment