Similar to Rocket.Chat.Go.SDK and implement APIs according to the Rocket Chat document. This SDK could be use in both in server side and in flutter. Not sure that this works or not in the browser.
https://pub.dartlang.org/packages/rocket_chat_dart
pub get
or flutter packages get
To regenerate code run flutter packages pub run build_runner build --delete-conflicting-outputs