Skip to content
A glittering, brightly colored logo

Flutter Code

Build apps for any screen.

The app for receiving and storing the data from the microcontroller was written in Flutter with the Dart programming language.

The app has support for:

  • Windows
  • macOS
  • Linux
  • Android
  • iOS

Setup

  1. Grab the project files:

    Terminal window
    git clone https://avoid.sh/PetActivityMonitor/xiao_pet_tracker.git
  2. Run flutter pub get to load the dependencies.

  3. The project contains 3 flavors:

    • development
    • staging
    • production

    To run the desired flavor either use the launch configuration in VSCode/Android Studio or use the following commands:

    Terminal window
    # Development
    $ flutter run --flavor development --target lib/main_development.dart
    # Staging
    $ flutter run --flavor staging --target lib/main_staging.dart
    # Production
    $ flutter run --flavor production --target lib/main_production.dart

    The development flavor is used for developing, it includes Dart’s Hot Reload feature where you can make live changes to the code and immediately use these changes in the running app without restarting it.

    When using the app the production flavor is recommended. This will compile the app natively with much deeper optimizations.

    The staging flavor is not needed to be used in the current state of the app.