fromMap static method

ContextMenu? fromMap(
  1. Map<String, dynamic>? map
)

Gets a possible ContextMenu instance from a Map value.

Implementation

static ContextMenu? fromMap(Map<String, dynamic>? map) {
  if (map == null) {
    return null;
  }
  final instance = ContextMenu(
    menuItems: List<ContextMenuItem>.from(map['menuItems']
        .map((e) => ContextMenuItem.fromMap(e?.cast<String, dynamic>())!)),
    options: map['settings'],
    settings:
        ContextMenuSettings.fromMap(map['settings']?.cast<String, dynamic>()),
  );
  return instance;
}