File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ class DB {
7272 return project;
7373 }
7474
75- void deleteEntireDatabase () async {
75+ Future < void > deleteEntireDatabase () async {
7676 String fn = await filepath ();
7777 Database db = await _db;
7878 await db.close ();
Original file line number Diff line number Diff line change @@ -80,7 +80,9 @@ class DeleteDatabaseScreen extends StatelessWidget {
8080 child: const Text ("Don't Delete" ),
8181 ),
8282 ElevatedButton (
83- onPressed: () => deleteProject (context),
83+ onPressed: () async {
84+ await deleteProject (context);
85+ },
8486 style: ButtonStyle (
8587 backgroundColor: MaterialStateProperty .resolveWith ((states) => Colors .red),
8688 ),
@@ -99,8 +101,8 @@ class DeleteDatabaseScreen extends StatelessWidget {
99101 Navigator .of (context).pop ();
100102 }
101103
102- void deleteProject (BuildContext context) async {
103- db.deleteEntireDatabase ();
104+ Future < void > deleteProject (BuildContext context) async {
105+ await db.deleteEntireDatabase ();
104106 if (context.mounted) {
105107 Navigator .of (context).pop ();
106108 }
You can’t perform that action at this time.
0 commit comments