Skip to content

Instantly share code, notes, and snippets.

@k4zek4ge
Last active October 21, 2023 18:15
Show Gist options
  • Save k4zek4ge/f2715051b2fdd4a9ff5beb8aee36c482 to your computer and use it in GitHub Desktop.
Save k4zek4ge/f2715051b2fdd4a9ff5beb8aee36c482 to your computer and use it in GitHub Desktop.
[flutter basic commands] #flutter enable web build create channel
# edit $HOME/.bash_profile or $HOME/.bashrc.
# macOS Catalina uses the Z shell by default, so edit $HOME/.zshrc
# source $HOME/.<rc file> to refresh the current window
# Verify that the flutter/bin directory is now in your PATH by running: echo $PATH
# Verify that the flutter command is available by running: which flutter
# iOS setup
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch
open -a Simulator
# to view current channel
flutter channel
# which channel
flutter channels
# which devices
flutter devices
# enable web
flutter channel beta
flutter upgrade
flutter config --enable-web
# create a new project
cd <into project directory>
# to create an empty project
flutter create .
flutter create --org net.apitep test_app
# run the project
flutter run --release
#to run as desktop app
flutter run -d macos
# to generate as web app
flutter run -d chrome --release
flutter run -d chrome --web-port 5000
# clean cache
flutter clean
flutter pub cache repair
flutter packages upgrade
# enable the Desktop Feature for your platform as
flutter config --enable-linux-desktop for Linux.
flutter config --enable-macos-desktop for macOS.
flutter config --enable-windows-desktop to enable Windows.
#which config
flutter config
flutter pub run flutter_launcher_icons:main
flutter pub pub run flutter_native_splash:create
#to generate a release build:
flutter build web --release
flutter build web --web-renderer html --release
flutter build appbundle
flutter build appbundle --target-platform android-arm,android-arm64,android-x64
flutter build apk
flutter build ios
flutter build macos -t lib/env/production.dart --release
#code generation
flutter packages pub run build_runner build
flutter install
adb devices
flutter install <devce ID>
adb uninstall com.mycompany.myapp
#open xcode project
open ios/Runner.xcworkspace
#rebuild icons with flutter_launcher package
flutter packages pub run flutter_launcher_icons:main
#Open
android/app/src/main/AndroidManifest.xml
#and after </application> add this android permission
<uses-permission android:name="android.permission.INTERNET" />
#run a Flutter app to a specific route
flutter run --route /routeName
# format all files line length
flutter format . -l 140
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment