toMap method

  1. @override
Map<Object, Map<String, Object>> toMap()
override

The representation of the event in a form, acceptable by a pure dart library, that cannot depend on Flutter.

The method enables code like:

void myDartMethod(Map<Object, Map<String, Object>> event) {}
FlutterMemoryAllocations.instance
  .addListener((ObjectEvent event) => myDartMethod(event.toMap()));

Implementation

@override
Map<Object, Map<String, Object>> toMap() {
  return <Object, Map<String, Object>>{object: <String, Object>{
    _FieldNames.libraryName: library,
    _FieldNames.className: className,
    _FieldNames.eventType: 'created',
  }};
}