Skip to content

Commit 8e6d243

Browse files
committed
Merge branch 'main' into fix/realtime
2 parents aefd638 + 588b500 commit 8e6d243

File tree

17 files changed

+119
-124
lines changed

17 files changed

+119
-124
lines changed

packages/realtime_client/lib/src/realtime_channel.dart

+11
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,17 @@ class RealtimeChannel {
410410
);
411411
}
412412

413+
/// Sets up a listener for realtime system events for debugging purposes.
414+
RealtimeChannel onSystemEvents(
415+
void Function(dynamic payload) callback,
416+
) {
417+
return onEvents(
418+
'system',
419+
ChannelFilter(),
420+
(payload, [ref]) => callback(payload),
421+
);
422+
}
423+
413424
@internal
414425
RealtimeChannel onEvents(
415426
String type, ChannelFilter filter, BindingCallback callback) {

packages/realtime_client/lib/src/types.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ enum ChannelResponse {
110110
error
111111
}
112112

113-
enum RealtimeListenTypes { postgresChanges, broadcast, presence }
113+
enum RealtimeListenTypes { postgresChanges, broadcast, presence, system }
114114

115115
enum PresenceEvent { sync, join, leave }
116116

packages/supabase_flutter/example/.metadata

+17-17
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
11
# This file tracks properties of this Flutter project.
22
# Used by Flutter tool to assess capabilities and perform upgrades etc.
33
#
4-
# This file should be version controlled.
4+
# This file should be version controlled and should not be manually edited.
55

66
version:
7-
revision: 676cefaaff197f27424942307668886253e1ec35
8-
channel: stable
7+
revision: "5874a72aa4c779a02553007c47dacbefba2374dc"
8+
channel: "stable"
99

1010
project_type: app
1111

1212
# Tracks metadata for the flutter migrate command
1313
migration:
1414
platforms:
1515
- platform: root
16-
create_revision: 676cefaaff197f27424942307668886253e1ec35
17-
base_revision: 676cefaaff197f27424942307668886253e1ec35
16+
create_revision: 5874a72aa4c779a02553007c47dacbefba2374dc
17+
base_revision: 5874a72aa4c779a02553007c47dacbefba2374dc
1818
- platform: android
19-
create_revision: 676cefaaff197f27424942307668886253e1ec35
20-
base_revision: 676cefaaff197f27424942307668886253e1ec35
19+
create_revision: 5874a72aa4c779a02553007c47dacbefba2374dc
20+
base_revision: 5874a72aa4c779a02553007c47dacbefba2374dc
2121
- platform: ios
22-
create_revision: 676cefaaff197f27424942307668886253e1ec35
23-
base_revision: 676cefaaff197f27424942307668886253e1ec35
22+
create_revision: 5874a72aa4c779a02553007c47dacbefba2374dc
23+
base_revision: 5874a72aa4c779a02553007c47dacbefba2374dc
2424
- platform: linux
25-
create_revision: 676cefaaff197f27424942307668886253e1ec35
26-
base_revision: 676cefaaff197f27424942307668886253e1ec35
25+
create_revision: 5874a72aa4c779a02553007c47dacbefba2374dc
26+
base_revision: 5874a72aa4c779a02553007c47dacbefba2374dc
2727
- platform: macos
28-
create_revision: 676cefaaff197f27424942307668886253e1ec35
29-
base_revision: 676cefaaff197f27424942307668886253e1ec35
28+
create_revision: 5874a72aa4c779a02553007c47dacbefba2374dc
29+
base_revision: 5874a72aa4c779a02553007c47dacbefba2374dc
3030
- platform: web
31-
create_revision: 676cefaaff197f27424942307668886253e1ec35
32-
base_revision: 676cefaaff197f27424942307668886253e1ec35
31+
create_revision: 5874a72aa4c779a02553007c47dacbefba2374dc
32+
base_revision: 5874a72aa4c779a02553007c47dacbefba2374dc
3333
- platform: windows
34-
create_revision: 676cefaaff197f27424942307668886253e1ec35
35-
base_revision: 676cefaaff197f27424942307668886253e1ec35
34+
create_revision: 5874a72aa4c779a02553007c47dacbefba2374dc
35+
base_revision: 5874a72aa4c779a02553007c47dacbefba2374dc
3636

3737
# User provided section
3838

packages/supabase_flutter/example/analysis_options.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ linter:
2626
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
2727

2828
analyzer:
29-
exclude:
29+
exclude:
3030
- lib/generated_plugin_registrant.dart
31-
3231
# Additional information about this file can be found at
3332
# https://dart.dev/guides/language/analysis-options

packages/supabase_flutter/example/android/.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ gradle-wrapper.jar
77
GeneratedPluginRegistrant.java
88

99
# Remember to never publicly share your keystore.
10-
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
10+
# See https://flutter.dev/to/reference-keystore
1111
key.properties
1212
**/*.keystore
1313
**/*.jks
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,44 @@
1-
def localProperties = new Properties()
2-
def localPropertiesFile = rootProject.file('local.properties')
3-
if (localPropertiesFile.exists()) {
4-
localPropertiesFile.withReader('UTF-8') { reader ->
5-
localProperties.load(reader)
6-
}
7-
}
8-
9-
def flutterRoot = localProperties.getProperty('flutter.sdk')
10-
if (flutterRoot == null) {
11-
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12-
}
13-
14-
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15-
if (flutterVersionCode == null) {
16-
flutterVersionCode = '1'
17-
}
18-
19-
def flutterVersionName = localProperties.getProperty('flutter.versionName')
20-
if (flutterVersionName == null) {
21-
flutterVersionName = '1.0'
1+
plugins {
2+
id "com.android.application"
3+
id "kotlin-android"
4+
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
5+
id "dev.flutter.flutter-gradle-plugin"
226
}
237

24-
apply plugin: 'com.android.application'
25-
apply plugin: 'kotlin-android'
26-
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27-
288
android {
29-
compileSdkVersion flutter.compileSdkVersion
30-
ndkVersion flutter.ndkVersion
9+
namespace = "com.example.example"
10+
compileSdk = flutter.compileSdkVersion
11+
ndkVersion = flutter.ndkVersion
3112

3213
compileOptions {
33-
sourceCompatibility JavaVersion.VERSION_1_8
34-
targetCompatibility JavaVersion.VERSION_1_8
14+
sourceCompatibility = JavaVersion.VERSION_1_8
15+
targetCompatibility = JavaVersion.VERSION_1_8
3516
}
3617

3718
kotlinOptions {
38-
jvmTarget = '1.8'
39-
}
40-
41-
sourceSets {
42-
main.java.srcDirs += 'src/main/kotlin'
19+
jvmTarget = JavaVersion.VERSION_1_8
4320
}
4421

4522
defaultConfig {
4623
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
47-
applicationId "com.example.example"
24+
applicationId = "com.example.example"
4825
// You can update the following values to match your application needs.
49-
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
50-
minSdkVersion flutter.minSdkVersion
51-
targetSdkVersion flutter.targetSdkVersion
52-
versionCode flutterVersionCode.toInteger()
53-
versionName flutterVersionName
26+
// For more information, see: https://flutter.dev/to/review-gradle-config.
27+
minSdk = flutter.minSdkVersion
28+
targetSdk = flutter.targetSdkVersion
29+
versionCode = flutter.versionCode
30+
versionName = flutter.versionName
5431
}
5532

5633
buildTypes {
5734
release {
5835
// TODO: Add your own signing config for the release build.
5936
// Signing with the debug keys for now, so `flutter run --release` works.
60-
signingConfig signingConfigs.debug
37+
signingConfig = signingConfigs.debug
6138
}
6239
}
6340
}
6441

6542
flutter {
66-
source '../..'
67-
}
68-
69-
dependencies {
70-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
43+
source = "../.."
7144
}

packages/supabase_flutter/example/android/app/src/debug/AndroidManifest.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.example.example">
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
32
<!-- The INTERNET permission is required for development. Specifically,
43
the Flutter tool needs it to communicate with the running application
54
to allow setting breakpoints, to provide hot reload, etc.

packages/supabase_flutter/example/android/app/src/main/AndroidManifest.xml

+14-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.example.example">
3-
<application
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2+
<application
43
android:label="example"
54
android:name="${applicationName}"
65
android:icon="@mipmap/ic_launcher">
76
<activity
87
android:name=".MainActivity"
98
android:exported="true"
109
android:launchMode="singleTop"
10+
android:taskAffinity=""
1111
android:theme="@style/LaunchTheme"
1212
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
1313
android:hardwareAccelerated="true"
@@ -31,4 +31,15 @@
3131
android:name="flutterEmbedding"
3232
android:value="2" />
3333
</application>
34+
<!-- Required to query activities that can process text, see:
35+
https://developer.android.com/training/package-visibility and
36+
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
37+
38+
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
39+
<queries>
40+
<intent>
41+
<action android:name="android.intent.action.PROCESS_TEXT"/>
42+
<data android:mimeType="text/plain"/>
43+
</intent>
44+
</queries>
3445
</manifest>

packages/supabase_flutter/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ package com.example.example
22

33
import io.flutter.embedding.android.FlutterActivity
44

5-
class MainActivity: FlutterActivity() {
6-
}
5+
class MainActivity: FlutterActivity()

packages/supabase_flutter/example/android/app/src/profile/AndroidManifest.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.example.example">
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
32
<!-- The INTERNET permission is required for development. Specifically,
43
the Flutter tool needs it to communicate with the running application
54
to allow setting breakpoints, to provide hot reload, etc.
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,18 @@
1-
buildscript {
2-
ext.kotlin_version = '1.6.10'
3-
repositories {
4-
google()
5-
mavenCentral()
6-
}
7-
8-
dependencies {
9-
classpath 'com.android.tools.build:gradle:7.1.2'
10-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11-
}
12-
}
13-
141
allprojects {
152
repositories {
163
google()
174
mavenCentral()
185
}
196
}
207

21-
rootProject.buildDir = '../build'
8+
rootProject.buildDir = "../build"
229
subprojects {
2310
project.buildDir = "${rootProject.buildDir}/${project.name}"
2411
}
2512
subprojects {
26-
project.evaluationDependsOn(':app')
13+
project.evaluationDependsOn(":app")
2714
}
2815

29-
task clean(type: Delete) {
16+
tasks.register("clean", Delete) {
3017
delete rootProject.buildDir
3118
}
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
org.gradle.jvmargs=-Xmx1536M
1+
org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError
22
android.useAndroidX=true
33
android.enableJetifier=true
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Fri Jun 23 08:50:38 CEST 2017
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
43
zipStoreBase=GRADLE_USER_HOME
54
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
1-
include ':app'
1+
pluginManagement {
2+
def flutterSdkPath = {
3+
def properties = new Properties()
4+
file("local.properties").withInputStream { properties.load(it) }
5+
def flutterSdkPath = properties.getProperty("flutter.sdk")
6+
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
7+
return flutterSdkPath
8+
}()
29

3-
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4-
def properties = new Properties()
10+
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
511

6-
assert localPropertiesFile.exists()
7-
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
12+
repositories {
13+
google()
14+
mavenCentral()
15+
gradlePluginPortal()
16+
}
17+
}
818

9-
def flutterSdkPath = properties.getProperty("flutter.sdk")
10-
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11-
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
19+
plugins {
20+
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
21+
id "com.android.application" version "7.3.0" apply false
22+
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
23+
}
24+
25+
include ":app"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import Flutter
2+
import UIKit
3+
import XCTest
4+
5+
class RunnerTests: XCTestCase {
6+
7+
func testExample() {
8+
// If you add code to the Runner application, consider adding tests here.
9+
// See https://developer.apple.com/documentation/xctest for more information about using XCTest.
10+
}
11+
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import Cocoa
2+
import FlutterMacOS
3+
import XCTest
4+
5+
class RunnerTests: XCTestCase {
6+
7+
func testExample() {
8+
// If you add code to the Runner application, consider adding tests here.
9+
// See https://developer.apple.com/documentation/xctest for more information about using XCTest.
10+
}
11+
12+
}

packages/supabase_flutter/example/web/index.html

+1-21
Original file line numberDiff line numberDiff line change
@@ -31,28 +31,8 @@
3131

3232
<title>example</title>
3333
<link rel="manifest" href="manifest.json">
34-
35-
<script>
36-
// The value below is injected by flutter build, do not touch.
37-
var serviceWorkerVersion = null;
38-
</script>
39-
<!-- This script adds the flutter initialization JS code -->
40-
<script src="flutter.js" defer></script>
4134
</head>
4235
<body>
43-
<script>
44-
window.addEventListener('load', function(ev) {
45-
// Download main.dart.js
46-
_flutter.loader.loadEntrypoint({
47-
serviceWorker: {
48-
serviceWorkerVersion: serviceWorkerVersion,
49-
}
50-
}).then(function(engineInitializer) {
51-
return engineInitializer.initializeEngine();
52-
}).then(function(appRunner) {
53-
return appRunner.runApp();
54-
});
55-
});
56-
</script>
36+
<script src="flutter_bootstrap.js" async></script>
5737
</body>
5838
</html>

0 commit comments

Comments
 (0)