Write dart code that works in both the browser and server