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
import'package:flutter_riverpod/flutter_riverpod.dart';
// ignore: depend_on_referenced_packagesimport'package:path/path.dart'as p;
import'package:path_provider/path_provider.dart';
import'package:appName/objectbox.g.dart';
classObjectBox {
/// The Store of this app.latefinalStore store;
ObjectBox._create(this.store) {
// Add any additional setup code, e.g. build queries.
}
/// Create an instance of ObjectBox to use throughout the app.staticFuture<ObjectBox> create() async {
final docsDir =awaitgetApplicationSupportDirectory();
// Future<Store> openStore() {...} is defined in the generated objectbox.g.dartfinal store =awaitopenStore(directory: p.join(docsDir.path, "appName"));
returnObjectBox._create(store);
}
}
final objectBoxProvider =Provider<ObjectBox>((ref) =>throwUnimplementedError());
/// ... Into mainvar o =awaitObjectBox.create();
runApp(
ProviderScope(
overrides: [objectBoxProvider.overrideWithValue(o)],
child:App(),
),
);
Notes
Somehow I might be related to the folder where the app is installed. It looks like object box database is stored under the container/{containerId} folder which changes everytime.
The text was updated successfully, but these errors were encountered:
Is there an existing issue?
Build info
Flutter 3.24.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision dec2ee5c1f (5 weeks ago) • 2024-11-13 11:13:06 -0800
Engine • revision a18df97ca5
Tools • Dart 3.5.4 • DevTools 2.37.3
Steps to reproduce
flutter build apk --release; flutter install
Expected behavior
Data should be persisted.
Actual behavior
Data are not persisted
Code
Code
Notes
Somehow I might be related to the folder where the app is installed. It looks like object box database is stored under the container/{containerId} folder which changes everytime.
The text was updated successfully, but these errors were encountered: