Flutter and Dart CLI Notes

  • flutter doctor : for checking status of flutter

    • open -a Simulator : opens the simulator
    • flutter create app_name : creates app in the current folder.
  • Flutter run key commands.

    • r Hot reload. 🔥🔥🔥
    • R Hot restart. h Repeat this help message. d Detach (terminate "flutter run" but leave application running).
    • c Clear the screen
    • q Quit (terminate the application on the device)
  • Control + C : to quit terminal process

  • Create flutter new app :

    • flutter create app_name
  • In order to run your application, type:

    • cd first_app
    • flutter run
  • control+space : for autocompletion in IDE.

  • Refector code : control + shift + R

  • Open iOS simulator : open -a Simulator.app

new : export PS1="Aayushs-MBP: \W/ $ "
old : export PS1="(base) \h:\W \u\$ "
  • iOS simulator keyboard :

    • CMD + Shift + K toggles connectivity of the hardware keyboard, which will open the software keyboard by default if the other one is disconnected.
    • CMD + K toggles the visibility of the software keyboard.
  • Run specific device [emulator or simulator] : flutter run -d DEVICE_ID

  • To see all available devices run flutter devices

  • Manually adding package :

    • flutter packages get
  • Open vscode command palette : shift+command+P

    • then you can open dart dev tools
  • Run flutter with no null safety :

    • flutter run -d emulator-5554 --no-sound-null-safety

      [here I have specified a device also]

Comments