mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-09-27 11:31:06 -04:00
work
This commit is contained in:
parent
f06657d700
commit
8907ce04ac
72 changed files with 539 additions and 224 deletions
32
lib/tools/desktop_control.dart
Normal file
32
lib/tools/desktop_control.dart
Normal file
|
@ -0,0 +1,32 @@
|
|||
import 'dart:io';
|
||||
import 'package:window_manager/window_manager.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
Future<void> setupDesktopWindow() async {
|
||||
if (Platform.isWindows || Platform.isLinux || Platform.isMacOS) {
|
||||
await windowManager.ensureInitialized();
|
||||
|
||||
const windowOptions = WindowOptions(
|
||||
size: Size(768, 1024),
|
||||
minimumSize: Size(480, 640),
|
||||
center: true,
|
||||
backgroundColor: Colors.transparent,
|
||||
skipTaskbar: false,
|
||||
titleBarStyle: TitleBarStyle.hidden,
|
||||
);
|
||||
windowManager.waitUntilReadyToShow(windowOptions, () async {
|
||||
await windowManager.show();
|
||||
await windowManager.focus();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void enableTitleBar(bool enabled) {
|
||||
if (Platform.isWindows || Platform.isLinux || Platform.isMacOS) {
|
||||
if (enabled) {
|
||||
windowManager.setTitleBarStyle(TitleBarStyle.normal);
|
||||
} else {
|
||||
windowManager.setTitleBarStyle(TitleBarStyle.hidden);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,3 +2,5 @@ export 'external_stream_state.dart';
|
|||
export 'json_tools.dart';
|
||||
export 'phono_byte.dart';
|
||||
export 'protobuf_tools.dart';
|
||||
export 'widget_helpers.dart';
|
||||
export 'desktop_control.dart';
|
||||
|
|
9
lib/tools/widget_helpers.dart
Normal file
9
lib/tools/widget_helpers.dart
Normal file
|
@ -0,0 +1,9 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
extension BorderExt on Widget {
|
||||
Container debugBorder() {
|
||||
return Container(
|
||||
decoration: BoxDecoration(border: Border.all(color: Colors.redAccent)),
|
||||
child: this);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue