block method

  1. @override
Future<void> block(
  1. String profileId
)
override

Implementation

@override
Future<void> block(String profileId) async {
  AppConfig.logger.d("Block Mate: $profileId");
  try {
    if (await ProfileFirestore().blockProfile(profileId: profile.id, profileToBlock: mateId)) {
      userServiceImpl.profile.following!.remove(profileId);
      following.value = false;
      userServiceImpl.profile.blockTo!.add(profileId);

      AppConfig.logger.i("Profile $profileId blocked successfully. You can unblock it later.");
    } else {
      AppConfig.logger.i("Something happened while blocking profile");
    }
  } catch (e) {
    AppConfig.logger.e(e.toString());
  }

  Get.back();
  update();
}