UpdateProperties constructor
UpdateProperties({})
Implementation
UpdateProperties({
ItemType? type,
String? title,
bool? checked,
List<ContextType>? contexts,
/// Whether the item is visible in the menu.
bool? visible,
JSFunction? onclick,
/// The ID of the item to be made this item's parent. Note: You cannot set
/// an item to become a child of its own descendant.
Object? parentId,
List<String>? documentUrlPatterns,
List<String>? targetUrlPatterns,
bool? enabled,
}) : _wrapped = $js.UpdateProperties(
type: type?.toJS,
title: title,
checked: checked,
contexts: contexts?.toJSArray((e) => e.toJS),
visible: visible,
onclick: onclick,
parentId: switch (parentId) {
int() => parentId.jsify()!,
String() => parentId.jsify()!,
null => null,
_ => throw UnsupportedError(
'Received type: ${parentId.runtimeType}. Supported types are: int, String')
},
documentUrlPatterns: documentUrlPatterns?.toJSArray((e) => e),
targetUrlPatterns: targetUrlPatterns?.toJSArray((e) => e),
enabled: enabled,
);