An example of a simple API call to update a user profile data in Flutter.

Today I learned in flutter how to work with API. In my use-case, I am updating user profile data. So the flow is when the user profile edit screen first mounts - I load current user data from API and put the user details as an initial value in their respective input fields. I just have the user's first name and last name. This is the initial step. Now the main part is to update the user profile with the API call. So on the save function I use dio to update the user profile with a new user first…