Using Cesium on Flutter

Can Cesium be integrated into a flutter/Dart app and also be distributed to iOS platform?

In general, Cesium itself can work completely offline as part of a mobile app. You just need to point it to imagery/terrain/data that is also part of the app. Plenty of devs on this forum have had great success with this strategy on any number of platforms, iOS, Android, etc…

Flutter itself does not support WebGL directly, so in order to use Cesium in a Flutter app you would need to embed it in a WebView. I quick search shows that people have had mixed success with this approach, for example this comment here: https://github.com/flutter/flutter/issues/29892#issuecomment-541781217. So it might work great for you, depending on your exact use case and target hardware.

Once inside the WebView, there’s nothing special about Cesium regarding how you interface with it, it’s just like embedding any other web content.

Hope that helps.

1 Like

Ultimately what I’m trying to do is display the globe and use some of the functionality built in like latitude and longitude to add annotations to the map at specific points. Would displaying in web view in this manner still give me access to the functionality in the api?

In general, yes, but I have extremely limited knowledge of flutter specifically so you might be better off asking about working with webviews through flutter’s own community support channels. Every other WebView mechanism I have ever worked with has a way to do what you want.

So far I can’t seem to even figure out how to call into the api in flutter. There doesn’t seem to be a way to input my token. Any help would be appreciated.

I’m sorry, but I don’t know any additional Flutter knowledge. I suggest you ask the Flutter community for help using webviews, since that it the main feature you need for Cesium interop: https://flutter.dev/community

Thank you for the reply. I was able to get it working perfectly. :blush:

2 Likes

How do you have integrated with Flutter ?
Do you have an example ?
Thank you.

I played around with it for a bit and was able to get it working in a webview in flutter, but to communicate back and forth with the java side seems you have to code on the native android and iOS platform to get it working properly so I threw in the towel for a simple google map which was all I really needed, really wanted something closer to google earth. There are some flutter JS plugins that are out there that may work but I switched before fully exploring their potential.

Good luck and I’d love to hear about any success you may have.

Itheyus.

There is a true 3D effort happening with Flutter based on WebGPU.

As far as using it with a WebView you just need to wrap the JS API with a Dart API and it will work on Web, Mobile and Desktop.