Closed jeffmayn closed 1 year ago
There are a few ways that you can make this change. The best way to do it depends on what you want to do.
Ways to make your change:
I am pretty new to Flutter and this repo, but if you want we can do a zoom call to figure it out.
.../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_firebase_chat_core-1.6.3/lib/src/firebase_chat_core.dart The file is here for me
Hi thanks. I did the 2. suggestion and moved the file into my own code. Works fine with this file, however, tried the same for the User-model at ../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_firebase_chat_core-1.6.3/lib/src/user.dart
, it have some generated code referencing part of user.g.dart
, and won't work just copying it in. Do you know how to do this file? Would like to add some fields to this model
I don't see the file mentioned.
I think you are talking about this file, in the flutter_chat_types
package:
../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_chat_types-3.5.0/lib/src/user.dart
You have to move the user.g.dart
file into your project also.
../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_chat_types-3.5.0/lib/src/user.g.dart
Once you have copied the code in you probably also need to change where the User type gets imported from.
Copy-pasting like this is not a good solution for production software. But might be a good choice in some situations.
Yeah, I can see why it would be a mess. Well, last solution for adding fields to the user is just to add them as a map to the metadata
-field. Thanks a lot for your answers:)
Types come from a separate lib https://github.com/flyerhq/flutter_chat_types because I needed this for UI as well. I tried to add metadata
everywhere so arbitrary fields can be added as needed. Regarding original question - this lib is quite small and straightforward, if some clauses are missing in some functions inside the lib itself, fetch code can be written from scratch, using same database name with all needed filters I guess.
Is it possible to edit the
firebase_chat_core.dart
-file? I specifically need to add an extra where-clause to this stream