Skip to content

Instantly share code, notes, and snippets.

@PreyeaRegmi
Last active September 8, 2021 11:58
Show Gist options
  • Save PreyeaRegmi/21367b3bbecb69207b01d3dcfe00732f to your computer and use it in GitHub Desktop.
Save PreyeaRegmi/21367b3bbecb69207b01d3dcfe00732f to your computer and use it in GitHub Desktop.
class LoanParamRequest {
final double amount, time;
LoanParamRequest(this.amount, this.time);
}
class LoanDetailResponse {
String? _emi;
}
class LoanDetailDTO {
final double _rate;
LoanDetailDTO(this._rate);
}
abstract class ILoanRepository
{
Future<LoanDetailDTO> getLoanFromServer(String amount,String time);
}
class UseCaseNotImplementedException implements Exception {}
class FetchLoanDetail extends UseCase<LoanParamRequest, LoanDetailResponse> {
final ILoanRepository _loanRepository;
FetchLoanDetail(this._loanRepository);
@override
Stream<LoanDetailResponse> buildUseCase(LoanParamRequest param) {
return Stream.error(UseCaseNotImplementedException());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment