mirror of
https://github.com/Iconica-Development/flutter_chat.git
synced 2025-05-19 10:53:51 +02:00
feat: testing breaking API changes with melos
This commit is contained in:
parent
15f15748b6
commit
0a0e14d5f0
6 changed files with 15 additions and 12 deletions
|
@ -241,7 +241,7 @@ class FirebaseChatOverviewService implements ChatOverviewService {
|
|||
///
|
||||
/// [chatId]: The ID of the chat.
|
||||
@override
|
||||
Future<ChatModel> getChatById(String chatId) async {
|
||||
Future<ChatModel> getChatById(String chatId, String iamBreakingStuff) async {
|
||||
var currentUser = await _userService.getCurrentUser();
|
||||
var chatCollection = await _db
|
||||
.collection(_options.usersCollectionName)
|
||||
|
|
|
@ -9,7 +9,7 @@ abstract class ChatOverviewService {
|
|||
Future<ChatModel> getChatByUser(ChatUserModel user);
|
||||
|
||||
/// Retrieves a chat based on the ID.
|
||||
Future<ChatModel> getChatById(String id);
|
||||
Future<ChatModel> getChatById(String id, String iamBreakingStuff);
|
||||
|
||||
/// Deletes the chat for this user and the other users in the chat.
|
||||
Future<void> deleteChat(ChatModel chat);
|
||||
|
|
|
@ -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!);
|
||||
|
|
|
@ -36,7 +36,7 @@ class LocalChatOverviewService
|
|||
}
|
||||
|
||||
@override
|
||||
Future<ChatModel> getChatById(String id) {
|
||||
Future<ChatModel> 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}");
|
||||
|
|
|
@ -80,8 +80,8 @@ class _ChatDetailScreenState extends State<ChatDetailScreen> {
|
|||
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<ChatDetailScreen> {
|
|||
|
||||
return FutureBuilder<ChatModel>(
|
||||
// ignore: discarded_futures
|
||||
future: widget.service.chatOverviewService.getChatById(widget.chatId),
|
||||
future: widget.service.chatOverviewService.getChatById(widget.chatId, ""),
|
||||
builder: (context, AsyncSnapshot<ChatModel> snapshot) {
|
||||
var chatModel = snapshot.data;
|
||||
var chatTitle = (chatModel is GroupChatModel)
|
||||
|
|
|
@ -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<ChatProfileScreen> {
|
|||
var theme = Theme.of(context);
|
||||
return FutureBuilder<dynamic>(
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue