version: 3

vars:
  RED: '\033[0;31m'
  GREEN: '\033[0;32m'
  COLOROFF: '\033[0m'
  PREFIX: "⏳"

silent: true

tasks:
  logs:
    desc: Show log output for running Flutter apps
    aliases: [l]
    cmds:
      - echo -e "{{.GREEN}}{{.PREFIX}} Showing log output for running Flutter apps...{{.COLOROFF}}"
      - flutter logs

  mock:
    desc: Run app in development environment with mocks
    aliases: [m]
    cmds:
      - echo -e "{{.GREEN}}{{.PREFIX}} Running the app (development/debug:mocks)...{{.COLOROFF}}"
      - flutter run --target lib/main_development.dart --dart-define="dev_mode=mock"

  emu:
    desc: Run app in development with emulated environment
    aliases: [e]
    cmds:
      - echo -e "{{.GREEN}}{{.PREFIX}} Running the app (development/debug:emulator)...{{.COLOROFF}}"
      - flutter run --target lib/main_development.dart --dart-define="dev_mode=emulator"

  dev:
    desc: Run app in development environment
    aliases: [d]
    cmds:
      - echo -e "{{.GREEN}}{{.PREFIX}} Running the app (development/debug:real)...{{.COLOROFF}}"
      - flutter run --target lib/main_development.dart --dart-define="dev_mode=real"

  staging:
    desc: Run app in staging environment
    aliases: [s]
    cmds:
      - echo -e "{{.GREEN}}{{.PREFIX}} Running the app (staging/debug)...{{.COLOROFF}}"
      - flutter run --target lib/main_staging.dart

  prod:
    desc: Run app in production environment
    aliases: [p]
    cmds:
      - echo -e "{{.GREEN}}{{.PREFIX}} Running the app (production/debug)...{{.COLOROFF}}"
      - flutter run --target lib/main_production.dart

  release:
    desc: Run app in production environment and in release mode
    aliases: [r]
    cmds:
      - echo -e "{{.GREEN}}{{.PREFIX}} Running the app (production/release)...{{.COLOROFF}}"
      - flutter run --target lib/main_production.dart --release
