initialize method
- List<
CollectionSchema> schemas
Initialize Isar with provided schemas Schemas should be passed from injection_container where features are known
Implementation
Future<void> initialize(List<CollectionSchema> schemas) async {
if (_isar != null) return; // Already initialized
final dir = await getApplicationDocumentsDirectory();
_isar = await Isar.open(
schemas,
directory: dir.path,
name: 'electrics_app',
);
}