# Would You Rather LCMA Sample

Would You Rather is a free Mini App Center sample for safe campus-friendly
icebreaker voting. A host starts a nearby room, players vote between two
choices, and the room reveals a lightweight result summary. The first slice
includes quick play, room hosting, room joining, safe starter decks, vote
broadcasts, reveal controls, recent round history, and local storage for the
last room code.

The sample uses only the current `localchat-miniapp-v1` bridge:

- `localchat.room.create(params)`
- `localchat.room.join(params)`
- `localchat.room.message(params)`
- `localchat.room.poll(params)`
- `localchat.storage.local.get(key)`
- `localchat.storage.local.set(key, value)`
- `localchat.ui.showToast(input)`
- `localchat.ui.setKeepScreenOn(enabled)`

The room protocol prefix is `localchat.wyr.v1`. Hosts broadcast
`session.created`, `round.started`, and `votes.revealed` events. Players
announce themselves with `player.joined` and cast `vote.cast` events. Votes are
simple room messages and do not require accounts, cloud profiles, or audio.

## Package

From `apps/gobaby_transfer`:

```sh
dart --disable-dart-dev tool/lcma_packager.dart \
  --source samples/mini_apps/would_you_rather \
  --output build/mini-app-center/would-you-rather-0.1.0.lcma \
  --metadata build/mini-app-center/would-you-rather-0.1.0.submission.json \
  --artifact-url https://localchat.me/v1/mini-app-center/artifacts/<staged-package-storage-key> \
  --key-id localchat-miniapp-beta-<developer> \
  --private-key-seed-base64url <developer-signing-seed>
```

For local unsigned smoke checks, omit `--private-key-seed-base64url` and keep
the generated package out of external beta submissions.

## Smoke Tests

These tests package and validate the committed sample:

```sh
flutter test test/lcma_packager_test.dart --plain-name "packager validates the repository Would You Rather sample"
```
