refactor: rebuild using drift instead of isar
This commit is contained in:
parent
952e82eb08
commit
ee89f327bd
25 changed files with 2182 additions and 6389 deletions
|
|
@ -1,13 +1,8 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:isar/isar.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
|
||||
import 'src/app.dart';
|
||||
import 'src/shared/data/local/collections/user_collection.dart';
|
||||
import 'src/shared/data/local/collections/cycle_collection.dart';
|
||||
import 'src/shared/data/local/collections/workout_collection.dart';
|
||||
import 'src/shared/data/local/app_database.dart';
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
|
@ -17,19 +12,15 @@ void main() async {
|
|||
DeviceOrientation.portraitDown,
|
||||
]);
|
||||
|
||||
final dir = await getApplicationDocumentsDirectory();
|
||||
final isar = await Isar.open(
|
||||
[UserCollectionSchema, CycleCollectionSchema, WorkoutCollectionSchema],
|
||||
directory: dir.path,
|
||||
name: 'slrpg_db',
|
||||
);
|
||||
final database = AppDatabase();
|
||||
|
||||
runApp(
|
||||
ProviderScope(
|
||||
overrides: [isarProvider.overrideWithValue(isar)],
|
||||
overrides: [appDatabaseProvider.overrideWithValue(database)],
|
||||
child: const SLRPGApp(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
final isarProvider = Provider<Isar>((ref) => throw UnimplementedError());
|
||||
final appDatabaseProvider =
|
||||
Provider<AppDatabase>((ref) => throw UnimplementedError());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue