create method
Future<String?>
create(
- String id, {
- required PaletteAppearance appearance,
- required PaletteSize size,
- String? entryPoint,
- 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;
}