Merge pull request 'offline' (#5) from offline into master
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
Reviewed-on: #5pull/7/head
commit
af07fc3958
@ -0,0 +1,95 @@
|
||||
import 'package:smartfit_app_mobile/modele/activity.dart';
|
||||
import 'package:smartfit_app_mobile/modele/local_db/db_impl.dart';
|
||||
import 'package:smartfit_app_mobile/modele/user.dart';
|
||||
|
||||
class DbDummy implements DbImpl {
|
||||
DbDummy._create();
|
||||
DbDummy();
|
||||
@override
|
||||
Future<DbDummy> create() async {
|
||||
return DbDummy._create();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> init() {
|
||||
throw Exception();
|
||||
}
|
||||
|
||||
// ==== USER ====
|
||||
@override
|
||||
void addUser(String username, String email, String token) {
|
||||
throw Exception();
|
||||
}
|
||||
|
||||
@override
|
||||
User getUser() {
|
||||
throw Exception();
|
||||
}
|
||||
|
||||
@override
|
||||
bool hasUser() {
|
||||
throw Exception();
|
||||
}
|
||||
|
||||
@override
|
||||
void deleteUser() {
|
||||
throw Exception();
|
||||
}
|
||||
|
||||
@override
|
||||
void setUserMail(String email) {
|
||||
throw Exception();
|
||||
}
|
||||
|
||||
@override
|
||||
void setUserName(String username) {
|
||||
throw Exception();
|
||||
}
|
||||
|
||||
@override
|
||||
void setUserToken(String token) {
|
||||
throw Exception();
|
||||
}
|
||||
|
||||
// ==== ACTIVITY ====
|
||||
@override
|
||||
void addActivity(String uuid, String filename, String category, String info) {
|
||||
throw Exception();
|
||||
}
|
||||
|
||||
@override
|
||||
void removeActivity(String uuid) {
|
||||
throw Exception();
|
||||
}
|
||||
|
||||
@override
|
||||
void removeAllActivities() {
|
||||
throw Exception();
|
||||
}
|
||||
|
||||
@override
|
||||
String getActivityFilenameByUuid(String uuid) {
|
||||
throw Exception();
|
||||
}
|
||||
|
||||
@override
|
||||
List<ActivityOfUser> getAllActivities() {
|
||||
throw Exception();
|
||||
}
|
||||
|
||||
// ==== CONFIG ====
|
||||
@override
|
||||
void initConfig() {
|
||||
throw Exception();
|
||||
}
|
||||
|
||||
@override
|
||||
void setSaveLocally(bool saveLocally) {
|
||||
throw Exception();
|
||||
}
|
||||
|
||||
@override
|
||||
bool getSaveLocally() {
|
||||
throw Exception();
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
import 'package:smartfit_app_mobile/modele/user.dart';
|
||||
import 'package:smartfit_app_mobile/modele/activity.dart';
|
||||
|
||||
abstract class DbImpl {
|
||||
DbImpl._create();
|
||||
|
||||
Future<DbImpl> create();
|
||||
|
||||
Future<void> init();
|
||||
|
||||
// ==== USER ====
|
||||
void addUser(String username, String email, String token);
|
||||
User getUser();
|
||||
bool hasUser();
|
||||
void deleteUser();
|
||||
void setUserMail(String email);
|
||||
void setUserName(String username);
|
||||
void setUserToken(String token);
|
||||
|
||||
// ==== ACTIVITY ====
|
||||
void addActivity(String uuid, String filename, String category, String info);
|
||||
void removeActivity(String uuid);
|
||||
void removeAllActivities();
|
||||
String getActivityFilenameByUuid(String uuid);
|
||||
List<ActivityOfUser> getAllActivities();
|
||||
|
||||
// ==== CONFIG ====
|
||||
void initConfig();
|
||||
void setSaveLocally(bool saveLocally);
|
||||
bool getSaveLocally();
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
import 'package:smartfit_app_mobile/modele/local_db/db_impl.dart';
|
||||
import 'package:smartfit_app_mobile/modele/local_db/objectbox.dart';
|
||||
|
||||
DbImpl getDbImpl() {
|
||||
DbImpl db = ObjectBox();
|
||||
return db;
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
import 'package:smartfit_app_mobile/modele/local_db/db_impl.dart';
|
||||
import 'package:smartfit_app_mobile/modele/local_db/db_dummy.dart';
|
||||
|
||||
DbImpl getDbImpl() {
|
||||
DbImpl db = DbDummy();
|
||||
return db;
|
||||
}
|
Loading…
Reference in new issue