TF-571 Implement AccountRepository with HiveAccountDataSource
This commit is contained in:
committed by
Dat H. Pham
parent
f8e7429751
commit
ff6e6d8878
@@ -0,0 +1,22 @@
|
||||
import 'package:core/utils/app_logger.dart';
|
||||
import 'package:model/account/account.dart';
|
||||
import 'package:tmail_ui_user/features/login/data/datasource/account_datasource.dart';
|
||||
import 'package:tmail_ui_user/features/login/domain/repository/account_repository.dart';
|
||||
|
||||
class AccountRepositoryImpl extends AccountRepository {
|
||||
|
||||
final AccountDatasource _accountDatasource;
|
||||
|
||||
AccountRepositoryImpl(this._accountDatasource);
|
||||
|
||||
@override
|
||||
Future<Account> getCurrentAccount() {
|
||||
return _accountDatasource.getCurrentAccount();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> setCurrentAccount(Account newCurrentAccount) {
|
||||
log('AccountRepositoryImpl::setCurrentAccount(): $newCurrentAccount');
|
||||
return _accountDatasource.setCurrentAccount(newCurrentAccount);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user