nandi/frqpublic Fork 0
5581b0fb0907d4a9498e17399d68ff8dbc383216
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.

A web version, from the same core 23846db · on 5581b0fb0907d4a9498e17399d68ff8dbc383216 · nandi · 9h ago
main.dart · 41 lines · 1.6 KBDart Blame HistoryRaw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/// frq, with Nim owning the state and the screens.
///
/// No ClojureDart on this path at all — not `frq.main`, not `common/`, not a
/// `.cljd` file. Flutter starts, asks Nim for a widget tree and paints it;
/// every tap and keystroke goes back as an event id.
///
///   just nim-ui run
///
/// The screens are ports of `common/frq/screens/`, not sketches of them: same
/// copy, same fields, same stable wrappers. What is not yet here is the emoji
/// picker, the overview strip, the lightbox and the profile card — see
/// `nim/README.md` for what is done and what is not.
library;


import 'package:flutter/material.dart';
import 'package:frq_core/frq_core.dart' as core;

import 'nim_renderer.dart';
import 'src/host.dart' as host;

void main() {
  // FRQ_AUTOCONNECT presses Connect at startup, and FRQ_NICK overrides the
  // nickname — a Wayland window cannot be clicked from a script, so without
  // this the only way to check that the app gets past the connect screen is
  // to sit in front of it.
  //
  // Read here rather than in Nim, and dispatched through the same door the
  // button uses. It lived in `currentTree()` before, which meant the function
  // whose job is "serialise the current screen" opened a socket on its first
  // call depending on the process environment.
  // There is no environment in a browser, so this is simply never on there.
  final want = host.envOr('FRQ_AUTOCONNECT', '');
  if (want.isNotEmpty && want != '0') {
    final nick = host.envOr('FRQ_NICK', '');
    if (nick.isNotEmpty) core.dispatch('nick.change', nick);
    core.dispatch('connect');
  }

  runApp(const NimApp());
}