TypeDefinition.mixedUrlAndClassName constructor
TypeDefinition.mixedUrlAndClassName({})
Creates an TypeDefinition from mixed
where the url
and className is separated by ':'.
Implementation
factory TypeDefinition.mixedUrlAndClassName({
required String mixed,
List<TypeDefinition> generics = const [],
required bool nullable,
bool customClass = false,
d.int? vectorDimension,
}) {
var parts = mixed.split(':');
var classname = parts.last;
var url = mixed != 'ByteData'
? (parts..removeLast()).join(':')
: 'dart:typed_data';
return TypeDefinition(
className: classname,
nullable: nullable,
generics: generics,
url: url.isNotEmpty ? url : null,
customClass: customClass,
vectorDimension: vectorDimension,
);
}