improve shutdown routine
This commit is contained in:
@@ -25,7 +25,7 @@ import 'package:flutter/services.dart' show rootBundle;
|
||||
import 'package:path/path.dart' as p;
|
||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
import 'package:sqlite3_flutter_libs/sqlite3_flutter_libs.dart';
|
||||
|
||||
import 'package:weblibre/core/database_registry.dart';
|
||||
import 'package:weblibre/core/filesystem.dart';
|
||||
import 'package:weblibre/features/quotes/data/database/database.dart';
|
||||
|
||||
@@ -59,6 +59,8 @@ QuotesDatabase quotesDatabase(Ref ref) {
|
||||
}),
|
||||
);
|
||||
|
||||
DatabaseRegistry.instance.register('quotes', db);
|
||||
|
||||
ref.onDispose(() async {
|
||||
await db.close();
|
||||
});
|
||||
|
||||
@@ -48,4 +48,4 @@ final class QuotesDatabaseProvider
|
||||
}
|
||||
}
|
||||
|
||||
String _$quotesDatabaseHash() => r'e5a15556bef876f3a4941957f01bc1457a12a956';
|
||||
String _$quotesDatabaseHash() => r'be623fb69eb03f4c264d1a4fd07300fa669ecc86';
|
||||
|
||||
Reference in New Issue
Block a user