map<T> method
Accepts a handler for each SourceType variant and runs the appropriate handler for which flavor this instance is.
Implementation
T map<T>({
required T Function(SourceType) local,
required T Function(SourceType) remote,
}) {
return switch (this) {
SourceType.local => local(this),
SourceType.remote => remote(this),
};
}