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/models/workout.dart'; import 'package:smoke_cess_app/services/database_service.dart'; // ignore: depend_on_referenced_packages import 'package:sqflite_common/sqlite_api.dart'; class DatabaseMock implements DatabaseService { static final DatabaseMock _databaseMock = DatabaseMock._internal(); factory DatabaseMock() { return _databaseMock; } DatabaseMock._internal(); final List _moodRecords = []; final List _sleepRecords = []; final List _relapseRecords = []; final List _workoutRecords = []; @override Future addMood(Mood mood) { _moodRecords.add(mood); return Future.value(1); } @override Future addSleep(Sleep sleep) { _sleepRecords.add(sleep); return Future.value(1); } @override Future addWorkout(Workout workout) { _workoutRecords.add(workout); return Future.value(1); } @override Future addRelapse(Relapse relapse) { _relapseRecords.add(relapse); return Future.value(1); } @override Future get database => DatabaseService.instance.database; @override Future> getMoodRecords() { return Future.value(_moodRecords); } @override Future> getSleepRecords() { return Future.value(_sleepRecords); } @override Future> getRelapseRecords() { return Future.value(_relapseRecords); } @override Future> getWorkoutRecords() { return Future.value(_workoutRecords); } }