Restructure step 3: your server, Invite, version gate, AppGraph
- One server per app run (loopback, no password); Invite attaches an all-interfaces listener to the same server and Stop sharing detaches it (guests told with 4016); members, media and Up next never reset. No solo mode: you're home on your own server unless in a friend's. - Navigation: none / yours / friend; a join passes a version gate on /health first (clear "they/you need to update", update offer). - Invite as a value (host, port, name, password flag, version, fp reserved); addresses filtered (loopback, link-local, 198.18/15, bridges) and ranked; Sharing chip, Copy invite, Stop sharing. - Alone looks like a plain player (alone replaces solo). - AppGraph builds and disposes systems; widgets use AppScope; SessionState deleted; a test caps the remaining singletons. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
629be0d9ed
commit
4d00b7455e
86 files changed
+2993
-2071
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../state/session_state.dart';
|
||||
import '../app/app_graph.dart';
|
||||
|
||||
class WindowButtons extends StatefulWidget {
|
||||
final FocusNode? focusNode;
|
||||
@@ -18,7 +18,7 @@ class WindowButtons extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _WindowButtonsState extends State<WindowButtons> {
|
||||
final _shell = SessionState.instance.ports.shell;
|
||||
late final _shell = AppScope.of(context).ports.shell;
|
||||
bool _maximized = false;
|
||||
late final void Function() _stopWatch;
|
||||
|
||||
@@ -53,8 +53,9 @@ class _WindowButtonsState extends State<WindowButtons> {
|
||||
|
||||
Future<void> _close() async {
|
||||
try {
|
||||
await SessionState.instance.coordinator.leave();
|
||||
await SessionState.instance.stopServer();
|
||||
final graph = AppScope.of(context);
|
||||
await graph.navigation.leave();
|
||||
await graph.yourServer.stop();
|
||||
} catch (_) {}
|
||||
await _shell.requestClose();
|
||||
}
|
||||
@@ -133,7 +134,7 @@ class WindowDragArea extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final shell = SessionState.instance.ports.shell;
|
||||
final shell = AppScope.of(context).ports.shell;
|
||||
return GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
onPanStart: (_) => shell.startDragging(),
|
||||
|
||||
Reference in new issue
Block a user