run method
Implementation
@override
Future<T> run() async {
try {
final response = await _request();
return switch (mapper?.mapResponse) {
final f? => f(response),
_ => switch (mapper?.mapData) {
final f? => f(response.data),
_ => switch (mapper?.mapJson) {
final f? => f(response.data as Map<String, dynamic>),
_ => response.data as T,
}
}
};
} catch (e) {
return switch (mapper?.onError) {
final f? => f(e),
_ => e as T,
};
}
}