createRouteArgs function

Map<String, Expression> createRouteArgs({
  1. required ServerRoute route,
  2. ServerReturnType? returnType,
  3. String? classVarName,
  4. String? method,
  5. MetaWebSocketMethod? webSocket,
  6. List<Code> additionalHandlerCode = const [],
})

Implementation

Map<String, Expression> createRouteArgs({
  required ServerRoute route,
  ServerReturnType? returnType,
  String? classVarName,
  String? method,
  MetaWebSocketMethod? webSocket,
  List<Code> additionalHandlerCode = const [],
}) {
  return {
    ...createModifierArgs(annotations: route.annotations),
    if (method != null) 'method': literalString(method),
    if (createHandler(
      route: route,
      returnType: returnType,
      classVarName: classVarName,
      webSocket: webSocket,
      additionalHandlerCode: additionalHandlerCode,
    )
        case final handler?)
      'handler': handler,
  };
}