The hive database now implements the whole API except for storing files which should be better done by the flutter_cache_manager package inside of the flutter app. All tests already run with Hive now but the Moor database is still tested too. We needed to change some wait jobs in the tests because the Hive database is not 100% in memory for the tests like Moor. For now both database implementations are equal and the developer can pick which one to use but we plan to get rid of Moor in the future. |
||
|---|---|---|
| .gitlab | ||
| docs | ||
| example | ||
| home | ||
| lib | ||
| olm@efd17631b1 | ||
| scripts | ||
| test | ||
| test_driver | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| .metadata | ||
| CHANGELOG.md | ||
| CONTRIBUTING.md | ||
| LICENSE | ||
| README.md | ||
| analysis_options.yaml | ||
| build.yaml | ||
| pubspec.yaml | ||
README.md
Famedly Matrix SDK
Matrix SDK for the famedly talk app written in dart.
Native libraries
For E2EE, libolm must be provided.
Additionally, OpenSSL (libcrypto) must be provided on native platforms for E2EE.
For flutter apps you can easily import it with the flutter_olm and the flutter_openssl_crypto packages.
API
The API is documented here: famedly.gitlab.io/famedlysdk/
How to use this
- Import the sdk
famedlysdk:
git:
url: https://gitlab.com/famedly/famedlysdk.git
import 'package:famedlysdk/famedlysdk.dart';
- Create a new client:
final client = Client("HappyChat");
The SDK works better with a Moor database. Otherwise it has no persistence. Take a look here for an example store.
- Connect to a Matrix Homeserver and listen to the streams:
client.onLoginStateChanged.stream.listen((bool loginState){
print("LoginState: ${loginState.toString()}");
});
client.onEvent.stream.listen((EventUpdate eventUpdate){
print("New event update!");
});
client.onRoomUpdate.stream.listen((RoomUpdate eventUpdate){
print("New room update!");
});
try {
await client.checkHomeserver("https://yourhomeserver.abc");
await client.login("username", "password");
}
catch(e) {
print('No luck...');
}
- Send a message to a Room:
await client.getRoomById('your_room_id').sendTextEvent('Hello world');