-
Notifications
You must be signed in to change notification settings - Fork 270
Expand file tree
/
Copy pathcreate_configuration.dart
More file actions
58 lines (48 loc) · 1.52 KB
/
create_configuration.dart
File metadata and controls
58 lines (48 loc) · 1.52 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import 'dart:io';
class CreateConfiguration {
final int windowWidth;
final int windowHeight;
/// Position of the top left point of the webview window
final int windowPosX;
final int windowPosY;
/// the title of window
final String title;
final int titleBarHeight;
final int titleBarTopPadding;
final String userDataFolderWindows;
final bool useFullScreen;
final bool disableTitleBar;
final bool useWindowPositionAndSize;
final bool openMaximized;
const CreateConfiguration({
this.windowWidth = 1280,
this.windowHeight = 720,
this.windowPosX = 0,
this.windowPosY = 0,
this.title = "",
this.titleBarHeight = 40,
this.titleBarTopPadding = 0,
this.userDataFolderWindows = 'webview_window_WebView2',
this.useFullScreen = false,
this.disableTitleBar = false,
this.useWindowPositionAndSize = false,
});
factory CreateConfiguration.platform() {
return CreateConfiguration(
titleBarTopPadding: Platform.isMacOS ? 24 : 0,
);
}
Map toMap() => {
"windowWidth": windowWidth,
"windowHeight": windowHeight,
"windowPosX": windowPosX,
"windowPosY": windowPosY,
"title": title,
"titleBarHeight": disableTitleBar ? 0 : titleBarHeight,
"titleBarTopPadding": disableTitleBar ? 0 : titleBarTopPadding,
"userDataFolderWindows": userDataFolderWindows,
"useFullScreen": useFullScreen,
"disableTitleBar": disableTitleBar,
"useWindowPositionAndSize": useWindowPositionAndSize,
};
}