feat : profile and map
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
|
||||
import 'package:rasadyar_inspection/data/model/response/user_profile/user_profile_model.dart';
|
||||
|
||||
abstract class UserRepository {
|
||||
/// Fetches the user profile from the remote data source.
|
||||
///
|
||||
/// Returns a [Future] that resolves to a [UserProfileModel].
|
||||
Future<UserProfileModel?> fetchUserProfile({required String token});
|
||||
|
||||
/// Updates the user profile in the remote data source.
|
||||
///
|
||||
/// Takes a [UserProfileModel] as an argument and returns a [Future] that resolves to a boolean indicating success or failure.
|
||||
Future<bool> updateUserProfile(UserProfileModel userProfile);
|
||||
|
||||
/// Changes the password of the user in the remote data source.
|
||||
///
|
||||
/// Takes the old password, new password, and confirm password as arguments and returns a [Future] that resolves to a boolean indicating success or failure.
|
||||
Future<bool> changePassword(String oldPassword, String newPassword, String confirmPassword);
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
|
||||
import 'package:rasadyar_inspection/data/data_source/remote/user/user_data_source_imp.dart';
|
||||
import 'package:rasadyar_inspection/data/model/response/user_profile/user_profile_model.dart';
|
||||
|
||||
import 'user_repository.dart';
|
||||
|
||||
class UserRepositoryImp implements UserRepository {
|
||||
final UserRemoteDataSourceImp _remoteDataSource;
|
||||
|
||||
UserRepositoryImp(this._remoteDataSource);
|
||||
|
||||
@override
|
||||
Future<bool> changePassword(String oldPassword, String newPassword, String confirmPassword) {
|
||||
// TODO: implement changePassword
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<UserProfileModel?> fetchUserProfile({required String token}) async {
|
||||
return await _remoteDataSource.getProfile(token: token);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<bool> updateUserProfile(UserProfileModel userProfile) {
|
||||
// TODO: implement updateUserProfile
|
||||
throw UnimplementedError();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user