| The last of the Clojure 284b59c nandi yesterday | 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. |
| 13 | library; |
| 14 | |
| 15 | |
| 16 | import 'package:flutter/material.dart'; |
| 17 | import 'package:frq_core/frq_core.dart' as core; |
| 18 | |
| 19 | import 'nim_renderer.dart'; |
| A web version, from the same core 23846db nandi 9h ago | 20 | import 'src/host.dart' as host; |
| The last of the Clojure 284b59c nandi yesterday | 21 | |
| 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. |
| A web version, from the same core 23846db nandi 9h ago | 32 | // There is no environment in a browser, so this is simply never on there. |
| 33 | final want = host.envOr('FRQ_AUTOCONNECT', ''); |
| The last of the Clojure 284b59c nandi yesterday | 34 | if (want.isNotEmpty && want != '0') { |
| A web version, from the same core 23846db nandi 9h ago | 35 | final nick = host.envOr('FRQ_NICK', ''); |
| The last of the Clojure 284b59c nandi yesterday | 36 | if (nick.isNotEmpty) core.dispatch('nick.change', nick); |
| 37 | core.dispatch('connect'); |
| 38 | } |
| 39 | |
| 40 | runApp(const NimApp()); |
| 41 | } |