Upon creating my first Dart library, I bumped into the issue of the environment-dependent libraries dart:io and dart:html, and most importantly the fact that some very similar functionality is present in both of them.
It bothered my ever-since that many libraries had to split up into two counterparts and so did some of the classes within. Let's say one of your classes uses WebSockets. The WebSocket is defined differently in dart:io and dart:html. So what you have to do create an abstract class for the general case and then create two subclasses in their own libraries that fill the gap of the WebSocket interface.
It would look like this: