ServerParam.fromMeta constructor

ServerParam.fromMeta(
  1. MetaParam param
)

Implementation

factory ServerParam.fromMeta(MetaParam param) {
  final importString = param.typeElement.librarySource?.uri.toString();

  ServerImports? importPath;
  if (importString != null) {
    importPath = ServerImports([importString]);
  }

  final paramAnnotations = ServerParamAnnotations.fromMeta(param);

  return ServerParam(
    name: param.name,
    type: param.type,
    isNullable: param.nullable,
    isRequired: param.isRequired,
    isNamed: param.isNamed,
    defaultValue: param.defaultValue,
    hasDefaultValue: param.hasDefaultValue,
    importPath: importPath,
    annotations: paramAnnotations,
    typeImport: param.typeImport,
  );
}