simple dbhelper with Isar

This commit is contained in:
SomnusVeritas
2023-11-08 10:39:31 +01:00
parent c594c3a0c7
commit c5f5a8654c
3 changed files with 29 additions and 5 deletions

View File

@@ -1 +1,16 @@
class DbHelper {}
import 'package:path_provider/path_provider.dart';
import 'package:isar/isar.dart';
import '../models/todo.dart';
class DbHelper {
static late Isar _isar;
static init() async {
final dir = await getApplicationDocumentsDirectory();
_isar = Isar.open(
schemas: [TodoSchema],
directory: dir.path,
);
}
}