rand dart fix
This commit is contained in:
@@ -10,17 +10,9 @@ void newWindow(
|
||||
}) {
|
||||
final screen = html.window.screen;
|
||||
double top = 0;
|
||||
if (dy != null) {
|
||||
top = dy;
|
||||
} else if (screen.height != null) {
|
||||
top = (screen.height - height) / 2;
|
||||
}
|
||||
top = dy;
|
||||
double left = 0;
|
||||
if (dx != null) {
|
||||
left = dx;
|
||||
} else if (screen.width != null) {
|
||||
left = (screen.width - width) / 2;
|
||||
}
|
||||
left = dx;
|
||||
final sb = StringBuffer();
|
||||
sb.write("height=");
|
||||
sb.write(height);
|
||||
|
||||
@@ -64,8 +64,6 @@ class NewWindow {
|
||||
}
|
||||
|
||||
static NewWindow fromMap(Map<String, dynamic> map) {
|
||||
if (map == null) return null;
|
||||
|
||||
return NewWindow(
|
||||
url: map['url'],
|
||||
width: map['width'],
|
||||
@@ -114,8 +112,8 @@ void createWindow(NewWindow window) {
|
||||
window.url,
|
||||
window.width,
|
||||
window.height,
|
||||
dx: window?.offsetX,
|
||||
dy: window?.offsetY,
|
||||
name: window?.name,
|
||||
dx: window.offsetX,
|
||||
dy: window.offsetY,
|
||||
name: window.name,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -84,10 +84,10 @@ class _MyAppState extends State<MyApp> {
|
||||
final height = size.height;
|
||||
final width = size.width;
|
||||
final sb = StringBuffer();
|
||||
final top = offset?.dy ??
|
||||
final top = offset.dy ??
|
||||
(screen.height != null ? (screen.height - height) / 2 : 0);
|
||||
final left =
|
||||
offset?.dx ?? (screen.width != null ? (screen.width - width) / 2 : 0);
|
||||
offset.dx ?? (screen.width != null ? (screen.width - width) / 2 : 0);
|
||||
sb.write("height=");
|
||||
sb.write(height);
|
||||
sb.write(",width=");
|
||||
|
||||
Reference in New Issue
Block a user