logo

Introduction

Flutter, a Google-created framework, facilitates open-source mobile app development for both Android and iOS platforms. It serves as the primary tool for creating applications, with shared configuration steps for Android and iOS compilation. This section will delve into these shared configuration steps.

Requirements

  • Flutter version 3.13.9

  • Dart version 3.1.5

  • Dev tools version 2.25.0

  • Engine revision 0545f8705d

  • Upstream repository https://github.com/flutter/flutter.git

  • To edit this project you must have Flutter and Dart installed and configured successfully on your device Install flutter

  • Flutter (Channel stable, 3.0.1, on macOS 12.3.1 21E258 darwin-arm (Rosetta), locale en-BD)

  • Framework • revision d211f42860 (3 months ago) • 2023-10-25 13:42:25 -0700

Get Started

Download and extract the Flutter application.Open the project using your preferred IDE: Android Studio, Visual Studio Code, or IntelliJ.

Edit the remote link in utils/app_constants.dart to establish a connection between your mobile app and the RestApi.

Navigate to the "android/app/src/main/res/mipmap-mdpi/launcher_icon.png" directory and substitute the existing image with your desired logo or app icon.

Configuration for Android

Change your app icon (ic_launcher.png) folders How to generate an app icon? after you generate icons folder

  • /mipmap-hdpi in /android/app/src/main/res/ folder
  • /mipmap-mdpi in /android/app/src/main/res/ folder
  • /mipmap-xhdpi in /android/app/src/main/res/ folder
  • /mipmap-xxhdpi in /android/app/src/main/res/ folder
  • /mipmap-xxxhdpi in /android/app/src/main/res/ folder

Get Dependencies

Just run the following command

  • flutter clear
  • flutter pub get

Modify Package Name

To change the package name, follow these steps.

Modify the package name in the file located at /android/app/build.gradle.
  • defaultConfig {
    applicationId "your package name"
    minSdkVersion 23
    targetSdkVersion flutter.targetSdkVersion
    versionCode flutterVersionCode.toInteger()
    versionName flutterVersionName
    }
  • Then run the following command
    flutter pub get

Run Android Application

In the target selector, choose an Android device to run the app. If no devices are available, go to Tools > Android > AVD Manager and create one. For detailed instructions, refer to the section on Managing AVDs.
"If you're not utilizing Android Studio or IntelliJ, you can employ the command line to execute your application with the following command:"
flutter run

Build And Install App

  • Save your project after making changes.
  • Open the console.
  • Navigate to your project folder.
  • Execute the command: flutter build apk --release to build your app.
  • When publishing your app on the Play Store, it's advisable to either employ app bundles or divide the APK into smaller parts to minimize its size.
  • To create an app bundle, execute the following command in Flutter: flutter build appbundle --target-platform android-arm,android-arm64,android-x64
    Learn more on https://developer.android.com/guide/app-bundle
  • Retrieve the APK file located in the build/output/apk folder. To install the application on your connected device, execute the following command.