createWindow method

Future<Window?> createWindow(
  1. String? id,
  2. WindowConfig config, {
  3. bool start = false,
  4. Window? window,
})

create window to create a window

Implementation

Future<Window?> createWindow(
  String? id,
  WindowConfig config, {
  bool start = false, // start immediately if true
  Window? window,
}) async {
  var w = isWindow
      ? await currentWindow?.createChildWindow(id, config,
          start: start, window: window)
      : await internalCreateWindow(id, config,
          start: start, window: window, channel: _channel);
  if (w == null) return null;
  // store current window for window engine
  // for window engine use, update the current window
  // if we use create_window first?
  // _window = w; // we should don't use create_window first!!!
  // store the window to cache
  _windows[w.id] = w;
  return w;
}