Mac Setup
IDE Setup
Preferences
- Generally depending on the team we are working with, we adopt the software.
- As an example: For internal use we prefer
android studio
, for clients developers preferVS Code
, For the clients Testers preferIntelliJ IDEA
. - It also depends on the user, I would like to use the editor which makes me more productive. i.e. some users fide VS Code easier to debug the app when some users think
Android studio
is better.
- For now, we will setup two IDEs
- Android Studio
- VS Code
Android studio setup
- Step 1: Install Android Studio
- Step 2: Install Plugins
- Start Android Studio.
- Open plugin preferences (Preferences > Plugins as of v3.6.3.0 or later).
- Select the
Flutter
plugin and click Install. - Click Yes when prompted to install the Dart plugin.
- Click Restart when prompted.
- Step 3 (Optional): Check out Editing tips for Flutter code and Use dart analysis for assistence.
- Step 4 (Optional): Set max line length in Android Studio code editor.
- Go to preferences
- Search code style, select it
- Select subsection dart
- Change
Hard Wrap At
value and Apply.
- Step 5 (Optional): Set Format code on save
- Using Flutter to auto format code when saving:
- Go to Preferences
- Go to Language & Frameworks
- Go to Flutter
- Select 'Format code on save'.
VS Code setup
- Step 1: Install the VS Code
- Step 2: Install Extensions
- Press commnnd + swift + x
- Search and install below extensions
- Better Comments https://marketplace.visualstudio.com/items?itemName=aaron-bond.better-comments
- Build Runner https://marketplace.visualstudio.com/items?itemName=GaetSchwartz.build-runner
- dart-import https://marketplace.visualstudio.com/items?itemName=luanpotter.dart-import
- Flutter https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
- GitLens https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens
- Material Icon Theme https://marketplace.visualstudio.com/items?itemName=PKief.material-icon-theme
- Pubspec Assist https://marketplace.visualstudio.com/items?itemName=jeroen-meijer.pubspec-assist
- YAML https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml
- Step 3 (Optional): Check out Editing tips for Flutter code and Use dart analysis for assistence.
- Step 4 (Optional): Set max line length in VS Code.
- Press command + ,
- It will open the settings, search for
Dart: line length
and there put the desired number. - By default it's 80.
- Step 5 (Optional): Set Format code on save
- Press command + ,
- It will open the settings, search for
Editor: Format On Save
and to enable it check the box.