Well, other tools like B4X implement this years ago and, there are lots of points to do that. Share almost all the code with the base class but use the #If Then to fine tune platform specific features.
And they do it for desktop, iOS and Android, so, you can have a single codebase with access to platform specific features.