This IDE setup is tested on Windows 11.
For setup first you need the following things:
- Android SDK and Android Emulator
- Flutter
- IDE like Android Studio or VS Code with Flutter Plugin installed.
Use paths for SDKs without spaces and special characters.
-
Download Android Studio from https://developer.android.com/studio and install. Keep "Android Virtual Device" checked. Start Android Studio after installation.
-
Install the Android SDK when asked.
-
After finishing the SDK installation you should the "Welcome to Android Studio" Screen. Click on "More Actions" -> "SDK Manager", switch to "SDK Tools" tab and check "Android SDK Command-line Tools (latest)", click "OK" and install the tools.
-
Check under "More Actions" -> "Virtual Device Manager" if a virtual phone was set up, if not create one, e.g. a Medium Phone with Default Settings.
-
Close Android Studio.
-
Download Flutter 3.27.1 from https://docs.flutter.dev/install/archive and extract.
-
Add the bin folder in the folder where you extracted Flutter to the Path variable in "Advanced System Settings" -> "Environment Variables..." -> "System variables" -> "Path"
-
Create a new folder, open the folder in VSC.
-
Configure the Android SDK path for Flutter:
flutter config --android-sdk "e:\path\to\androidSDK"
3. Clone the repository with git in a VSC terminal (make sure the active folder in the terminal is your created folder from step 1):
git clone https://github.com/simonoppowa/OpenNutriTracker.git .
4. Get Dependencies.
flutter pub get
5. Run Build Runner to generate Files.
flutter pub run build_runner build
At the best revert all the visible generated files now, only env.g.dart is needed, it is not checked in because it is in .gitignore.
6. Restart VSC, VSC detects now that this is a flutter project. On the Bottom Right "No Device" ist displayed, click on it, then select "Start Medium Phone" on the command Palette on the top. Wait for the phone to boot up.
- Press F5 to start a debug session (may take a while on the first time). Keep the virtual phone running all the time, just start and stop Debugging.