Browse Source

[example] Add catch sqflite

embedder_texture
Vitaliy Zarubin 1 year ago
parent
commit
3413ecd9a3
  1. 5
      example/lib/packages/sqflite/model.dart

5
example/lib/packages/sqflite/model.dart

@ -31,6 +31,7 @@ class SqfliteModel extends Model {
/// Init database
Future<void> init() async {
try {
// Get a location using getDatabasesPath
var databasesPath = await getDatabasesPath();
String path = p.join(databasesPath, 'demo.db');
@ -51,6 +52,10 @@ class SqfliteModel extends Model {
)''');
},
);
} catch (e) {
_error = e.toString();
}
notifyListeners();
}
/// Close database

Loading…
Cancel
Save