File tree Expand file tree Collapse file tree 2 files changed +16
-10
lines changed
examples/app/lib/database Expand file tree Collapse file tree 2 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ class OpenFlutter {
5454 static QueryExecutor _openConnection () {
5555 return driftDatabase (
5656 name: 'my_database' ,
57- native : DriftNativeOptions (
57+ native : const DriftNativeOptions (
5858 // By default, `driftDatabase` from `package:drift_flutter` stores the
5959 // database files in `getApplicationDocumentsDirectory()`.
6060 databaseDirectory: getApplicationSupportDirectory,
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import 'package:drift/drift.dart';
33import 'package:drift_flutter/drift_flutter.dart' ;
44import 'package:flutter/foundation.dart' ;
55import 'package:flutter/material.dart' show Colors;
6+ import 'package:path_provider/path_provider.dart' ;
67import 'package:riverpod/riverpod.dart' ;
78import 'connection/connection.dart' as impl;
89
@@ -21,16 +22,21 @@ class AppDatabase extends _$AppDatabase {
2122 e ??
2223 driftDatabase (
2324 name: 'todo-app' ,
25+ native : const DriftNativeOptions (
26+ databaseDirectory: getApplicationSupportDirectory,
27+ ),
2428 web: DriftWebOptions (
25- sqlite3Wasm: Uri .parse ('sqlite3.wasm' ),
26- driftWorker: Uri .parse ('drift_worker.js' ),
27- onResult: (result) {
28- if (result.missingFeatures.isNotEmpty) {
29- debugPrint (
30- 'Using ${result .chosenImplementation } due to unsupported '
31- 'browser features: ${result .missingFeatures }' );
32- }
33- }),
29+ sqlite3Wasm: Uri .parse ('sqlite3.wasm' ),
30+ driftWorker: Uri .parse ('drift_worker.js' ),
31+ onResult: (result) {
32+ if (result.missingFeatures.isNotEmpty) {
33+ debugPrint (
34+ 'Using ${result .chosenImplementation } due to unsupported '
35+ 'browser features: ${result .missingFeatures }' ,
36+ );
37+ }
38+ },
39+ ),
3440 ),
3541 );
3642
You can’t perform that action at this time.
0 commit comments