nandi/frqpublic Fork 0
4dfc71908cc3f12174bb0d6dd8688ff3164879c3
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.

main_nim.dart · 41 lines · 1.5 KBDart Blame HistoryRaw
The renderer, and a transport bug that took four tries 58e6c97 nandi 14h ago1/// 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 ago13library;
14
15import 'dart:io';
16
The renderer, and a transport bug that took four tries 58e6c97 nandi 14h ago17import 'package:flutter/material.dart';
Quality pass: reuse, dead weight, and two real costs 4dfc719 nandi 12h ago18import 'package:frq_core/frq_core.dart' as core;
19
The renderer, and a transport bug that took four tries 58e6c97 nandi 14h ago20import 'nim_renderer.dart';
21
Quality pass: reuse, dead weight, and two real costs 4dfc719 nandi 12h ago22void 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}