callbackClosure static method

String callbackClosure({
  1. List<String> args = const [],
  2. required String body,
})

Build a closure for a javascript callback.

args are the parameters accepted by the function.

Implementation

static String callbackClosure({List<String> args = const [], required String body}) => '''
  function(${args.join(', ')}) {
    $body
  }
''';