createEventHandler method

Expression createEventHandler(
  1. List<Statement> stmts, {
  2. List<Statement> localDeclarations = const [],
})

Implementation

o.Expression createEventHandler(List<o.Statement> stmts,
    {List<o.Statement> localDeclarations = const []}) {
  var methodName = '_handleEvent_${_eventHandlerCount++}';
  methods.add(_createEventHandlerMethod(
    methodName,
    stmts,
    localDeclarations,
  ));
  return o.ReadClassMemberExpr(methodName);
}