Skip to content

Instantly share code, notes, and snippets.

@pedrolemoz
Last active October 14, 2020 15:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pedrolemoz/67a8af9db490e8e96c9277ceb8915651 to your computer and use it in GitHub Desktop.
Save pedrolemoz/67a8af9db490e8e96c9277ceb8915651 to your computer and use it in GitHub Desktop.
Useful commands for Flutter development

Create a new Flutter project from command line

flutter create --org "com.pedrolemoz" -a kotlin --androidx -i swift --description "Description" project_name_with_underscores

Switch between channels

flutter channel stable (or beta, dev, master)
flutter upgrade

MobX Build Runner

flutter pub run build_runner build --delete-conflicting-outputs
flutter pub run build_runner watch

Stable Flutter version for build_runner

flutter version 1.20.4

Flutter Launch Icons

In pubspec.yaml

dev_dependencies:
  flutter_launcher_icons: ^0.7.4

flutter_icons:
  ios: true
  android: true
  image_path_ios: assets/launcher/icon.png
  image_path_android: assets/launcher/icon.png
  adaptive_icon_background: assets/launcher/background.png
  adaptive_icon_foreground: assets/launcher/foreground.png

In command line

flutter pub get
flutter pub run flutter_launcher_icons:main

Accept all licences

flutter doctor --android-licenses

Flutter Web Support

flutter channel beta && flutter upgrade && flutter config --enable-web && flutter clean && flutter pub cache repair && flutter pub get && cd .. && flutter create project_name_with_underscores

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