submitMessage function
Implementation
Future<void> submitMessage(
{required String channelId, required String text}) async =>
await FirebaseFirestore.instance
.collection("channels/${channelId}/messages")
.add({
"message": text,
"date": DateTime.now().millisecondsSinceEpoch,
"author": locate<AuthenticationState>().username,
"profilePhoto": locate<AuthenticationState>().photoUrl,
"uid": locate<AuthenticationState>().userId
});