You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Seems like floor does not provide a way to do that. And since I try to use dao to access data from table, it gives me a exception like this below:
FlutterError (Binding has not yet been initialized.
The "instance" getter on the ServicesBinding binding mixin is only available once that binding has been initialized.
Typically, this is done by calling "WidgetsFlutterBinding.ensureInitialized()" or "runApp()" (the latter calls the former). Typically this call is done in the "void main()" method. The "ensureInitialized" method is idempotent; calling it multiple times is not harmful. After calling that method, the "instance" getter will return the binding.
In a test, one can call "TestWidgetsFlutterBinding.ensureInitialized()" as the first line in the test's "main()" method to initialize the binding.
If ServicesBinding is a custom binding mixin, there must also be a custom binding class, like WidgetsFlutterBinding, but that mixes in the selected binding, and that is the class that must be constructed before using the "instance" getter.)
But WidgetsFlutterBinding.ensureInitialized() can only called in root isolate, so I don't know how to do.
The text was updated successfully, but these errors were encountered:
@CalsRanna that's true
To do this, you need to implement your own interface that wraps the communication between isolate and UI. Project Drift provides a good explanation of how the interaction with isolate is integrated there. Floor doesn't provide it as feature, but pay your attention to that you can win with UI performance, but data access is going to be slightly slower because of the isolate data communication bridge. So probably it will be better to focus on the profiling of the DB operations count.
Seems like floor does not provide a way to do that. And since I try to use dao to access data from table, it gives me a exception like this below:
But
WidgetsFlutterBinding.ensureInitialized()
can only called in root isolate, so I don't know how to do.The text was updated successfully, but these errors were encountered: