preface

Most of the pages of your App interact with the data on the back end, which requires a network request library. Dio, like Axios for the Web front, AFNetworking for iOS (Alamofire for Swift), and Retrofit for Android, is the king of the Web request library.

That’s why we spent a lot of time on Dio. Mastering Dio allows us to speed up the interface to the back end! This article makes some summary of the previous chapter, also can facilitate you to find the corresponding chapter.

Dio Article Collection

  1. Dio: We gave a brief introduction to DIO, and we know that if you want to choose the web request library in the Flutter, DIO is the best choice. In this article, we also described the use of GET requests to complete the loading of list data.

  2. Deleting data with Dio Requests: This article introduces an example of DELETING data with Dio DELETE requests.

  3. Detailed editing using Dio Patch request: This paper introduces an example of editing data using Dio Patch request.

  4. Adding Flutter using Post requests: This article introduces an example of adding data using Post requests, while using the Flutter_EasyLoading plug-in to handle click-shake stabilization operations.

  5. Image selection and upload: Wechat_Assets_Picker, a plug-in that mimics wechat image selection, is introduced to implement image selection and upload using Dio’s Multipartfile to construct request form data.

  6. Sync data between different pages using GetIt: This article is only an extension of Dio applications. When a network request is completed, it is inevitable to update the UI or synchronize data. It is also a good choice to use GetIt to implement a watter-like mode to synchronize data.

  7. This article uses the example of How Dio can be encapsulated so that Dio is not exposed to the UI layer and that it is easy to replace the network request library without being aware, which is also an advantage of encapsulation.

  8. Dio’s Interceptor: Lao Wang’s son xiao Wang was difficult to handle, so Lao Wang’s wife came to help. Dio interceptors can not only obtain all wang’s activities before and after the network, but also forge responses to intercept Wang’s behavior of teasing Internet celebrities — this is the great point of Dio interceptors.

  9. Dio comes to an Abrupt End: Once again to the coders, switch off when dating! Lest your romantic date come to a screech-halt when your boss suddenly works overtime. Dio’s CancelToken is just that.

  10. Dio’s CancelToken from the Source code: Nothing venture, Nothing gain? Understand the CancelToken mechanism from the source level, so that we are more defenseable to the sudden call of the leader!

  11. Did you buy a ticket, young man? : Getting on the train without a ticket is possible to get off the bus, and the long last-minute journey still requires a ticket — that is our Session Session. By carrying the Cookie after login, we don’t have to worry about being checked.

  12. A persistent CookieManager: Once we have our tickets, we are afraid of losing them. We need to keep them safe, even if we get off the train on the way. With Dio’s interceptor and SharedPreference plugin, we implement no-perception ticket carrying, hand writing an easier to use CookieManger, you deserve it!

  13. Dio File download: With Dio, file download is also easy, progress can be mastered instantly and can be cancelled at any time, thanks to the CancelToken application, Leadership, which is everywhere to interfere in your work (life).


Don’t you think it’s enough? Stay tuned for the Introduction and Practice column on Flutter as we explore more of the uses of Flutter.