SpacetimeDB icon indicating copy to clipboard operation
SpacetimeDB copied to clipboard

Dart support

Open pierremrtn opened this issue 9 months ago • 4 comments

Having Dart support would allow us to use SpacetimeDB to build Flutter applications. Firebase firestore + cloud functions is a very popular choice for Flutter apps, Maybe SpaceTimeDB could be a good replacement ?

pierremrtn avatar Mar 15 '25 07:03 pierremrtn

Thanks for filing an issue! We definitely have this on our radar for future implementation 🙂

bfops avatar Apr 02 '25 23:04 bfops

I would be very, very interested aswell! To add here @pierremrtn : Do you think using the flutter_rust_bridge package and using their rust SDK could be an option for us?

user425846 avatar Apr 08 '25 09:04 user425846

Unfortunately, my current understanding of SpacetimeDB is very limited, so I don't know what the options are, @bfops surely has more insight about this, but I would hope that there is a more direct path to achieve this rather than a Rust interop.

pierremrtn avatar Apr 10 '25 07:04 pierremrtn

See also the discussion about flutter_rust_bridge here: https://github.com/clockworklabs/SpacetimeDB/issues/2565.

bfops avatar Apr 10 '25 16:04 bfops

I think, it's possible to transpile TypeScript SDK into Dart SDK because it looks pretty stable. I made a little investigation and get a promising results but I still have lack of understand how to transpile client_api's files.

Speaking about flutter_rust_bridge, I don't think if it's a good approach. You will need to modify Rust code to support this bridge.

AlexQuidditch avatar May 27 '25 23:05 AlexQuidditch

I have transpiled TypeScript SDK into Dart, but it requires a lot addtional effort to make it work in runtime. I found another solution: you can use flutter_webview as wrapper around module_bindings lib. Yep, it sound messy and requieres some work to make communication layer between Dart code and WebView JS code, but it works :)

AlexQuidditch avatar May 30 '25 14:05 AlexQuidditch