Add relapse db part2
parent
a054906970
commit
0b57c14e05
|
@ -1,5 +1,6 @@
|
||||||
import 'package:smoke_cess_app/interface/db_record.dart';
|
import 'package:smoke_cess_app/interface/db_record.dart';
|
||||||
import 'package:smoke_cess_app/models/mood.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/models/sleep.dart';
|
||||||
import 'package:smoke_cess_app/services/database_service.dart';
|
import 'package:smoke_cess_app/services/database_service.dart';
|
||||||
import 'package:sqflite_common/sqlite_api.dart';
|
import 'package:sqflite_common/sqlite_api.dart';
|
||||||
|
@ -13,6 +14,7 @@ class DatabaseMock implements DatabaseService {
|
||||||
|
|
||||||
final List<Mood> _moodRecords = [];
|
final List<Mood> _moodRecords = [];
|
||||||
final List<Sleep> _sleepRecords = [];
|
final List<Sleep> _sleepRecords = [];
|
||||||
|
final List<Relapse> _relapseRecords = [];
|
||||||
final List<DatabaseRecord> _workoutRecords = [];
|
final List<DatabaseRecord> _workoutRecords = [];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -27,6 +29,12 @@ class DatabaseMock implements DatabaseService {
|
||||||
return Future.value(1);
|
return Future.value(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<int> addRelapse(Relapse relapse) {
|
||||||
|
_relapseRecords.add(relapse);
|
||||||
|
return Future.value(1);
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
// TODO: implement database
|
// TODO: implement database
|
||||||
Future<Database> get database => DatabaseService.instance.database;
|
Future<Database> get database => DatabaseService.instance.database;
|
||||||
|
@ -40,4 +48,9 @@ class DatabaseMock implements DatabaseService {
|
||||||
Future<List<Sleep>> getSleepRecords() {
|
Future<List<Sleep>> getSleepRecords() {
|
||||||
return Future.value(_sleepRecords);
|
return Future.value(_sleepRecords);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<List<Relapse>> getRelapseRecords() {
|
||||||
|
return Future.value(_relapseRecords);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue