diff --git a/packages/flutter_chat_firebase/lib/service/firebase_chat_overview_service.dart b/packages/flutter_chat_firebase/lib/service/firebase_chat_overview_service.dart index 81ee249..7c4474f 100644 --- a/packages/flutter_chat_firebase/lib/service/firebase_chat_overview_service.dart +++ b/packages/flutter_chat_firebase/lib/service/firebase_chat_overview_service.dart @@ -241,7 +241,7 @@ class FirebaseChatOverviewService implements ChatOverviewService { /// /// [chatId]: The ID of the chat. @override - Future getChatById(String chatId) async { + Future getChatById(String chatId, String iamBreakingStuff) async { var currentUser = await _userService.getCurrentUser(); var chatCollection = await _db .collection(_options.usersCollectionName) diff --git a/packages/flutter_chat_interface/lib/src/service/chat_overview_service.dart b/packages/flutter_chat_interface/lib/src/service/chat_overview_service.dart index 7329abf..7bb7f65 100644 --- a/packages/flutter_chat_interface/lib/src/service/chat_overview_service.dart +++ b/packages/flutter_chat_interface/lib/src/service/chat_overview_service.dart @@ -9,7 +9,7 @@ abstract class ChatOverviewService { Future getChatByUser(ChatUserModel user); /// Retrieves a chat based on the ID. - Future getChatById(String id); + Future getChatById(String id, String iamBreakingStuff); /// Deletes the chat for this user and the other users in the chat. Future deleteChat(ChatModel chat); diff --git a/packages/flutter_chat_local/lib/service/local_chat_detail_service.dart b/packages/flutter_chat_local/lib/service/local_chat_detail_service.dart index a20289c..ee1076c 100644 --- a/packages/flutter_chat_local/lib/service/local_chat_detail_service.dart +++ b/packages/flutter_chat_local/lib/service/local_chat_detail_service.dart @@ -29,7 +29,7 @@ class LocalChatDetailService with ChangeNotifier implements ChatDetailService { int pageSize, String chatId, ) async { - var value = await chatOverviewService.getChatById(chatId); + var value = await chatOverviewService.getChatById(chatId, "test"); _cumulativeMessages.clear(); if (value.messages != null) { _cumulativeMessages.addAll(value.messages!); @@ -46,8 +46,10 @@ class LocalChatDetailService with ChangeNotifier implements ChatDetailService { String chatId, ) { _controller.onListen = () async { - _subscription = - chatOverviewService.getChatById(chatId).asStream().listen((event) { + _subscription = chatOverviewService + .getChatById(chatId, "test") + .asStream() + .listen((event) { if (event.messages != null) { _cumulativeMessages.clear(); _cumulativeMessages.addAll(event.messages!); diff --git a/packages/flutter_chat_local/lib/service/local_chat_overview_service.dart b/packages/flutter_chat_local/lib/service/local_chat_overview_service.dart index cf67089..4692702 100644 --- a/packages/flutter_chat_local/lib/service/local_chat_overview_service.dart +++ b/packages/flutter_chat_local/lib/service/local_chat_overview_service.dart @@ -36,7 +36,7 @@ class LocalChatOverviewService } @override - Future getChatById(String id) { + Future getChatById(String id, String iamBreakingStuff) { var chat = _chats.firstWhere((element) => element.id == id); debugPrint("Retrieved chat by ID: $chat"); debugPrint("Messages are: ${chat.messages?.length}"); diff --git a/packages/flutter_chat_view/lib/src/screens/chat_detail_screen.dart b/packages/flutter_chat_view/lib/src/screens/chat_detail_screen.dart index 5ae9d88..cc118fa 100644 --- a/packages/flutter_chat_view/lib/src/screens/chat_detail_screen.dart +++ b/packages/flutter_chat_view/lib/src/screens/chat_detail_screen.dart @@ -80,8 +80,8 @@ class _ChatDetailScreenState extends State { messageSubscription = widget.service.chatDetailService; messageSubscription.addListener(onListen); Future.delayed(Duration.zero, () async { - chat = - await widget.service.chatOverviewService.getChatById(widget.chatId); + chat = await widget.service.chatOverviewService + .getChatById(widget.chatId, ""); if (detailRows.isEmpty && context.mounted) { await widget.service.chatDetailService.fetchMoreMessage( @@ -164,7 +164,7 @@ class _ChatDetailScreenState extends State { return FutureBuilder( // ignore: discarded_futures - future: widget.service.chatOverviewService.getChatById(widget.chatId), + future: widget.service.chatOverviewService.getChatById(widget.chatId, ""), builder: (context, AsyncSnapshot snapshot) { var chatModel = snapshot.data; var chatTitle = (chatModel is GroupChatModel) diff --git a/packages/flutter_chat_view/lib/src/screens/chat_profile_screen.dart b/packages/flutter_chat_view/lib/src/screens/chat_profile_screen.dart index e39f59c..3a0ed2f 100644 --- a/packages/flutter_chat_view/lib/src/screens/chat_profile_screen.dart +++ b/packages/flutter_chat_view/lib/src/screens/chat_profile_screen.dart @@ -1,3 +1,5 @@ +// ignore_for_file: discarded_futures + import "package:flutter/material.dart"; import "package:flutter_chat_view/flutter_chat_view.dart"; import "package:flutter_profile/flutter_profile.dart"; @@ -38,9 +40,8 @@ class _ProfileScreenState extends State { var theme = Theme.of(context); return FutureBuilder( future: hasUser - // ignore: discarded_futures - ? widget.chatService.chatOverviewService.getChatById(widget.chatId) - // ignore: discarded_futures + ? widget.chatService.chatOverviewService + .getChatById(widget.chatId, "") : widget.chatService.chatUserService.getUser(widget.userId!), builder: (context, snapshot) { var data = snapshot.data;