Several questions regarding v2 implementation (migration, ChatController interface, riverpod compatibility) #748
-
Hello guys, Saddly I couldn't try the dev release of v2 so those questions might come a bit late; but looking at the new lib and the impacts on my project I came up with a few interrogations. Note i did not try to implement my custom builder/ UI etc yet but only tried to rework a bit the current Chatcontroller I built for v1 (happy to share code, it's a bit messy though) 1. MIgration
2. ChatController design 3. Name conflict with riverpod @riverpod
class MyChatController extends _$MyChatController
implements ChatController
@override
Future<void> update(
chatcore.Message oldMessage, chatcore.Message newMessage) {
// TODO: implement update
throw UnimplementedError();
//==> throws "'ChatController.update' ('Future<void> Function(Message, Message)') isn't a valid override of 'AsyncNotifierBase.update' ('Future<void> Function(FutureOr<void> Function(void), {FutureOr<void> Function(Object, StackTrace)? onError})'"
}
... The override of update throw error because Riverpod |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Hello! Thanks for your feedback. I definitely need to test 1. MigrationIt looks like adding The real problem was my original decision to use int for timestamps. It turns out this doesn’t follow typical Flutter patterns, where all dates should be Does Firebase allow middleware to convert data to a different type during processing? When serialising, a 2. ChatController designIs it okay to just throw 3. Name conflict with RiverpodI also haven’t tested the controller with Riverpod (and I don’t have much experience with Riverpod in general), so I wasn’t aware of that issue. Do you think I should rename |
Beta Was this translation helpful? Give feedback.
-
Just for anyone reading this I was mistaken. The abstract methods in the |
Beta Was this translation helpful? Give feedback.
rename is published - hopefully it solves the problem 🤞 https://github.com/flyerhq/flutter_chat_ui/releases/tag/2.1.0