Skip to content

Commit

Permalink
Merge pull request supabase#209 from supabase-community/chore/publish
Browse files Browse the repository at this point in the history
publish v1.0.0-dev.6
  • Loading branch information
dshukertjr committed Sep 5, 2022
2 parents 3a31f09 + 80f8270 commit f22e60a
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 3 deletions.
74 changes: 74 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,77 @@
## [1.0.0-dev.6]

- BREAKING: update supabase package [v1.0.0-dev.5](https://github.com/supabase-community/supabase-dart/blob/main/CHANGELOG.md#100-dev5)
- deprecated: `.stream()` no longer needs `.execute()`
- BREAKING: `eq` filter on `.stream()` is a separate method now
```dart
// before
Supabase.instance.client.from('my_table:title=eq.Supabase')
.stream(['id'])
.order('created_at')
.limit(10)
.execute()
.listen((payload) {
// do something with payload here
});
// now
Supabase.instance.client.from('my_table')
.stream(['id'])
.eq('title', 'Supabase')
.order('created_at')
.limit(10)
.listen((payload) {
// do something with payload here
});
```
- BREAKING: listening to database changes has a new API
- feat: added support for [broadcast](https://supabase.com/docs/guides/realtime/broadcast) and [presence](https://supabase.com/docs/guides/realtime/presence)
```dart
final channel = Supabase.instance.client.channel('can_be_any_string');
// listen to insert events on public.messages table
channel.on(
RealtimeListenTypes.postgresChanges,
ChannelFilter(
event: 'INSERT',
schema: 'public',
table: 'messages',
), (payload, [ref]) {
print('database insert payload: $payload');
});
// listen to `location` broadcast events
channel.on(
RealtimeListenTypes.broadcast,
ChannelFilter(
event: 'location',
), (payload, [ref]) {
print(payload);
});
// send `location` broadcast events
channel.send(
type: RealtimeListenTypes.broadcast,
event: 'location',
payload: {'lat': 1.3521, 'lng': 103.8198},
);
// listen to presence states
channel.on(RealtimeListenTypes.presence, ChannelFilter(event: 'sync'),
(payload, [ref]) {
print(payload);
print(channel.presenceState());
});
// subscribe to the above changes
channel.subscribe((status) async {
if (status == 'SUBSCRIBED') {
// if subscribed successfully, send presence event
final status = await channel.track({'user_id': myUserId});
}
});
```

## [1.0.0-dev.5]

- chore: add example app in example directory
Expand Down
2 changes: 1 addition & 1 deletion lib/src/version.dart
Original file line number Diff line number Diff line change
@@ -1 +1 @@
const version = '1.0.0-dev.5';
const version = '1.0.0-dev.6';
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: supabase_flutter
description: Flutter integration for Supabase. This package makes it simple for developers to build secure and scalable products.
version: 1.0.0-dev.5
version: 1.0.0-dev.6
homepage: 'https://supabase.io'
repository: 'https://github.com/supabase/supabase-flutter'

Expand All @@ -15,7 +15,7 @@ dependencies:
hive: ^2.2.1
hive_flutter: ^1.1.0
http: ^0.13.4
supabase: 1.0.0-dev.4
supabase: 1.0.0-dev.5
url_launcher: ^6.1.2

dev_dependencies:
Expand Down

0 comments on commit f22e60a

Please sign in to comment.