objectbox / objectbox-dart

Flutter database for super-fast Dart object persistence
https://docs.objectbox.io/getting-started
Apache License 2.0
927 stars 115 forks source link

Support for multiple views #540

Closed eli1stark closed 11 months ago

eli1stark commented 11 months ago

Since Flutter 3.10, the Flutter team started to prepare support for multiple views and starts to deprecate single view APIs, it will be common for Flutter apps to support this as well in the future. At the moment ObjectBox allows only one view to interact with the database image, when 2nd view will try to access the database error will be thrown. This way if the app is using ObjectBox, it is locked to a single view and can't support multiple views.

Having multiple views is common nowadays, for example when you open app inside another app via dynamic link while you have main view running.

My proposal is to add ability to modify database from multiple views.

Additional information:

  1. https://docs.flutter.dev/release/breaking-changes/window-singleton
  2. https://www.youtube.com/watch?v=vtB-teu57vw
greenrobot-team commented 11 months ago

Thanks for the heads-up! I have not looked at this deeply, but from a first impression is this possibly a duplicate of https://github.com/objectbox/objectbox-dart/issues/436#issuecomment-1465637666?

eli1stark commented 11 months ago

Yes, it looks like it's a duplicate