Implement model interface

Hi,

We are using realm in our flutter app rebuild (coming from vue).

Generally we would cast responses from our db api to models. In the case of realm we have the db local to the app so this isnt necessarily needed. Howveer we like to operate by separation of concerns and ensure our repository layer is completely abstracted from subsequent layers.

This is proving challenging with realm. We intended to implement an interface to do this but the realm models were throwing errors.

Are interfaces supported with realm models?

Is it recommended to work directly with realm objects in the ui layer? This would seem odd to be given realm objects do not appear to be mutable outside of a realm write.

It also appears challenging in that realm models do not permit factories.

How are other people mutating their models via the ui?