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
I’ve implemented a singleton pattern for the ObjectBox class in my Flutter project, and it works correctly when accessed normally. However, when I started implementing isolates, I'm encountering a LateInitializationError.
LateInitializationError: Field '_instance@85511379' has not been initialized.
#0 ObjectBox._instance (package:inspectassist_bloc/Database/ObjectBox.dart) #1 ObjectBox.instance (package:inspectassist_bloc/Database/ObjectBox.dart:59:36)
is there any solution to fix this
The text was updated successfully, but these errors were encountered:
I’ve implemented a singleton pattern for the ObjectBox class in my Flutter project, and it works correctly when accessed normally. However, when I started implementing isolates, I'm encountering a LateInitializationError.
`import 'package:inspectassist_bloc/objectbox.g.dart';
class ObjectBox {
late final Store store;
late final Box testBox;
ObjectBox._create(this.store) {
testBox = Box(store);
}
static late final ObjectBox _instance;
static Future init() async {
_instance = ObjectBox._create(await openStore());
}
static ObjectBox get instance => _instance;
}`
LateInitializationError: Field '_instance@85511379' has not been initialized.
#0 ObjectBox._instance (package:inspectassist_bloc/Database/ObjectBox.dart)
#1 ObjectBox.instance (package:inspectassist_bloc/Database/ObjectBox.dart:59:36)
is there any solution to fix this
The text was updated successfully, but these errors were encountered: