---
title: Flutter Code
description: A reference page in my new Starlight docs site.
hero:
  title: "Flutter Code"
  tagline: Build apps for any screen.
  image:
    alt: A glittering, brightly colored logo
    file: ../../../assets/come_to_the_dartside.webp
---

import { Steps } from "@astrojs/starlight/components";

The app for receiving and storing the data from the microcontroller was written in
[Flutter](https://flutter.dev/) with the [Dart](https://dart.dev/) programming language.

The app has support for:

- Windows
- macOS
- Linux
- Android
- iOS

## Setup

<Steps>

1. Grab the project files:

   ```bash
   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:

   ```sh
   # 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.

</Steps>
