Frameless (window_manager, hidden titlebar): chrome bar on welcome, drag-to-move appbar + window buttons on connect, drag layer + window buttons in session controls; min size 160x90; volume-scroll off for drag; session maximize = fullscreen toggle. Verified on KDE Wayland. Delete legacy/minimal/nosheet bisect screens; session routes direct (black-screen fix verified incl. WAN). Avatar: pipeline now 128px aspect-kept PNG (was cropped JPEG); profile card centered 64px hover-to-change; member avatar drops ResizeImage downscale. NOTE open: pipeline 512 KiB check vs server 64 KiB enforcement mismatch. Fixes: idle warn/unready skipped while PLAYING; sendChat drops blanks; one chat row per send (drop textless server feed echo); chat field keeps focus after send. Playback libass true; sdk floor 3.13. Handoff 9-11: 9+10 fixed, 11 jumpy seek still open. Docs: handoff/roadmap/protocol record all of the above; few-commits preference going forward.
65 lines
1.9 KiB
Dart
65 lines
1.9 KiB
Dart
import 'dart:io';
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:hive_ce_flutter/hive_flutter.dart';
|
|
import 'package:media_kit/media_kit.dart';
|
|
import 'package:sync_relay_core/core.dart';
|
|
import 'package:window_manager/window_manager.dart';
|
|
|
|
import 'app.dart';
|
|
import 'src/state/session_state.dart';
|
|
|
|
Future<void> main(List<String> args) async {
|
|
initLogging();
|
|
if (args.contains('--headless')) {
|
|
await runHeadless(args);
|
|
return;
|
|
}
|
|
FlutterError.onError = (details) {
|
|
debugPrint('FLUTTER ERROR: ${details.exceptionAsString()}\n${details.stack}');
|
|
FlutterError.presentError(details);
|
|
};
|
|
ErrorWidget.builder = (details) => Material(
|
|
color: const Color(0xFF101010),
|
|
child: Center(
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(24),
|
|
child: Text(
|
|
'Something broke rendering this view:\n${details.exceptionAsString()}',
|
|
style: const TextStyle(color: Colors.white),
|
|
textAlign: TextAlign.center,
|
|
),
|
|
),
|
|
),
|
|
);
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
await windowManager.ensureInitialized();
|
|
const windowOptions = WindowOptions(
|
|
size: Size(1280, 720),
|
|
minimumSize: Size(160, 90),
|
|
center: true,
|
|
backgroundColor: Color(0xFF000000),
|
|
titleBarStyle: TitleBarStyle.hidden,
|
|
title: 'Watch Together',
|
|
);
|
|
windowManager.waitUntilReadyToShow(windowOptions, () async {
|
|
await windowManager.show();
|
|
await windowManager.focus();
|
|
});
|
|
await Hive.initFlutter();
|
|
try {
|
|
await SessionState.instance.loadForm();
|
|
} catch (e, st) {
|
|
debugPrint('load connect form failed: $e\n$st');
|
|
}
|
|
MediaKit.ensureInitialized();
|
|
runApp(const WatchTogetherApp());
|
|
}
|
|
|
|
Future<void> runHeadless(List<String> args) async {
|
|
final session = SessionState.instance;
|
|
await session.startHeadless(args);
|
|
await ProcessSignal.sigint.watch().first;
|
|
await session.stopServer();
|
|
}
|