A new Flutter project.
This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
For help getting started with Flutter development, view the online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.
- Android Studio
- ADB
- Command-Line tools
- Platform tools
- Flutter SDK - Windows
- Java SDK
- Install Java SDK, and it should automatically add to your user PATH its bin:
- Not needed if the step above is set correctly, but in case you have different JDK versions, you might need to do
- flutter config --jdk-dir PATH_TO_JDK
The Java Development Kit (JDK) installation directory. If unset, flutter will search for one in the following order: 1. the JDK bundled with the latest installation of Android Studio, 2. the JDK found at the directory found in the JAVA_HOME environment variable, and 3. the directory containing the java binary found in the user's path. - Install Android Studio
- Download and unzip the flutter SDK
- In the project folder accept the Android licenses with
flutter doctor --android-licenses - Type
flutter doctorand check if you see the same, ignore the error on this one.
- flutter pub get : gets newly added packages
- flutter pub outdated : refreshes outdated dependencies
- flutter pub upgrade : upgrade locked outdated dependencies
- When models are created/modified: flutter packages pub run build_runner build
- Click on Create Android Emulator in Android Studio
- Create a Virtual Device by clicking on the plus sign
, then select the one you want.
- Back in VS Code click on the bottom right
and you should see
, click on the Emulator you created in Android Studio and it should start the emulator.
- Connect your Android phone to your computer using a USB cable.
- Enable Developer Options and USB Debugging on your phone:
- Go to Settings > About Phone and tap Build Number 7 times to enable Developer Options.
- Go to Settings > Developer Options and enable USB Debugging.
- In the code, right click on
main.dartand selectRun Without Debugging, the app should now run on the emulated device.
- Open a terminal in Visual Studio Code or your system terminal.
- Run the following command to check if your device is connected:
flutter devices - Your device should appear in the list. If it doesn't, ensure USB Debugging is enabled and your USB drivers are installed.
- Run the following command to build the .apk file:
flutter build apk --releaseThis will generate the .apk file in the build/app/outputs/flutter-apk/ directory of your project.
- Once the .apk is built, you can install it directly on your connected device using:
flutter installThis will automatically install the app on your phone.
After installation, you can open the app on your phone and test it.