Building Generic and Performant Networking Layer in Flutter | by Dmitry Klimkin | Mar, 2022

Source: undraw.co

Step 0: Design our data model. Let it be something easy to grasp

Step 1: Create a flexible request body

Step 2: Create a request

Step 3. Create a response

Step 4. Let’s prototype our service with what we already have

  • API call is prepared with all headers combined and parameters incapsulated
  • API call is executed by DIO package
  • Data returned from DIO is converted to your Model type provided
  • Exceptions are handled and wrapped in a corresponding API response

Step 5. Make Networking Layer to be performant!

Recap of what we’ve achieved today

Resources

Want to Connect?To get hand-picked the latest tech stories subscribe on my Telegram Channel where I post daily.

Leave a Comment