nandi/frqpublic Fork 0
bdd2c3cafcc01e6efb8fe0c93bf70a8f734a610d
Commits
Clone
git clone https://git.rickub.com/nandi/frq.git
git clone ssh://git@rickub.com/nandi/frq.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

README.md · 64 lines · 2.8 KBmarkdown Blame HistoryRaw
The last of the Clojure 284b59c nandi 18h ago1# The Flutter half
Split the tree three ways, and let the phone be Flutter's 7070931 nandi 8d ago2
The last of the Clojure 284b59c nandi 18h ago3The renderer, and the window it runs in. Everything else is Nim.
Split the tree three ways, and let the phone be Flutter's 7070931 nandi 8d ago4
5```
The last of the Clojure 284b59c nandi 18h ago6lib/main.dart the entry point: reads FRQ_AUTOCONNECT, then runs the app
7lib/nim_renderer.dart the widget tree from Nim, as Flutter widgets
8lib/nim_theme.dart the design tokens
9test/nim_layout_test.dart every screen laid out for real, at three sizes
Split the tree three ways, and let the phone be Flutter's 7070931 nandi 8d ago10```
11
The last of the Clojure 284b59c nandi 18h ago12## What the renderer knows
13
14The tag vocabulary, and nothing else — no screens, no state, no idea what
15"connect" means. Nim decides what the screen is; this decides what a `vbox`
16looks like. The measure of whether the split is honest is how boring this file
17is: if a feature ever needs a change here AND in Nim, the boundary is in the
18wrong place.
19
20Three rules in it are worth knowing before changing any of it, because each
21cost a screenful of `Cannot hit test a render box that has never been laid
22out` to find:
23
24* **`Expanded` only inside a Flex.** The renderer threads the axis it is
25 building into, because Flutter offers no way to ask after the fact. An
26 `Expanded` in a `Wrap` fails the layout, and every box under it is then
27 hit-tested having never been laid out.
28* **A paragraph is one `RichText`, not a row of words.** Children of a `Wrap`
29 are given unbounded width, so a long URL can never wrap — it overflows and
30 takes the screen with it.
31* **`expand` is stated by the node that expands.** A row that fills the
32 remaining height stretches on its cross axis, and stretch needs a bounded
33 height to stretch to.
34
35`test/nim_layout_test.dart` is what enforces all three. It renders every screen
36at phone, desktop and a deliberately cramped size, headless, and fails on
37anything that reaches `FlutterError` — which is where a layout error goes
38instead of to the caller, so a test that only pumps and asserts on widgets
39passes while the screen is in pieces.
40
41## Building
Paint the desktop with Flutter too, beside libcosmic fc5f63c nandi 7d ago42
Build the APK, out of ClojureDart and Flutter e2b0e6b nandi 8d ago43```bash
The last of the Clojure 284b59c nandi 18h ago44just build desktop # the debug bundle
45just run desktop # and open it
46just test layout # the widget tests, headless
Build the APK, out of ClojureDart and Flutter e2b0e6b nandi 8d ago47```
48
The last of the Clojure 284b59c nandi 18h ago49`just` builds `libfrqcore.so` first: the app dlopens it at startup, and a
50missing one is a blank window with a `StateError` behind it. The core resolves
51OpenSSL through dynlib at run time, which is why the recipe puts the host's
52library on the loader path.
Draw frq.app's own connect screen on the phone 0bc64b5 nandi 8d ago53
The last of the Clojure 284b59c nandi 18h ago54## What used to be here
Draw frq.app's own connect screen on the phone 0bc64b5 nandi 8d ago55
The last of the Clojure 284b59c nandi 18h ago56`src/`, 5,500 lines of ClojureDart: the screens, the host implementations, and
57a `frq.hiccup` that did what `nim_renderer.dart` does now. It compiled to
58three targets — Android, Linux and the web — and both of the others went with
59it. A browser has no `dart:ffi`, so the web needs the Nim core built to wasm
60rather than ClojureDart brought back; Android needs `libfrqcore.so` for its
61ABIs, which is a build problem rather than a design one.
Draw frq.app's own connect screen on the phone 0bc64b5 nandi 8d ago62
The last of the Clojure 284b59c nandi 18h ago63The `android/` and `web/` directories are still here and still describe real
64targets. Nothing builds them today.