Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/supabase/realtime-dart
A dart client for Supabase Realtime server.
https://github.com/supabase/realtime-dart
dart
Last synced: about 1 month ago
JSON representation
A dart client for Supabase Realtime server.
- Host: GitHub
- URL: https://github.com/supabase/realtime-dart
- Owner: supabase
- License: mit
- Archived: true
- Created: 2020-10-16T08:47:40.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-05-13T01:27:33.000Z (over 1 year ago)
- Last Synced: 2024-05-01T16:25:41.038Z (6 months ago)
- Topics: dart
- Language: Dart
- Homepage: https://supabase.com/docs/guides/realtime
- Size: 215 KB
- Stars: 85
- Watchers: 9
- Forks: 15
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# `realtime-dart`
> **Warning**
> This repository has been moved to the [supabase-flutter repo](https://github.com/supabase/supabase-flutter/tree/main/packages/realtime_client).Listens to changes in a PostgreSQL Database and via websockets.
A dart client for Supabase [Realtime](https://github.com/supabase/realtime) server.
## Usage
### Creating a Socket connection
You can set up one connection to be used across the whole app.
```dart
import 'package:realtime_client/realtime_client.dart';var client = RealtimeClient(REALTIME_URL);
client.connect();
```**Socket Hooks**
```dart
client.onOpen(() => print('Socket opened.'));
client.onClose((event) => print('Socket closed $event'));
client.onError((error) => print('Socket error: $error'));
```**Disconnect the socket**
Call `disconnect()` on the socket:
```dart
client.disconnect()
```## Credits
- https://github.com/supabase/realtime-js - ported from realtime-js library
## License
This repo is licensed under MIT.