2021-07-13 13:14:49 +08:00
|
|
|
import 'package:dartz/dartz.dart';
|
2021-07-13 14:28:01 +08:00
|
|
|
import 'package:flowy_sdk/protobuf/flowy-user/protobuf.dart';
|
2021-07-21 15:43:05 +08:00
|
|
|
import 'package:app_flowy/user/domain/i_auth.dart';
|
|
|
|
import 'package:app_flowy/user/infrastructure/repos/auth_repo.dart';
|
2021-07-13 13:14:49 +08:00
|
|
|
|
|
|
|
class AuthImpl extends IAuth {
|
|
|
|
AuthRepository repo;
|
|
|
|
AuthImpl({
|
|
|
|
required this.repo,
|
|
|
|
});
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<Either<UserDetail, UserError>> signIn(
|
|
|
|
String? email, String? password) {
|
|
|
|
return repo.signIn(email: email, password: password);
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<Either<UserDetail, UserError>> signUp(
|
|
|
|
String? name, String? password, String? email) {
|
|
|
|
return repo.signUp(name: name, password: password, email: email);
|
|
|
|
}
|
2021-07-13 13:23:03 +08:00
|
|
|
|
|
|
|
@override
|
|
|
|
Future<Either<Unit, UserError>> signOut() {
|
|
|
|
return repo.signOut();
|
|
|
|
}
|
2021-07-13 13:14:49 +08:00
|
|
|
}
|