create method

Future<String?> create(
  1. String id, {
  2. required PaletteAppearance appearance,
  3. required PaletteSize size,
  4. String? entryPoint,
  5. bool keepAlive = false,
})

Create a new window.

Returns the window handle/ID on success.

Implementation

Future<String?> create(
  String id, {
  required PaletteAppearance appearance,
  required PaletteSize size,
  String? entryPoint,
  bool keepAlive = false,
}) async {
  final result = await send<String>('create', windowId: id, params: {
    'id': id,
    'entryPoint': entryPoint ?? 'paletteMain',
    'cornerRadius': appearance.cornerRadius,
    'shadow': appearance.shadow.name,
    'transparent': appearance.transparent,
    'debugBorder': appearance.debugBorder,
    if (appearance.backgroundColor != null)
      'backgroundColor': appearance.backgroundColor!.toARGB32(),
    // Size config - stored on native side for runtime queries
    ...size.toMap(),
    'keepAlive': keepAlive,
  });
  return result;
}