Well, I believe it's not as straightforward as it might seem. I think the challenge lies in:
- Understanding the actual problem we're facing, such as why we need to use OkHttp when we already have dart:io HttpClient.
- Once you grasp the underlying issues, you'll realize why we need to address them.
- Then you will see that the Dart team found they couldn’t implement these futures in dart:io HttpClient without significant effort, so they decided to rely on the OkHttp package through JNI calls.
- Subsequently, you'll need to dive deep into understanding and familiarizing yourself with FFI, JNI, JNIGEN, and their theoretical workings. This might even involve diving into how these packages are put together.
- Next, you'll have to study the implementation details of the package:http library and learn how to write a new Client.
- Finally, you will start writing your new HTTP client, which relies on OkHttp. However, during this step, you will encounter numerous issues with the jnigen package due to its experimental nature and potential concurrency problems.
So I think, while it might appear simple at a glance, there's actually a complex process involved. It's akin to discovering a hidden mountain beneath the water.