My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more
Pranav Masekar

11 likes

·

775 reads

2 comments

Shubham Hande
Shubham Hande
Sep 4, 2023

Hello Pranav,

Your tutorial on clean architecture is excellent and easily to understand. Keep up the great work! I have a few questions regarding the 'DataSource' class. In the 'SongRemoteDataSource,' , instead of directly using the Dio plugin to handle HTTP requests, could we use a service class 'core/services/dio_service.dart' along with connectivity service and any other plugin service, By doing so, we can pass this service class to 'SongRemoteDataSource,' enabling us to handle various exceptions such as ServerException, NoInternetException, CacheException, and any other custom exceptions.

Please share your thoughts on this.

·
·1 reply
Pranav Masekar
Pranav Masekar
Author
·Sep 4, 2023

Shubham HandeThanks for the feedback. And yes absolutely using a wrapper service class of dio to handle exception is helpful and will help to reduce code duplication.

1
·