TF-886 Remove method get/save/remove user profile because not used

This commit is contained in:
dab246
2022-09-06 23:50:28 +07:00
committed by Dat H. Pham
parent 37d36e90a4
commit f1e512148d
7 changed files with 0 additions and 56 deletions
@@ -1,6 +1,4 @@
import 'dart:convert';
import 'package:model/model.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:tmail_ui_user/features/login/data/local/authentication_info_cache_manager.dart';
import 'package:tmail_ui_user/features/login/data/model/authentication_info_cache.dart';
@@ -32,25 +30,6 @@ class CredentialRepositoryImpl extends CredentialRepository {
await sharedPreferences.remove(LoginConstant.keyBaseUrl);
}
@override
Future<UserProfile> getUserProfile() async {
final json = sharedPreferences.getString(LoginConstant.keyUserProfile) ?? '';
Map<String, dynamic> mapObject = jsonDecode(json);
return UserProfileResponse.fromJson(mapObject).toUserProfile();
}
@override
Future removeUserProfile() async {
await sharedPreferences.remove(LoginConstant.keyUserProfile);
}
@override
Future saveUserProfile(UserProfile userProfile) async {
final userProfileResponse = userProfile.toUserProfileResponse();
final json = jsonEncode(userProfileResponse.toJson());
await sharedPreferences.setString(LoginConstant.keyUserProfile, json);
}
@override
Future<void> storeAuthenticationInfo(AuthenticationInfoCache authenticationInfoCache) {
return _authenticationInfoCacheManager.storeAuthenticationInfo(authenticationInfoCache);