feat(profile): add subscribers and subscriptions

This commit is contained in:
mso7nueh
2024-10-16 15:52:23 +03:00
parent b0f8057aa0
commit 079a712997
11 changed files with 1046 additions and 267 deletions

View File

@@ -1,13 +1,16 @@
import 'package:eatvio_app/features/chat/repositories/chat_repository.dart';
import 'package:eatvio_app/features/profile/presentation/bloc/profile_cubit/profile_state.dart';
import 'package:eatvio_app/features/profile/repositories/profile_repository.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
class ProfileCubit extends Cubit<ProfileState> {
final ProfileRepository profileRepository;
final ChatRepository chatRepository;
String _currentPeriod = '1';
ProfileCubit({
required this.profileRepository,
required this.chatRepository,
}) : super(const ProfileState.loading());
getProfileBySlug(String slug) async {
@@ -71,4 +74,15 @@ class ProfileCubit extends Cubit<ProfileState> {
print(e);
}
}
Future<String> getChatRoomIdBySlug({
required String slug,
}) async {
try {
return (await chatRepository.getChatRoomIdByUserSlug(slug: slug)).id;
} catch (e) {
print(e);
rethrow;
}
}
}