TODO: Put a short description of the package here that helps potential users know whether this package might be useful for them.
TODO: List what your package can do. Maybe include images, gifs, or videos.
base_repository:
version: ^0.1.1
git: git@github.com:dronn1k-org/base_repository.git
enum ProjectApiUrl implements ApiUrl {
prod('https://prod.template.com',),
dev('https://dev.template.com');
const ProjectApiUrl(this.url);
@override
final String url;
}
class GeneralResponseBody<T extends DTO> extends BaseResponseBody {
String? success;
T? data;
String? message;
}
class GeneralCbResult<T> extends BaseCallbackResult<T, String> {
const GeneralCbResult({
required super.callbackStatus,
super.statusCode,
super.data,
super.errors,
});
}
class GeneralRepository extends BaseRepository<GeneralResponseBody<DTO>, String,
GeneralCbResult<DTO>> {
@override
Future<GeneralCbResult<T>> request<T extends DTO>(
ClientCallback<GeneralResponseBody<DTO>> callback) async {
return GeneralCbResult<T>(callbackStatus: ApiCallbackStatus.success);
}
@override
ProjectApiUrl currentUrl = ProjectApiUrl.prod;
@override
HeadersType headers = {
'accept': 'application/json',
'content': 'application/json',
};
@override
OnErrorDioInterceptor onError = (error, handler) {
return handler.next(error);
};
@override
OnRequestDioInterceptor onRequest = (request, handler) {
return handler.next(request);
};
@override
OnResponseDioInterceptor onResponse = (response, handler) {
return handler.next(response);
};
}
TODO: Tell users more about the package: where to find more information, how to contribute to the package, how to file issues, what response they can expect from the package authors, and more.