| The renderer, and a transport bug that took four tries 58e6c97 nandi 14h ago | 1 | /// frq, with Nim owning the state and the screens. |
| 2 | /// |
| 3 | /// No ClojureDart on this path at all — not `frq.main`, not `common/`, not a |
| 4 | /// `.cljd` file. Flutter starts, asks Nim for a widget tree and paints it; |
| 5 | /// every tap and keystroke goes back as an event id. |
| 6 | /// |
| 7 | /// just nim-ui run |
| 8 | /// |
| 9 | /// The screens are ports of `common/frq/screens/`, not sketches of them: same |
| 10 | /// copy, same fields, same stable wrappers. What is not yet here is the emoji |
| 11 | /// picker, the overview strip, the lightbox and the profile card — see |
| 12 | /// `nim/README.md` for what is done and what is not. |
| Quality pass: reuse, dead weight, and two real costs 4dfc719 nandi 12h ago | 13 | library; |
| 14 | |
| 15 | import 'dart:io'; |
| 16 | |
| The renderer, and a transport bug that took four tries 58e6c97 nandi 14h ago | 17 | import 'package:flutter/material.dart'; |
| Quality pass: reuse, dead weight, and two real costs 4dfc719 nandi 12h ago | 18 | import 'package:frq_core/frq_core.dart' as core; |
| 19 | |
| The renderer, and a transport bug that took four tries 58e6c97 nandi 14h ago | 20 | import 'nim_renderer.dart'; |
| 21 | |
| Quality pass: reuse, dead weight, and two real costs 4dfc719 nandi 12h ago | 22 | void main() { |
| 23 | // FRQ_AUTOCONNECT presses Connect at startup, and FRQ_NICK overrides the |
| 24 | // nickname — a Wayland window cannot be clicked from a script, so without |
| 25 | // this the only way to check that the app gets past the connect screen is |
| 26 | // to sit in front of it. |
| 27 | // |
| 28 | // Read here rather than in Nim, and dispatched through the same door the |
| 29 | // button uses. It lived in `currentTree()` before, which meant the function |
| 30 | // whose job is "serialise the current screen" opened a socket on its first |
| 31 | // call depending on the process environment. |
| 32 | final env = Platform.environment; |
| 33 | final want = env['FRQ_AUTOCONNECT'] ?? ''; |
| 34 | if (want.isNotEmpty && want != '0') { |
| 35 | final nick = env['FRQ_NICK'] ?? ''; |
| 36 | if (nick.isNotEmpty) core.dispatch('nick.change', nick); |
| 37 | core.dispatch('connect'); |
| 38 | } |
| 39 | |
| 40 | runApp(const NimApp()); |
| 41 | } |