3. Setting Up the Development Environment
Now that you know the prerequisites, follow these steps to set up your development environment:
3.1 Installing Flutter
- Download Flutter SDK
- Download Flutter 3.27.3 from the official Flutter SDK Archive: Flutter SDK Archive.
- Extract the Flutter SDK
- Extract the downloaded file to your desired installation directory (e.g.,
C:\flutter
or~/flutter
). - Avoid locations like
C:\Program Files
to prevent permission issues.
- Extract the downloaded file to your desired installation directory (e.g.,
- Add Flutter to Your PATH
- Add the Flutter
bin
directory to your system's PATH variable:- Windows:
- Open Environment Variables and add the path to
flutter\bin
.
- Open Environment Variables and add the path to
- macOS/Linux:
- Add the following line to your shell configuration file (e.g.,
.bashrc
,.zshrc
):bashexport PATH="$PATH:/path/to/flutter/bin"
- Add the following line to your shell configuration file (e.g.,
- Windows:
- Add the Flutter
- Verify Installation
- Run the following command in your terminal:bash
flutter doctor
- Address any issues reported by the tool (e.g., missing dependencies, unconfigured Android SDK).
- Run the following command in your terminal:
3.2 Configuring Android Studio
- Install Android Studio
- Download and install Android Studio from the official website: Android Studio.
- Install Flutter and Dart Plugins
- Open Android Studio and go to File > Settings > Plugins.
- Search for "Flutter" and install it. The Dart plugin will be installed automatically.
- Configure Flutter and Dart SDK Paths
- Go to File > Settings > Languages & Frameworks > Flutter.
- Set the path to your Flutter SDK (e.g.,
C:\flutter
or~/flutter
). - The Dart SDK path should be automatically detected as
flutter/bin/cache/dart-sdk
.
- Install Android SDK Tools
- Open SDK Manager in Android Studio (
Tools > SDK Manager
). - Install the latest Command Line Tools and Build Tools.
- Uncheck Hide Obsolete Packages and install Android SDK Command Line Tool (Latest).
- Open SDK Manager in Android Studio (
3.3 Verifying Setup
After completing the above steps, verify that everything is configured correctly:
- Run the following command in your terminal:bash
flutter doctor
- Ensure there are no critical errors. Common warnings include:
- Missing licenses for Android SDK (run
flutter doctor --android-licenses
to accept them). - Missing emulator/device (set up an emulator or connect a physical device).
- Missing licenses for Android SDK (run