when<T> method
T
when<T>({
- required T bool(),
- required T int(),
- required T num(),
- required T str(),
- required T option(),
- required T duration(),
- required T list(),
- required T set(),
- required T map(),
- required T function(),
- required T nested(),
- required T union(),
- required T unionType(),
- required T enumV(),
- required T dynamic(),
- required T late(),
Implementation
T when<T>({
required T Function() bool,
required T Function() int,
required T Function() num,
required T Function() str,
required T Function(SerdeTypeOption) option,
required T Function() duration,
required T Function(SerdeTypeList) list,
required T Function(SerdeTypeSet) set,
required T Function(SerdeTypeMap) map,
required T Function() function,
required T Function(SerdeTypeNested) nested,
required T Function(SerdeTypeUnion) union,
required T Function(SerdeTypeUnionType) unionType,
required T Function(SerdeTypeEnum<Object?>) enumV,
required T Function() dynamic,
required T Function(SerdeTypeLate) late,
}) {
switch (_inner) {
case 'bool':
return bool();
case 'int':
return int();
case 'num':
return num();
case 'String':
return str();
case 'Duration':
return duration();
case 'Function':
return function();
case 'List':
return list(this as SerdeTypeList);
case 'Set':
return set(this as SerdeTypeSet);
case 'Map':
return map(this as SerdeTypeMap);
case 'Nested':
return nested(this as SerdeTypeNested);
case 'Union':
return union(this as SerdeTypeUnion);
case 'UnionType':
return unionType(this as SerdeTypeUnionType);
case 'enum':
return enumV(this as SerdeTypeEnum);
case 'dynamic':
return dynamic();
case 'Late':
return late(this as SerdeTypeLate);
case 'Option':
return option(this as SerdeTypeOption);
default:
throw Exception('SerdeType._inner $_inner not found in when');
}
}