Installation Setup
Installation Setup
Section titled “Installation Setup”A robust development environment is key to productivity. We will set up the Flutter SDK and optimize Visual Studio Code for Flutter development.
1. Download Flutter SDK
Section titled “1. Download Flutter SDK”Go to the official install page and download the stable release for your OS.
[!CAUTION] Do NOT install Flutter in folders requiring elevated permissions (like
C:\Program Fileson Windows). UseC:\src\flutteror~/development/flutter.
2. Update Path
Section titled “2. Update Path”Add the following to your ~/.zshrc or ~/.bashrc:
export PATH="$PATH:[PATH_TO_FLUTTER_DIRECTORY]/bin"Run source ~/.zshrc to refresh.
- Type “env” in Start Menu and select Edit the system environment variables.
- Click Environment Variables.
- Under User variables, find
Pathand click Edit. - Click New and add the full path to
flutter\bin.
3. Verify with Flutter Doctor
Section titled “3. Verify with Flutter Doctor”Run the following command to diagnose your setup:
flutter doctorFix any issues marked with [x] by following the output instructions (usually involves accepting Android licenses or installing Xcode/Android Studio).
4. IDE Configuration (VS Code)
Section titled “4. IDE Configuration (VS Code)”We recommend VS Code for its lightweight nature and powerful extensions.
Essential Extensions
Section titled “Essential Extensions”Install these from the marketplace:
- Flutter (by Dart Code): The core extension. Debugging, Refactoring, Hot Reload.
- Dart (by Dart Code): Syntax highlighting and type verification.
- Pubspec Assist: Easily add dependencies without opening
pubspec.yaml. - Error Lens: See errors inline in your code editor.
- Bloc: (Optional) For easy boilerplate generation if using Bloc.
Recommended Settings
Section titled “Recommended Settings”Add these to your VS Code settings.json for a better experience:
{ "editor.formatOnSave": true, "editor.codeActionsOnSave": { "source.fixAll": true }, "dart.previewFlutterUiGuides": true, "dart.flutterSdkPath": "/path/to/your/flutter/sdk"}5. Create Your First App
Section titled “5. Create Your First App”Open the terminal in VS Code (Ctrl+`) and run:
flutter create my_first_appcd my_first_appcode .Press F5 to run the app on your connected device or emulator.