From 0b57c14e05365544a294dcab9cbf9128b7022f59 Mon Sep 17 00:00:00 2001 From: "k.mannweiler" <2012491@stud.hs-mannheim.de> Date: Sun, 26 Feb 2023 23:29:47 +0100 Subject: [PATCH] Add relapse db part2 --- lib/mock/db_mock.dart | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/mock/db_mock.dart b/lib/mock/db_mock.dart index a06f003..e7c60c3 100644 --- a/lib/mock/db_mock.dart +++ b/lib/mock/db_mock.dart @@ -1,5 +1,6 @@ import 'package:smoke_cess_app/interface/db_record.dart'; import 'package:smoke_cess_app/models/mood.dart'; +import 'package:smoke_cess_app/models/relapse.dart'; import 'package:smoke_cess_app/models/sleep.dart'; import 'package:smoke_cess_app/services/database_service.dart'; import 'package:sqflite_common/sqlite_api.dart'; @@ -13,6 +14,7 @@ class DatabaseMock implements DatabaseService { final List _moodRecords = []; final List _sleepRecords = []; + final List _relapseRecords = []; final List _workoutRecords = []; @override @@ -27,6 +29,12 @@ class DatabaseMock implements DatabaseService { return Future.value(1); } + @override + Future addRelapse(Relapse relapse) { + _relapseRecords.add(relapse); + return Future.value(1); + } + @override // TODO: implement database Future get database => DatabaseService.instance.database; @@ -40,4 +48,9 @@ class DatabaseMock implements DatabaseService { Future> getSleepRecords() { return Future.value(_sleepRecords); } + + @override + Future> getRelapseRecords() { + return Future.value(_relapseRecords); + } }