├── .gitignore ├── .idea ├── libraries │ └── Dart_SDK.xml ├── modules.xml ├── runConfigurations │ └── example_lib_main_dart.xml └── workspace.xml ├── .metadata ├── .vscode └── launch.json ├── CHANGELOG.md ├── LICENSE ├── README.md ├── analysis_options.yaml ├── android ├── .gitignore ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── libraries │ ├── signalr-client-sdk-android.jar │ └── signalr-client-sdk.jar ├── settings.gradle └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── dev │ │ └── asdevs │ │ └── signalr_flutter │ │ └── SignalrApi.java │ └── kotlin │ └── dev │ └── asdevs │ └── signalr_flutter │ └── SignalRFlutterPlugin.kt ├── example ├── .gitignore ├── .metadata ├── README.md ├── analysis_options.yaml ├── android │ ├── .gitignore │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── kotlin │ │ │ │ └── dev │ │ │ │ │ └── asdevs │ │ │ │ │ └── signalr_flutter_example │ │ │ │ │ └── MainActivity.kt │ │ │ └── res │ │ │ │ ├── drawable-v21 │ │ │ │ └── launch_background.xml │ │ │ │ ├── drawable │ │ │ │ └── launch_background.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── values-night │ │ │ │ └── styles.xml │ │ │ │ └── values │ │ │ │ └── styles.xml │ │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ └── settings.gradle ├── ios │ ├── .gitignore │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Podfile │ ├── Podfile.lock │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ │ └── WorkspaceSettings.xcsettings │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── Runner │ │ ├── AppDelegate.swift │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── Runner-Bridging-Header.h ├── lib │ └── main.dart ├── pubspec.lock ├── pubspec.yaml └── test │ └── widget_test.dart ├── ios ├── .gitignore ├── Assets │ ├── .gitkeep │ ├── SwiftR.js │ ├── jquery-2.1.3.min.js │ ├── jquery.signalr-2.4.2.min.js │ └── jquery.signalr-2.4.3.min.js ├── Classes │ ├── SignalrApi.h │ ├── SignalrApi.m │ ├── SignalrFlutterPlugin.h │ ├── SignalrFlutterPlugin.m │ ├── SwiftR.swift │ ├── SwiftSignalrFlutterPlugin.swift │ └── signalr_flutter.h └── signalr_flutter.podspec ├── lib ├── signalr_api.dart ├── signalr_flutter.dart └── signalr_platform_interface.dart ├── pigeons └── signalr_api.dart ├── pubspec.lock ├── pubspec.yaml ├── run_pigeon.sh ├── signalr_flutter.iml └── test └── signalr_flutter_test.dart /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | 7 | build/ 8 | -------------------------------------------------------------------------------- /.idea/libraries/Dart_SDK.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/runConfigurations/example_lib_main_dart.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 18116933e77adc82f80866c928266a5b4f1ed645 8 | channel: stable 9 | 10 | project_type: plugin 11 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "signalr_flutter", 9 | "request": "launch", 10 | "type": "dart" 11 | }, 12 | { 13 | "name": "signalr_flutter (profile mode)", 14 | "request": "launch", 15 | "type": "dart", 16 | "flutterMode": "profile" 17 | }, 18 | { 19 | "name": "signalr_flutter (release mode)", 20 | "request": "launch", 21 | "type": "dart", 22 | "flutterMode": "release" 23 | }, 24 | { 25 | "name": "example", 26 | "cwd": "example", 27 | "request": "launch", 28 | "type": "dart" 29 | }, 30 | { 31 | "name": "example (profile mode)", 32 | "cwd": "example", 33 | "request": "launch", 34 | "type": "dart", 35 | "flutterMode": "profile" 36 | }, 37 | { 38 | "name": "example (release mode)", 39 | "cwd": "example", 40 | "request": "launch", 41 | "type": "dart", 42 | "flutterMode": "release" 43 | } 44 | ] 45 | } -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.0.1 2 | 3 | * Initial release. 4 | 5 | ## 0.0.2 6 | 7 | * Minor Updates. 8 | 9 | ## 0.0.3 10 | 11 | * Connection Headers and Transport customization added 12 | * Minor changes and a bug fix for invokeServerMethod 13 | 14 | ## 0.0.4 15 | 16 | * Minor Updates. 17 | 18 | ## 0.0.5 19 | 20 | * Fixed a bug where invokeMethod only accepting string as return value 21 | 22 | ## 0.0.6-dev.1 23 | 24 | * Possible fix for callbacks throwing exception about type mismatch. 25 | * invokeMethod now has generic return type & upto 10 arguments support. 26 | 27 | ## 0.0.6-dev.2 28 | 29 | * HubCallBack function now returns the value as well as the subscribed method name. 30 | * invokeMethod now can take as many arguments as you want. 31 | 32 | ## 0.0.6-dev.3 33 | 34 | * Possible fix for ios Hub events not returning 35 | 36 | ## 0.1.0-dev.1 37 | 38 | * Fix for ios Hub events not returning 39 | 40 | ## 0.1.0-dev.2 41 | 42 | * Fixed Duplicated Hub events for ios. 43 | 44 | ## 0.1.0 45 | 46 | * Fix a issue where hub callback only accepting strings. 47 | * Hub callback now returns the message as well as the subscribed method name. 48 | * Made invokeMethod generic. 49 | * As many arguments as you want in invokeMethod. 50 | * fix for ios Hub events not working. 51 | 52 | ## 0.1.1 53 | 54 | * Null Safety Support 55 | 56 | ## 0.1.2 57 | 58 | * IsConnected Method Added 59 | 60 | ## 0.2.0-dev.1 61 | 62 | * Rewrote the plugin using pigeon 63 | * **Breaking Changes**: 64 | * `invokeMethod` now take only strings as arguments instead of dynamic. 65 | * `invokeMethod` now returns only string as result. 66 | * `hubCallback` now also returns string as message instead of dynamic. 67 | 68 | ## 0.2.0-dev.2 69 | 70 | * Fix for invokeMethod calls having no return value. 71 | 72 | ## 0.2.0-dev.3 73 | 74 | * Updated signalr for iOS. 75 | * Transport fallback properly added for iOS. 76 | 77 | ## 0.2.0-dev.4 78 | 79 | * App bundle build issue fix. 80 | 81 | ## 0.2.0-dev.5 82 | 83 | * Removed unnecessary platform exceptions. 84 | * Updated dependencies. 85 | 86 | ## 0.2.0 87 | 88 | * Rewrote the plugin using pigeon. 89 | * Removed unnecessary platform exceptions. 90 | * Updated signalr for iOS. 91 | * Updated all dependencies to the latest. 92 | * **Breaking Changes**: 93 | * `invokeMethod` now take only strings as arguments instead of dynamic. 94 | * `invokeMethod` now returns only string as result. 95 | * `hubCallback` now also returns string as message instead of dynamic. 96 | 97 | 98 | ## unreleased 99 | 100 | - [#64] upgraded GPA (Android Gradle Plugin) to version 8 to comply to deprication of the old flutter gradle implementation. 101 | (link)[https://docs.flutter.dev/release/breaking-changes/flutter-gradle-plugin-apply] 102 | 103 | - [#64] Plugin now requires the following: 104 | - Flutter >=3.19.0 105 | - Dart >=3.3.0 106 | - compileSDK 33 for Android part 107 | - Java 17 for Android part 108 | - Gradle 8.0 for Android part 109 | 110 | 111 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Ayon Das 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # signalr_flutter 2 | 3 | A flutter plugin for .net SignalR client. 4 | 5 | ## Usage 6 | 7 | First of all, Initialize SignalR and connect to your server. 8 | 9 | ```dart 10 | SignalR signalR = SignalR( 11 | '', 12 | "", 13 | hubMethods: [""] 14 | statusChangeCallback: (status) => print(status), 15 | hubCallback: (methodName, message) => print('MethodName = $methodName, Message = $message')); 16 | signalR.connect(); 17 | ``` 18 | 19 | Here `statusChangeCallback` will get called whenever connection status with server changes. 20 | 21 | `hubCallback` will receive calls from the server if you subscribe to any hub method. You can do that with `hubMethods`. 22 | 23 | `hubMethods` are the hub method names you want to subscribe. 24 | 25 | There is a `headers` parameters also which takes a `Map`. 26 | 27 | You can also invoke any server method. 28 | 29 | ```dart 30 | signalR.invokeMethod("", arguments: ["argument1", "argument2"]); 31 | ``` 32 | 33 | 34 | If you are trying to connect with a HTTP url, then you need to add the following lines to the manifest of your android project. 35 | 36 | ```xml 37 | 39 | 40 | ``` 41 | 42 | This is because of the [Network Security Config](https://developer.android.com/training/articles/security-config#CleartextTrafficPermitted). 43 | 44 | R8 may strip away some SignalR classes for the Android in Release Builds. Add the following line in your `proguard-rules.pro` file to solve this issue. 45 | 46 | `-keep class microsoft.aspnet.signalr.client.hubs.** { *; }` 47 | 48 | 49 | For more info check example. 50 | 51 | Any issue or PR is always welcome. 52 | 53 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | # Additional information about this file can be found at 4 | # https://dart.dev/guides/language/analysis-options 5 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id "com.android.library" 3 | id "kotlin-android" 4 | } 5 | 6 | group 'dev.asdevs.signalr_flutter' 7 | version '1.0-SNAPSHOT' 8 | 9 | rootProject.allprojects { 10 | repositories { 11 | google() 12 | mavenCentral() 13 | } 14 | } 15 | 16 | android { 17 | namespace 'dev.asdevs.signalr_flutter' 18 | compileOptions { 19 | sourceCompatibility JavaVersion.VERSION_17 20 | targetCompatibility JavaVersion.VERSION_17 21 | } 22 | 23 | kotlinOptions { 24 | jvmTarget = '17' 25 | } 26 | 27 | sourceSets { 28 | main.java.srcDirs += 'src/main/kotlin' 29 | } 30 | 31 | defaultConfig { 32 | compileSdk 33 33 | minSdkVersion 21 34 | } 35 | } 36 | 37 | dependencies { 38 | implementation 'com.google.code.gson:gson:2.8.9' 39 | implementation files('libraries/signalr-client-sdk.jar') 40 | implementation files('libraries/signalr-client-sdk-android.jar') 41 | } 42 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip 6 | -------------------------------------------------------------------------------- /android/libraries/signalr-client-sdk-android.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AS-Devs/signalr_flutter/8bd721a9c572120d3a71bc12edf7baaec88bfb5b/android/libraries/signalr-client-sdk-android.jar -------------------------------------------------------------------------------- /android/libraries/signalr-client-sdk.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AS-Devs/signalr_flutter/8bd721a9c572120d3a71bc12edf7baaec88bfb5b/android/libraries/signalr-client-sdk.jar -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | 3 | repositories { 4 | google() 5 | mavenCentral() 6 | gradlePluginPortal() 7 | } 8 | } 9 | 10 | plugins { 11 | id "com.android.library" version "8.1.0" apply false 12 | id "org.jetbrains.kotlin.android" version "1.8.22" apply false 13 | } 14 | 15 | rootProject.name = 'signalr_flutter' 16 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /android/src/main/java/dev/asdevs/signalr_flutter/SignalrApi.java: -------------------------------------------------------------------------------- 1 | // Autogenerated from Pigeon (v4.2.5), do not edit directly. 2 | // See also: https://pub.dev/packages/pigeon 3 | 4 | package dev.asdevs.signalr_flutter; 5 | 6 | import android.util.Log; 7 | import androidx.annotation.NonNull; 8 | import androidx.annotation.Nullable; 9 | import io.flutter.plugin.common.BasicMessageChannel; 10 | import io.flutter.plugin.common.BinaryMessenger; 11 | import io.flutter.plugin.common.MessageCodec; 12 | import io.flutter.plugin.common.StandardMessageCodec; 13 | import java.io.ByteArrayOutputStream; 14 | import java.nio.ByteBuffer; 15 | import java.util.Arrays; 16 | import java.util.ArrayList; 17 | import java.util.Collections; 18 | import java.util.List; 19 | import java.util.Map; 20 | import java.util.HashMap; 21 | 22 | /**Generated class from Pigeon. */ 23 | @SuppressWarnings({"unused", "unchecked", "CodeBlock2Expr", "RedundantSuppression"}) 24 | public class SignalrApi { 25 | 26 | /** Transport method of the signalr connection. */ 27 | public enum Transport { 28 | AUTO(0), 29 | SERVER_SENT_EVENTS(1), 30 | LONG_POLLING(2); 31 | 32 | private int index; 33 | private Transport(final int index) { 34 | this.index = index; 35 | } 36 | } 37 | 38 | /** SignalR connection status */ 39 | public enum ConnectionStatus { 40 | CONNECTING(0), 41 | CONNECTED(1), 42 | RECONNECTING(2), 43 | DISCONNECTED(3), 44 | CONNECTION_SLOW(4), 45 | CONNECTION_ERROR(5); 46 | 47 | private int index; 48 | private ConnectionStatus(final int index) { 49 | this.index = index; 50 | } 51 | } 52 | 53 | /** Generated class from Pigeon that represents data sent in messages. */ 54 | public static class ConnectionOptions { 55 | private @Nullable String baseUrl; 56 | public @Nullable String getBaseUrl() { return baseUrl; } 57 | public void setBaseUrl(@Nullable String setterArg) { 58 | this.baseUrl = setterArg; 59 | } 60 | 61 | private @Nullable String hubName; 62 | public @Nullable String getHubName() { return hubName; } 63 | public void setHubName(@Nullable String setterArg) { 64 | this.hubName = setterArg; 65 | } 66 | 67 | private @Nullable String queryString; 68 | public @Nullable String getQueryString() { return queryString; } 69 | public void setQueryString(@Nullable String setterArg) { 70 | this.queryString = setterArg; 71 | } 72 | 73 | private @Nullable List hubMethods; 74 | public @Nullable List getHubMethods() { return hubMethods; } 75 | public void setHubMethods(@Nullable List setterArg) { 76 | this.hubMethods = setterArg; 77 | } 78 | 79 | private @Nullable Map headers; 80 | public @Nullable Map getHeaders() { return headers; } 81 | public void setHeaders(@Nullable Map setterArg) { 82 | this.headers = setterArg; 83 | } 84 | 85 | private @Nullable Transport transport; 86 | public @Nullable Transport getTransport() { return transport; } 87 | public void setTransport(@Nullable Transport setterArg) { 88 | this.transport = setterArg; 89 | } 90 | 91 | public static final class Builder { 92 | private @Nullable String baseUrl; 93 | public @NonNull Builder setBaseUrl(@Nullable String setterArg) { 94 | this.baseUrl = setterArg; 95 | return this; 96 | } 97 | private @Nullable String hubName; 98 | public @NonNull Builder setHubName(@Nullable String setterArg) { 99 | this.hubName = setterArg; 100 | return this; 101 | } 102 | private @Nullable String queryString; 103 | public @NonNull Builder setQueryString(@Nullable String setterArg) { 104 | this.queryString = setterArg; 105 | return this; 106 | } 107 | private @Nullable List hubMethods; 108 | public @NonNull Builder setHubMethods(@Nullable List setterArg) { 109 | this.hubMethods = setterArg; 110 | return this; 111 | } 112 | private @Nullable Map headers; 113 | public @NonNull Builder setHeaders(@Nullable Map setterArg) { 114 | this.headers = setterArg; 115 | return this; 116 | } 117 | private @Nullable Transport transport; 118 | public @NonNull Builder setTransport(@Nullable Transport setterArg) { 119 | this.transport = setterArg; 120 | return this; 121 | } 122 | public @NonNull ConnectionOptions build() { 123 | ConnectionOptions pigeonReturn = new ConnectionOptions(); 124 | pigeonReturn.setBaseUrl(baseUrl); 125 | pigeonReturn.setHubName(hubName); 126 | pigeonReturn.setQueryString(queryString); 127 | pigeonReturn.setHubMethods(hubMethods); 128 | pigeonReturn.setHeaders(headers); 129 | pigeonReturn.setTransport(transport); 130 | return pigeonReturn; 131 | } 132 | } 133 | @NonNull Map toMap() { 134 | Map toMapResult = new HashMap<>(); 135 | toMapResult.put("baseUrl", baseUrl); 136 | toMapResult.put("hubName", hubName); 137 | toMapResult.put("queryString", queryString); 138 | toMapResult.put("hubMethods", hubMethods); 139 | toMapResult.put("headers", headers); 140 | toMapResult.put("transport", transport == null ? null : transport.index); 141 | return toMapResult; 142 | } 143 | static @NonNull ConnectionOptions fromMap(@NonNull Map map) { 144 | ConnectionOptions pigeonResult = new ConnectionOptions(); 145 | Object baseUrl = map.get("baseUrl"); 146 | pigeonResult.setBaseUrl((String)baseUrl); 147 | Object hubName = map.get("hubName"); 148 | pigeonResult.setHubName((String)hubName); 149 | Object queryString = map.get("queryString"); 150 | pigeonResult.setQueryString((String)queryString); 151 | Object hubMethods = map.get("hubMethods"); 152 | pigeonResult.setHubMethods((List)hubMethods); 153 | Object headers = map.get("headers"); 154 | pigeonResult.setHeaders((Map)headers); 155 | Object transport = map.get("transport"); 156 | pigeonResult.setTransport(transport == null ? null : Transport.values()[(int)transport]); 157 | return pigeonResult; 158 | } 159 | } 160 | 161 | /** Generated class from Pigeon that represents data sent in messages. */ 162 | public static class StatusChangeResult { 163 | private @Nullable String connectionId; 164 | public @Nullable String getConnectionId() { return connectionId; } 165 | public void setConnectionId(@Nullable String setterArg) { 166 | this.connectionId = setterArg; 167 | } 168 | 169 | private @Nullable ConnectionStatus status; 170 | public @Nullable ConnectionStatus getStatus() { return status; } 171 | public void setStatus(@Nullable ConnectionStatus setterArg) { 172 | this.status = setterArg; 173 | } 174 | 175 | private @Nullable String errorMessage; 176 | public @Nullable String getErrorMessage() { return errorMessage; } 177 | public void setErrorMessage(@Nullable String setterArg) { 178 | this.errorMessage = setterArg; 179 | } 180 | 181 | public static final class Builder { 182 | private @Nullable String connectionId; 183 | public @NonNull Builder setConnectionId(@Nullable String setterArg) { 184 | this.connectionId = setterArg; 185 | return this; 186 | } 187 | private @Nullable ConnectionStatus status; 188 | public @NonNull Builder setStatus(@Nullable ConnectionStatus setterArg) { 189 | this.status = setterArg; 190 | return this; 191 | } 192 | private @Nullable String errorMessage; 193 | public @NonNull Builder setErrorMessage(@Nullable String setterArg) { 194 | this.errorMessage = setterArg; 195 | return this; 196 | } 197 | public @NonNull StatusChangeResult build() { 198 | StatusChangeResult pigeonReturn = new StatusChangeResult(); 199 | pigeonReturn.setConnectionId(connectionId); 200 | pigeonReturn.setStatus(status); 201 | pigeonReturn.setErrorMessage(errorMessage); 202 | return pigeonReturn; 203 | } 204 | } 205 | @NonNull Map toMap() { 206 | Map toMapResult = new HashMap<>(); 207 | toMapResult.put("connectionId", connectionId); 208 | toMapResult.put("status", status == null ? null : status.index); 209 | toMapResult.put("errorMessage", errorMessage); 210 | return toMapResult; 211 | } 212 | static @NonNull StatusChangeResult fromMap(@NonNull Map map) { 213 | StatusChangeResult pigeonResult = new StatusChangeResult(); 214 | Object connectionId = map.get("connectionId"); 215 | pigeonResult.setConnectionId((String)connectionId); 216 | Object status = map.get("status"); 217 | pigeonResult.setStatus(status == null ? null : ConnectionStatus.values()[(int)status]); 218 | Object errorMessage = map.get("errorMessage"); 219 | pigeonResult.setErrorMessage((String)errorMessage); 220 | return pigeonResult; 221 | } 222 | } 223 | 224 | public interface Result { 225 | void success(T result); 226 | void error(Throwable error); 227 | } 228 | private static class SignalRHostApiCodec extends StandardMessageCodec { 229 | public static final SignalRHostApiCodec INSTANCE = new SignalRHostApiCodec(); 230 | private SignalRHostApiCodec() {} 231 | @Override 232 | protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { 233 | switch (type) { 234 | case (byte)128: 235 | return ConnectionOptions.fromMap((Map) readValue(buffer)); 236 | 237 | default: 238 | return super.readValueOfType(type, buffer); 239 | 240 | } 241 | } 242 | @Override 243 | protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { 244 | if (value instanceof ConnectionOptions) { 245 | stream.write(128); 246 | writeValue(stream, ((ConnectionOptions) value).toMap()); 247 | } else 248 | { 249 | super.writeValue(stream, value); 250 | } 251 | } 252 | } 253 | 254 | /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ 255 | public interface SignalRHostApi { 256 | void connect(@NonNull ConnectionOptions connectionOptions, Result result); 257 | void reconnect(Result result); 258 | void stop(Result result); 259 | void isConnected(Result result); 260 | void invokeMethod(@NonNull String methodName, @NonNull List arguments, Result result); 261 | 262 | /** The codec used by SignalRHostApi. */ 263 | static MessageCodec getCodec() { 264 | return SignalRHostApiCodec.INSTANCE; } 265 | /**Sets up an instance of `SignalRHostApi` to handle messages through the `binaryMessenger`. */ 266 | static void setup(BinaryMessenger binaryMessenger, SignalRHostApi api) { 267 | { 268 | BasicMessageChannel channel = 269 | new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.SignalRHostApi.connect", getCodec()); 270 | if (api != null) { 271 | channel.setMessageHandler((message, reply) -> { 272 | Map wrapped = new HashMap<>(); 273 | try { 274 | ArrayList args = (ArrayList)message; 275 | assert args != null; 276 | ConnectionOptions connectionOptionsArg = (ConnectionOptions)args.get(0); 277 | if (connectionOptionsArg == null) { 278 | throw new NullPointerException("connectionOptionsArg unexpectedly null."); 279 | } 280 | Result resultCallback = new Result() { 281 | public void success(String result) { 282 | wrapped.put("result", result); 283 | reply.reply(wrapped); 284 | } 285 | public void error(Throwable error) { 286 | wrapped.put("error", wrapError(error)); 287 | reply.reply(wrapped); 288 | } 289 | }; 290 | 291 | api.connect(connectionOptionsArg, resultCallback); 292 | } 293 | catch (Error | RuntimeException exception) { 294 | wrapped.put("error", wrapError(exception)); 295 | reply.reply(wrapped); 296 | } 297 | }); 298 | } else { 299 | channel.setMessageHandler(null); 300 | } 301 | } 302 | { 303 | BasicMessageChannel channel = 304 | new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.SignalRHostApi.reconnect", getCodec()); 305 | if (api != null) { 306 | channel.setMessageHandler((message, reply) -> { 307 | Map wrapped = new HashMap<>(); 308 | try { 309 | Result resultCallback = new Result() { 310 | public void success(String result) { 311 | wrapped.put("result", result); 312 | reply.reply(wrapped); 313 | } 314 | public void error(Throwable error) { 315 | wrapped.put("error", wrapError(error)); 316 | reply.reply(wrapped); 317 | } 318 | }; 319 | 320 | api.reconnect(resultCallback); 321 | } 322 | catch (Error | RuntimeException exception) { 323 | wrapped.put("error", wrapError(exception)); 324 | reply.reply(wrapped); 325 | } 326 | }); 327 | } else { 328 | channel.setMessageHandler(null); 329 | } 330 | } 331 | { 332 | BasicMessageChannel channel = 333 | new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.SignalRHostApi.stop", getCodec()); 334 | if (api != null) { 335 | channel.setMessageHandler((message, reply) -> { 336 | Map wrapped = new HashMap<>(); 337 | try { 338 | Result resultCallback = new Result() { 339 | public void success(Void result) { 340 | wrapped.put("result", null); 341 | reply.reply(wrapped); 342 | } 343 | public void error(Throwable error) { 344 | wrapped.put("error", wrapError(error)); 345 | reply.reply(wrapped); 346 | } 347 | }; 348 | 349 | api.stop(resultCallback); 350 | } 351 | catch (Error | RuntimeException exception) { 352 | wrapped.put("error", wrapError(exception)); 353 | reply.reply(wrapped); 354 | } 355 | }); 356 | } else { 357 | channel.setMessageHandler(null); 358 | } 359 | } 360 | { 361 | BasicMessageChannel channel = 362 | new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.SignalRHostApi.isConnected", getCodec()); 363 | if (api != null) { 364 | channel.setMessageHandler((message, reply) -> { 365 | Map wrapped = new HashMap<>(); 366 | try { 367 | Result resultCallback = new Result() { 368 | public void success(Boolean result) { 369 | wrapped.put("result", result); 370 | reply.reply(wrapped); 371 | } 372 | public void error(Throwable error) { 373 | wrapped.put("error", wrapError(error)); 374 | reply.reply(wrapped); 375 | } 376 | }; 377 | 378 | api.isConnected(resultCallback); 379 | } 380 | catch (Error | RuntimeException exception) { 381 | wrapped.put("error", wrapError(exception)); 382 | reply.reply(wrapped); 383 | } 384 | }); 385 | } else { 386 | channel.setMessageHandler(null); 387 | } 388 | } 389 | { 390 | BasicMessageChannel channel = 391 | new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.SignalRHostApi.invokeMethod", getCodec()); 392 | if (api != null) { 393 | channel.setMessageHandler((message, reply) -> { 394 | Map wrapped = new HashMap<>(); 395 | try { 396 | ArrayList args = (ArrayList)message; 397 | assert args != null; 398 | String methodNameArg = (String)args.get(0); 399 | if (methodNameArg == null) { 400 | throw new NullPointerException("methodNameArg unexpectedly null."); 401 | } 402 | List argumentsArg = (List)args.get(1); 403 | if (argumentsArg == null) { 404 | throw new NullPointerException("argumentsArg unexpectedly null."); 405 | } 406 | Result resultCallback = new Result() { 407 | public void success(String result) { 408 | wrapped.put("result", result); 409 | reply.reply(wrapped); 410 | } 411 | public void error(Throwable error) { 412 | wrapped.put("error", wrapError(error)); 413 | reply.reply(wrapped); 414 | } 415 | }; 416 | 417 | api.invokeMethod(methodNameArg, argumentsArg, resultCallback); 418 | } 419 | catch (Error | RuntimeException exception) { 420 | wrapped.put("error", wrapError(exception)); 421 | reply.reply(wrapped); 422 | } 423 | }); 424 | } else { 425 | channel.setMessageHandler(null); 426 | } 427 | } 428 | } 429 | } 430 | private static class SignalRPlatformApiCodec extends StandardMessageCodec { 431 | public static final SignalRPlatformApiCodec INSTANCE = new SignalRPlatformApiCodec(); 432 | private SignalRPlatformApiCodec() {} 433 | @Override 434 | protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { 435 | switch (type) { 436 | case (byte)128: 437 | return StatusChangeResult.fromMap((Map) readValue(buffer)); 438 | 439 | default: 440 | return super.readValueOfType(type, buffer); 441 | 442 | } 443 | } 444 | @Override 445 | protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { 446 | if (value instanceof StatusChangeResult) { 447 | stream.write(128); 448 | writeValue(stream, ((StatusChangeResult) value).toMap()); 449 | } else 450 | { 451 | super.writeValue(stream, value); 452 | } 453 | } 454 | } 455 | 456 | /** Generated class from Pigeon that represents Flutter messages that can be called from Java. */ 457 | public static class SignalRPlatformApi { 458 | private final BinaryMessenger binaryMessenger; 459 | public SignalRPlatformApi(BinaryMessenger argBinaryMessenger){ 460 | this.binaryMessenger = argBinaryMessenger; 461 | } 462 | public interface Reply { 463 | void reply(T reply); 464 | } 465 | /** The codec used by SignalRPlatformApi. */ 466 | static MessageCodec getCodec() { 467 | return SignalRPlatformApiCodec.INSTANCE; 468 | } 469 | public void onStatusChange(@NonNull StatusChangeResult statusChangeResultArg, Reply callback) { 470 | BasicMessageChannel channel = 471 | new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.SignalRPlatformApi.onStatusChange", getCodec()); 472 | channel.send(new ArrayList(Collections.singletonList(statusChangeResultArg)), channelReply -> { 473 | callback.reply(null); 474 | }); 475 | } 476 | public void onNewMessage(@NonNull String hubNameArg, @NonNull String messageArg, Reply callback) { 477 | BasicMessageChannel channel = 478 | new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.SignalRPlatformApi.onNewMessage", getCodec()); 479 | channel.send(new ArrayList(Arrays.asList(hubNameArg, messageArg)), channelReply -> { 480 | callback.reply(null); 481 | }); 482 | } 483 | } 484 | @NonNull private static Map wrapError(@NonNull Throwable exception) { 485 | Map errorMap = new HashMap<>(); 486 | errorMap.put("message", exception.toString()); 487 | errorMap.put("code", exception.getClass().getSimpleName()); 488 | errorMap.put("details", "Cause: " + exception.getCause() + ", Stacktrace: " + Log.getStackTraceString(exception)); 489 | return errorMap; 490 | } 491 | } 492 | -------------------------------------------------------------------------------- /android/src/main/kotlin/dev/asdevs/signalr_flutter/SignalRFlutterPlugin.kt: -------------------------------------------------------------------------------- 1 | package dev.asdevs.signalr_flutter 2 | 3 | import android.os.Handler 4 | import android.os.Looper 5 | 6 | import io.flutter.embedding.engine.plugins.FlutterPlugin 7 | import microsoft.aspnet.signalr.client.ConnectionState 8 | import microsoft.aspnet.signalr.client.Credentials 9 | import microsoft.aspnet.signalr.client.LogLevel 10 | import microsoft.aspnet.signalr.client.SignalRFuture 11 | import microsoft.aspnet.signalr.client.hubs.HubConnection 12 | import microsoft.aspnet.signalr.client.hubs.HubProxy 13 | import microsoft.aspnet.signalr.client.transport.LongPollingTransport 14 | import microsoft.aspnet.signalr.client.transport.ServerSentEventsTransport 15 | import java.lang.Exception 16 | 17 | /** SignalrFlutterPlugin */ 18 | class SignalrFlutterPlugin : FlutterPlugin, SignalrApi.SignalRHostApi { 19 | private lateinit var connection: HubConnection 20 | private lateinit var hub: HubProxy 21 | 22 | private lateinit var signalrApi: SignalrApi.SignalRPlatformApi 23 | 24 | override fun onAttachedToEngine(flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) { 25 | SignalrApi.SignalRHostApi.setup(flutterPluginBinding.binaryMessenger, this) 26 | signalrApi = SignalrApi.SignalRPlatformApi(flutterPluginBinding.binaryMessenger) 27 | } 28 | 29 | override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) { 30 | SignalrApi.SignalRHostApi.setup(binding.binaryMessenger, null) 31 | } 32 | 33 | override fun connect( 34 | connectionOptions: SignalrApi.ConnectionOptions, 35 | result: SignalrApi.Result? 36 | ) { 37 | try { 38 | connection = 39 | if (connectionOptions.queryString?.isNotEmpty() == true) { 40 | HubConnection( 41 | connectionOptions.baseUrl, 42 | connectionOptions.queryString, 43 | true 44 | ) { _: String, _: LogLevel -> 45 | } 46 | } else { 47 | HubConnection(connectionOptions.baseUrl) 48 | } 49 | 50 | if (connectionOptions.headers?.isNotEmpty() == true) { 51 | val cred = Credentials { request -> 52 | request.headers = connectionOptions.headers 53 | } 54 | connection.credentials = cred 55 | } 56 | 57 | hub = connection.createHubProxy(connectionOptions.hubName) 58 | 59 | connectionOptions.hubMethods?.forEach { methodName -> 60 | hub.on(methodName, { res -> 61 | Handler(Looper.getMainLooper()).post { 62 | signalrApi.onNewMessage(methodName, res) { } 63 | } 64 | }, String::class.java) 65 | } 66 | 67 | connection.connected { 68 | Handler(Looper.getMainLooper()).post { 69 | val statusChangeResult = SignalrApi.StatusChangeResult() 70 | statusChangeResult.connectionId = connection.connectionId 71 | statusChangeResult.status = SignalrApi.ConnectionStatus.CONNECTED 72 | signalrApi.onStatusChange(statusChangeResult) { } 73 | } 74 | } 75 | 76 | connection.reconnected { 77 | Handler(Looper.getMainLooper()).post { 78 | val statusChangeResult = SignalrApi.StatusChangeResult() 79 | statusChangeResult.connectionId = connection.connectionId 80 | statusChangeResult.status = SignalrApi.ConnectionStatus.CONNECTED 81 | signalrApi.onStatusChange(statusChangeResult) { } 82 | } 83 | } 84 | 85 | connection.reconnecting { 86 | Handler(Looper.getMainLooper()).post { 87 | val statusChangeResult = SignalrApi.StatusChangeResult() 88 | statusChangeResult.connectionId = connection.connectionId 89 | statusChangeResult.status = SignalrApi.ConnectionStatus.RECONNECTING 90 | signalrApi.onStatusChange(statusChangeResult) { } 91 | } 92 | } 93 | 94 | connection.closed { 95 | Handler(Looper.getMainLooper()).post { 96 | val statusChangeResult = SignalrApi.StatusChangeResult() 97 | statusChangeResult.connectionId = connection.connectionId 98 | statusChangeResult.status = SignalrApi.ConnectionStatus.DISCONNECTED 99 | signalrApi.onStatusChange(statusChangeResult) { } 100 | } 101 | } 102 | 103 | connection.connectionSlow { 104 | Handler(Looper.getMainLooper()).post { 105 | val statusChangeResult = SignalrApi.StatusChangeResult() 106 | statusChangeResult.connectionId = connection.connectionId 107 | statusChangeResult.status = SignalrApi.ConnectionStatus.CONNECTION_SLOW 108 | signalrApi.onStatusChange(statusChangeResult) { } 109 | } 110 | } 111 | 112 | connection.error { handler -> 113 | Handler(Looper.getMainLooper()).post { 114 | val statusChangeResult = SignalrApi.StatusChangeResult() 115 | statusChangeResult.status = SignalrApi.ConnectionStatus.CONNECTION_ERROR 116 | statusChangeResult.errorMessage = handler.localizedMessage 117 | signalrApi.onStatusChange(statusChangeResult) { } 118 | } 119 | } 120 | 121 | when (connectionOptions.transport) { 122 | SignalrApi.Transport.SERVER_SENT_EVENTS -> connection.start( 123 | ServerSentEventsTransport( 124 | connection.logger 125 | ) 126 | ) 127 | SignalrApi.Transport.LONG_POLLING -> connection.start( 128 | LongPollingTransport( 129 | connection.logger 130 | ) 131 | ) 132 | else -> { 133 | connection.start() 134 | } 135 | } 136 | 137 | result?.success(connection.connectionId ?: "") 138 | } catch (ex: Exception) { 139 | result?.error(ex) 140 | } 141 | } 142 | 143 | override fun reconnect(result: SignalrApi.Result?) { 144 | try { 145 | connection.start() 146 | result?.success(connection.connectionId ?: "") 147 | } catch (ex: Exception) { 148 | result?.error(ex) 149 | } 150 | } 151 | 152 | override fun stop(result: SignalrApi.Result?) { 153 | try { 154 | connection.stop() 155 | } catch (ex: Exception) { 156 | result?.error(ex) 157 | } 158 | } 159 | 160 | override fun isConnected(result: SignalrApi.Result?) { 161 | try { 162 | if (this::connection.isInitialized) { 163 | when (connection.state) { 164 | ConnectionState.Connected -> result?.success(true) 165 | else -> result?.success(false) 166 | } 167 | } else { 168 | result?.success(false) 169 | } 170 | } catch (ex: Exception) { 171 | result?.error(ex) 172 | } 173 | } 174 | 175 | override fun invokeMethod( 176 | methodName: String, 177 | arguments: MutableList, 178 | result: SignalrApi.Result? 179 | ) { 180 | try { 181 | val res: SignalRFuture = 182 | hub.invoke(String::class.java, methodName, *arguments.toTypedArray()) 183 | 184 | res.done { msg: String? -> 185 | Handler(Looper.getMainLooper()).post { 186 | result?.success(msg ?: "") 187 | } 188 | } 189 | 190 | res.onError { throwable -> 191 | throw throwable 192 | } 193 | } catch (ex: Exception) { 194 | result?.error(ex) 195 | } 196 | } 197 | } 198 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Web related 35 | lib/generated_plugin_registrant.dart 36 | 37 | # Symbolication related 38 | app.*.symbols 39 | 40 | # Obfuscation related 41 | app.*.map.json 42 | 43 | # Android Studio will place build artifacts here 44 | /android/app/debug 45 | /android/app/profile 46 | /android/app/release 47 | -------------------------------------------------------------------------------- /example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 18116933e77adc82f80866c928266a5b4f1ed645 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # signalr_flutter_example 2 | 3 | Demonstrates how to use the signalr_flutter plugin. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.dev/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /example/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the analyzer, which statically analyzes Dart code to 2 | # check for errors, warnings, and lints. 3 | # 4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled 5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be 6 | # invoked from the command line by running `flutter analyze`. 7 | 8 | # The following line activates a set of recommended lints for Flutter apps, 9 | # packages, and plugins designed to encourage good coding practices. 10 | include: package:flutter_lints/flutter.yaml 11 | 12 | linter: 13 | # The lint rules applied to this project can be customized in the 14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml` 15 | # included above or to enable additional rules. A list of all available lints 16 | # and their documentation is published at 17 | # https://dart-lang.github.io/linter/lints/index.html. 18 | # 19 | # Instead of disabling a lint rule for the entire project in the 20 | # section below, it can also be suppressed for a single line of code 21 | # or a specific dart file by using the `// ignore: name_of_lint` and 22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 23 | # producing the lint. 24 | rules: 25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 27 | 28 | # Additional information about this file can be found at 29 | # https://dart.dev/guides/language/analysis-options 30 | -------------------------------------------------------------------------------- /example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id "com.android.application" 3 | id "kotlin-android" 4 | id "dev.flutter.flutter-gradle-plugin" 5 | } 6 | 7 | 8 | def localProperties = new Properties() 9 | def localPropertiesFile = rootProject.file('local.properties') 10 | if (localPropertiesFile.exists()) { 11 | localPropertiesFile.withReader('UTF-8') { reader -> 12 | localProperties.load(reader) 13 | } 14 | } 15 | 16 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 17 | if (flutterVersionCode == null) { 18 | flutterVersionCode = '1' 19 | } 20 | 21 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 22 | if (flutterVersionName == null) { 23 | flutterVersionName = '1.0' 24 | } 25 | 26 | android { 27 | namespace "dev.asdevs.signalr_flutter_example" 28 | 29 | compileOptions { 30 | sourceCompatibility JavaVersion.VERSION_17 31 | targetCompatibility JavaVersion.VERSION_17 32 | } 33 | 34 | kotlinOptions { 35 | jvmTarget = '17' 36 | } 37 | 38 | sourceSets { 39 | main.java.srcDirs += 'src/main/kotlin' 40 | } 41 | 42 | defaultConfig { 43 | applicationId "dev.asdevs.signalr_flutter_example" 44 | compileSdk 33 45 | minSdkVersion 21 46 | targetSdkVersion 33 47 | versionCode flutterVersionCode.toInteger() 48 | versionName flutterVersionName 49 | } 50 | 51 | buildTypes { 52 | release { 53 | // Signing with the debug keys for now, so `flutter run --release` works. 54 | signingConfig signingConfigs.debug 55 | } 56 | } 57 | } 58 | 59 | flutter { 60 | source '../..' 61 | } 62 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 13 | 17 | 21 | 26 | 30 | 31 | 32 | 33 | 34 | 35 | 37 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /example/android/app/src/main/kotlin/dev/asdevs/signalr_flutter_example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package dev.asdevs.signalr_flutter_example 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AS-Devs/signalr_flutter/8bd721a9c572120d3a71bc12edf7baaec88bfb5b/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AS-Devs/signalr_flutter/8bd721a9c572120d3a71bc12edf7baaec88bfb5b/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AS-Devs/signalr_flutter/8bd721a9c572120d3a71bc12edf7baaec88bfb5b/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AS-Devs/signalr_flutter/8bd721a9c572120d3a71bc12edf7baaec88bfb5b/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AS-Devs/signalr_flutter/8bd721a9c572120d3a71bc12edf7baaec88bfb5b/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | allprojects { 2 | repositories { 3 | google() 4 | mavenCentral() 5 | } 6 | } 7 | 8 | rootProject.buildDir = '../build' 9 | subprojects { 10 | project.buildDir = "${rootProject.buildDir}/${project.name}" 11 | project.evaluationDependsOn(':app') 12 | } 13 | 14 | tasks.register("clean", Delete) { 15 | delete rootProject.buildDir 16 | } 17 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip 7 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 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 | }() 9 | 10 | includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") 11 | 12 | repositories { 13 | google() 14 | mavenCentral() 15 | gradlePluginPortal() 16 | } 17 | } 18 | 19 | plugins { 20 | id "dev.flutter.flutter-plugin-loader" version "1.0.0" 21 | id "com.android.application" version "8.1.0" apply false 22 | id "org.jetbrains.kotlin.android" version "1.8.22" apply false 23 | } 24 | 25 | include ':app' -------------------------------------------------------------------------------- /example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 11.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '11.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | use_frameworks! 32 | use_modular_headers! 33 | 34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 35 | end 36 | 37 | post_install do |installer| 38 | installer.pods_project.targets.each do |target| 39 | flutter_additional_ios_build_settings(target) 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /example/ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Flutter (1.0.0) 3 | - signalr_flutter (0.0.1): 4 | - Flutter 5 | 6 | DEPENDENCIES: 7 | - Flutter (from `Flutter`) 8 | - signalr_flutter (from `.symlinks/plugins/signalr_flutter/ios`) 9 | 10 | EXTERNAL SOURCES: 11 | Flutter: 12 | :path: Flutter 13 | signalr_flutter: 14 | :path: ".symlinks/plugins/signalr_flutter/ios" 15 | 16 | SPEC CHECKSUMS: 17 | Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 18 | signalr_flutter: fcbc21129947f1f53e38b6b035012aa150359bc8 19 | 20 | PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3 21 | 22 | COCOAPODS: 1.11.3 23 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 51; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 13 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 14 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 15 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 16 | A3825B7D4C39CB585CB06C32 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E5528DD5FB2E517FAFE0629F /* Pods_Runner.framework */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXCopyFilesBuildPhase section */ 20 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 21 | isa = PBXCopyFilesBuildPhase; 22 | buildActionMask = 2147483647; 23 | dstPath = ""; 24 | dstSubfolderSpec = 10; 25 | files = ( 26 | ); 27 | name = "Embed Frameworks"; 28 | runOnlyForDeploymentPostprocessing = 0; 29 | }; 30 | /* End PBXCopyFilesBuildPhase section */ 31 | 32 | /* Begin PBXFileReference section */ 33 | 00D58DCEF6AB359E49B0A5E5 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 34 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 35 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 36 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 37 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 38 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 39 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 40 | 83DF5C9EB55097741FFB02F8 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 41 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 42 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 43 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 44 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 45 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 46 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 47 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 48 | D695C71FA7896E0D227EF338 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 49 | E5528DD5FB2E517FAFE0629F /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | /* End PBXFileReference section */ 51 | 52 | /* Begin PBXFrameworksBuildPhase section */ 53 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 54 | isa = PBXFrameworksBuildPhase; 55 | buildActionMask = 2147483647; 56 | files = ( 57 | A3825B7D4C39CB585CB06C32 /* Pods_Runner.framework in Frameworks */, 58 | ); 59 | runOnlyForDeploymentPostprocessing = 0; 60 | }; 61 | /* End PBXFrameworksBuildPhase section */ 62 | 63 | /* Begin PBXGroup section */ 64 | 961B3FAB7B6342EBA7854FB5 /* Pods */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | 00D58DCEF6AB359E49B0A5E5 /* Pods-Runner.debug.xcconfig */, 68 | 83DF5C9EB55097741FFB02F8 /* Pods-Runner.release.xcconfig */, 69 | D695C71FA7896E0D227EF338 /* Pods-Runner.profile.xcconfig */, 70 | ); 71 | path = Pods; 72 | sourceTree = ""; 73 | }; 74 | 9740EEB11CF90186004384FC /* Flutter */ = { 75 | isa = PBXGroup; 76 | children = ( 77 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 78 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 79 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 80 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 81 | ); 82 | name = Flutter; 83 | sourceTree = ""; 84 | }; 85 | 97C146E51CF9000F007C117D = { 86 | isa = PBXGroup; 87 | children = ( 88 | 9740EEB11CF90186004384FC /* Flutter */, 89 | 97C146F01CF9000F007C117D /* Runner */, 90 | 97C146EF1CF9000F007C117D /* Products */, 91 | 961B3FAB7B6342EBA7854FB5 /* Pods */, 92 | A09C56985D20AF6CBF21338F /* Frameworks */, 93 | ); 94 | sourceTree = ""; 95 | }; 96 | 97C146EF1CF9000F007C117D /* Products */ = { 97 | isa = PBXGroup; 98 | children = ( 99 | 97C146EE1CF9000F007C117D /* Runner.app */, 100 | ); 101 | name = Products; 102 | sourceTree = ""; 103 | }; 104 | 97C146F01CF9000F007C117D /* Runner */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 108 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 109 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 110 | 97C147021CF9000F007C117D /* Info.plist */, 111 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 112 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 113 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 114 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 115 | ); 116 | path = Runner; 117 | sourceTree = ""; 118 | }; 119 | A09C56985D20AF6CBF21338F /* Frameworks */ = { 120 | isa = PBXGroup; 121 | children = ( 122 | E5528DD5FB2E517FAFE0629F /* Pods_Runner.framework */, 123 | ); 124 | name = Frameworks; 125 | sourceTree = ""; 126 | }; 127 | /* End PBXGroup section */ 128 | 129 | /* Begin PBXNativeTarget section */ 130 | 97C146ED1CF9000F007C117D /* Runner */ = { 131 | isa = PBXNativeTarget; 132 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 133 | buildPhases = ( 134 | 14480EB777FC38A538FB5EB0 /* [CP] Check Pods Manifest.lock */, 135 | 9740EEB61CF901F6004384FC /* Run Script */, 136 | 97C146EA1CF9000F007C117D /* Sources */, 137 | 97C146EB1CF9000F007C117D /* Frameworks */, 138 | 97C146EC1CF9000F007C117D /* Resources */, 139 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 140 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 141 | 5247C24FE5952D486D984070 /* [CP] Embed Pods Frameworks */, 142 | ); 143 | buildRules = ( 144 | ); 145 | dependencies = ( 146 | ); 147 | name = Runner; 148 | productName = Runner; 149 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 150 | productType = "com.apple.product-type.application"; 151 | }; 152 | /* End PBXNativeTarget section */ 153 | 154 | /* Begin PBXProject section */ 155 | 97C146E61CF9000F007C117D /* Project object */ = { 156 | isa = PBXProject; 157 | attributes = { 158 | LastUpgradeCheck = 1300; 159 | ORGANIZATIONNAME = ""; 160 | TargetAttributes = { 161 | 97C146ED1CF9000F007C117D = { 162 | CreatedOnToolsVersion = 7.3.1; 163 | LastSwiftMigration = 1100; 164 | }; 165 | }; 166 | }; 167 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 168 | compatibilityVersion = "Xcode 9.3"; 169 | developmentRegion = en; 170 | hasScannedForEncodings = 0; 171 | knownRegions = ( 172 | en, 173 | Base, 174 | ); 175 | mainGroup = 97C146E51CF9000F007C117D; 176 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 177 | projectDirPath = ""; 178 | projectRoot = ""; 179 | targets = ( 180 | 97C146ED1CF9000F007C117D /* Runner */, 181 | ); 182 | }; 183 | /* End PBXProject section */ 184 | 185 | /* Begin PBXResourcesBuildPhase section */ 186 | 97C146EC1CF9000F007C117D /* Resources */ = { 187 | isa = PBXResourcesBuildPhase; 188 | buildActionMask = 2147483647; 189 | files = ( 190 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 191 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 192 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 193 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 194 | ); 195 | runOnlyForDeploymentPostprocessing = 0; 196 | }; 197 | /* End PBXResourcesBuildPhase section */ 198 | 199 | /* Begin PBXShellScriptBuildPhase section */ 200 | 14480EB777FC38A538FB5EB0 /* [CP] Check Pods Manifest.lock */ = { 201 | isa = PBXShellScriptBuildPhase; 202 | buildActionMask = 2147483647; 203 | files = ( 204 | ); 205 | inputFileListPaths = ( 206 | ); 207 | inputPaths = ( 208 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 209 | "${PODS_ROOT}/Manifest.lock", 210 | ); 211 | name = "[CP] Check Pods Manifest.lock"; 212 | outputFileListPaths = ( 213 | ); 214 | outputPaths = ( 215 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", 216 | ); 217 | runOnlyForDeploymentPostprocessing = 0; 218 | shellPath = /bin/sh; 219 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 220 | showEnvVarsInLog = 0; 221 | }; 222 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 223 | isa = PBXShellScriptBuildPhase; 224 | buildActionMask = 2147483647; 225 | files = ( 226 | ); 227 | inputPaths = ( 228 | ); 229 | name = "Thin Binary"; 230 | outputPaths = ( 231 | ); 232 | runOnlyForDeploymentPostprocessing = 0; 233 | shellPath = /bin/sh; 234 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin\n"; 235 | }; 236 | 5247C24FE5952D486D984070 /* [CP] Embed Pods Frameworks */ = { 237 | isa = PBXShellScriptBuildPhase; 238 | buildActionMask = 2147483647; 239 | files = ( 240 | ); 241 | inputFileListPaths = ( 242 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", 243 | ); 244 | name = "[CP] Embed Pods Frameworks"; 245 | outputFileListPaths = ( 246 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", 247 | ); 248 | runOnlyForDeploymentPostprocessing = 0; 249 | shellPath = /bin/sh; 250 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; 251 | showEnvVarsInLog = 0; 252 | }; 253 | 9740EEB61CF901F6004384FC /* Run Script */ = { 254 | isa = PBXShellScriptBuildPhase; 255 | buildActionMask = 2147483647; 256 | files = ( 257 | ); 258 | inputPaths = ( 259 | ); 260 | name = "Run Script"; 261 | outputPaths = ( 262 | ); 263 | runOnlyForDeploymentPostprocessing = 0; 264 | shellPath = /bin/sh; 265 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build\n"; 266 | }; 267 | /* End PBXShellScriptBuildPhase section */ 268 | 269 | /* Begin PBXSourcesBuildPhase section */ 270 | 97C146EA1CF9000F007C117D /* Sources */ = { 271 | isa = PBXSourcesBuildPhase; 272 | buildActionMask = 2147483647; 273 | files = ( 274 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 275 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 276 | ); 277 | runOnlyForDeploymentPostprocessing = 0; 278 | }; 279 | /* End PBXSourcesBuildPhase section */ 280 | 281 | /* Begin PBXVariantGroup section */ 282 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 283 | isa = PBXVariantGroup; 284 | children = ( 285 | 97C146FB1CF9000F007C117D /* Base */, 286 | ); 287 | name = Main.storyboard; 288 | sourceTree = ""; 289 | }; 290 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 291 | isa = PBXVariantGroup; 292 | children = ( 293 | 97C147001CF9000F007C117D /* Base */, 294 | ); 295 | name = LaunchScreen.storyboard; 296 | sourceTree = ""; 297 | }; 298 | /* End PBXVariantGroup section */ 299 | 300 | /* Begin XCBuildConfiguration section */ 301 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 302 | isa = XCBuildConfiguration; 303 | buildSettings = { 304 | ALWAYS_SEARCH_USER_PATHS = NO; 305 | CLANG_ANALYZER_NONNULL = YES; 306 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 307 | CLANG_CXX_LIBRARY = "libc++"; 308 | CLANG_ENABLE_MODULES = YES; 309 | CLANG_ENABLE_OBJC_ARC = YES; 310 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 311 | CLANG_WARN_BOOL_CONVERSION = YES; 312 | CLANG_WARN_COMMA = YES; 313 | CLANG_WARN_CONSTANT_CONVERSION = YES; 314 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 315 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 316 | CLANG_WARN_EMPTY_BODY = YES; 317 | CLANG_WARN_ENUM_CONVERSION = YES; 318 | CLANG_WARN_INFINITE_RECURSION = YES; 319 | CLANG_WARN_INT_CONVERSION = YES; 320 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 321 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 322 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 323 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 324 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 325 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 326 | CLANG_WARN_STRICT_PROTOTYPES = YES; 327 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 328 | CLANG_WARN_UNREACHABLE_CODE = YES; 329 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 330 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 331 | COPY_PHASE_STRIP = NO; 332 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 333 | ENABLE_NS_ASSERTIONS = NO; 334 | ENABLE_STRICT_OBJC_MSGSEND = YES; 335 | GCC_C_LANGUAGE_STANDARD = gnu99; 336 | GCC_NO_COMMON_BLOCKS = YES; 337 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 338 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 339 | GCC_WARN_UNDECLARED_SELECTOR = YES; 340 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 341 | GCC_WARN_UNUSED_FUNCTION = YES; 342 | GCC_WARN_UNUSED_VARIABLE = YES; 343 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 344 | MTL_ENABLE_DEBUG_INFO = NO; 345 | SDKROOT = iphoneos; 346 | SUPPORTED_PLATFORMS = iphoneos; 347 | TARGETED_DEVICE_FAMILY = "1,2"; 348 | VALIDATE_PRODUCT = YES; 349 | }; 350 | name = Profile; 351 | }; 352 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 353 | isa = XCBuildConfiguration; 354 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 355 | buildSettings = { 356 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 357 | CLANG_ENABLE_MODULES = YES; 358 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 359 | DEVELOPMENT_TEAM = Y334H564QX; 360 | ENABLE_BITCODE = NO; 361 | INFOPLIST_FILE = Runner/Info.plist; 362 | LD_RUNPATH_SEARCH_PATHS = ( 363 | "$(inherited)", 364 | "@executable_path/Frameworks", 365 | ); 366 | PRODUCT_BUNDLE_IDENTIFIER = dev.asdevs.signalrFlutterExample; 367 | PRODUCT_NAME = "$(TARGET_NAME)"; 368 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 369 | SWIFT_VERSION = 5.0; 370 | VERSIONING_SYSTEM = "apple-generic"; 371 | }; 372 | name = Profile; 373 | }; 374 | 97C147031CF9000F007C117D /* Debug */ = { 375 | isa = XCBuildConfiguration; 376 | buildSettings = { 377 | ALWAYS_SEARCH_USER_PATHS = NO; 378 | CLANG_ANALYZER_NONNULL = YES; 379 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 380 | CLANG_CXX_LIBRARY = "libc++"; 381 | CLANG_ENABLE_MODULES = YES; 382 | CLANG_ENABLE_OBJC_ARC = YES; 383 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 384 | CLANG_WARN_BOOL_CONVERSION = YES; 385 | CLANG_WARN_COMMA = YES; 386 | CLANG_WARN_CONSTANT_CONVERSION = YES; 387 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 388 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 389 | CLANG_WARN_EMPTY_BODY = YES; 390 | CLANG_WARN_ENUM_CONVERSION = YES; 391 | CLANG_WARN_INFINITE_RECURSION = YES; 392 | CLANG_WARN_INT_CONVERSION = YES; 393 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 394 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 395 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 396 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 397 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 398 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 399 | CLANG_WARN_STRICT_PROTOTYPES = YES; 400 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 401 | CLANG_WARN_UNREACHABLE_CODE = YES; 402 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 403 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 404 | COPY_PHASE_STRIP = NO; 405 | DEBUG_INFORMATION_FORMAT = dwarf; 406 | ENABLE_STRICT_OBJC_MSGSEND = YES; 407 | ENABLE_TESTABILITY = YES; 408 | GCC_C_LANGUAGE_STANDARD = gnu99; 409 | GCC_DYNAMIC_NO_PIC = NO; 410 | GCC_NO_COMMON_BLOCKS = YES; 411 | GCC_OPTIMIZATION_LEVEL = 0; 412 | GCC_PREPROCESSOR_DEFINITIONS = ( 413 | "DEBUG=1", 414 | "$(inherited)", 415 | ); 416 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 417 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 418 | GCC_WARN_UNDECLARED_SELECTOR = YES; 419 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 420 | GCC_WARN_UNUSED_FUNCTION = YES; 421 | GCC_WARN_UNUSED_VARIABLE = YES; 422 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 423 | MTL_ENABLE_DEBUG_INFO = YES; 424 | ONLY_ACTIVE_ARCH = YES; 425 | SDKROOT = iphoneos; 426 | TARGETED_DEVICE_FAMILY = "1,2"; 427 | }; 428 | name = Debug; 429 | }; 430 | 97C147041CF9000F007C117D /* Release */ = { 431 | isa = XCBuildConfiguration; 432 | buildSettings = { 433 | ALWAYS_SEARCH_USER_PATHS = NO; 434 | CLANG_ANALYZER_NONNULL = YES; 435 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 436 | CLANG_CXX_LIBRARY = "libc++"; 437 | CLANG_ENABLE_MODULES = YES; 438 | CLANG_ENABLE_OBJC_ARC = YES; 439 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 440 | CLANG_WARN_BOOL_CONVERSION = YES; 441 | CLANG_WARN_COMMA = YES; 442 | CLANG_WARN_CONSTANT_CONVERSION = YES; 443 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 444 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 445 | CLANG_WARN_EMPTY_BODY = YES; 446 | CLANG_WARN_ENUM_CONVERSION = YES; 447 | CLANG_WARN_INFINITE_RECURSION = YES; 448 | CLANG_WARN_INT_CONVERSION = YES; 449 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 450 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 451 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 452 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 453 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 454 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 455 | CLANG_WARN_STRICT_PROTOTYPES = YES; 456 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 457 | CLANG_WARN_UNREACHABLE_CODE = YES; 458 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 459 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 460 | COPY_PHASE_STRIP = NO; 461 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 462 | ENABLE_NS_ASSERTIONS = NO; 463 | ENABLE_STRICT_OBJC_MSGSEND = YES; 464 | GCC_C_LANGUAGE_STANDARD = gnu99; 465 | GCC_NO_COMMON_BLOCKS = YES; 466 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 467 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 468 | GCC_WARN_UNDECLARED_SELECTOR = YES; 469 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 470 | GCC_WARN_UNUSED_FUNCTION = YES; 471 | GCC_WARN_UNUSED_VARIABLE = YES; 472 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 473 | MTL_ENABLE_DEBUG_INFO = NO; 474 | SDKROOT = iphoneos; 475 | SUPPORTED_PLATFORMS = iphoneos; 476 | SWIFT_COMPILATION_MODE = wholemodule; 477 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 478 | TARGETED_DEVICE_FAMILY = "1,2"; 479 | VALIDATE_PRODUCT = YES; 480 | }; 481 | name = Release; 482 | }; 483 | 97C147061CF9000F007C117D /* Debug */ = { 484 | isa = XCBuildConfiguration; 485 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 486 | buildSettings = { 487 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 488 | CLANG_ENABLE_MODULES = YES; 489 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 490 | DEVELOPMENT_TEAM = Y334H564QX; 491 | ENABLE_BITCODE = NO; 492 | INFOPLIST_FILE = Runner/Info.plist; 493 | LD_RUNPATH_SEARCH_PATHS = ( 494 | "$(inherited)", 495 | "@executable_path/Frameworks", 496 | ); 497 | PRODUCT_BUNDLE_IDENTIFIER = dev.asdevs.signalrFlutterExample; 498 | PRODUCT_NAME = "$(TARGET_NAME)"; 499 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 500 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 501 | SWIFT_VERSION = 5.0; 502 | VERSIONING_SYSTEM = "apple-generic"; 503 | }; 504 | name = Debug; 505 | }; 506 | 97C147071CF9000F007C117D /* Release */ = { 507 | isa = XCBuildConfiguration; 508 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 509 | buildSettings = { 510 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 511 | CLANG_ENABLE_MODULES = YES; 512 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 513 | DEVELOPMENT_TEAM = Y334H564QX; 514 | ENABLE_BITCODE = NO; 515 | INFOPLIST_FILE = Runner/Info.plist; 516 | LD_RUNPATH_SEARCH_PATHS = ( 517 | "$(inherited)", 518 | "@executable_path/Frameworks", 519 | ); 520 | PRODUCT_BUNDLE_IDENTIFIER = dev.asdevs.signalrFlutterExample; 521 | PRODUCT_NAME = "$(TARGET_NAME)"; 522 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 523 | SWIFT_VERSION = 5.0; 524 | VERSIONING_SYSTEM = "apple-generic"; 525 | }; 526 | name = Release; 527 | }; 528 | /* End XCBuildConfiguration section */ 529 | 530 | /* Begin XCConfigurationList section */ 531 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 532 | isa = XCConfigurationList; 533 | buildConfigurations = ( 534 | 97C147031CF9000F007C117D /* Debug */, 535 | 97C147041CF9000F007C117D /* Release */, 536 | 249021D3217E4FDB00AE95B9 /* Profile */, 537 | ); 538 | defaultConfigurationIsVisible = 0; 539 | defaultConfigurationName = Release; 540 | }; 541 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 542 | isa = XCConfigurationList; 543 | buildConfigurations = ( 544 | 97C147061CF9000F007C117D /* Debug */, 545 | 97C147071CF9000F007C117D /* Release */, 546 | 249021D4217E4FDB00AE95B9 /* Profile */, 547 | ); 548 | defaultConfigurationIsVisible = 0; 549 | defaultConfigurationName = Release; 550 | }; 551 | /* End XCConfigurationList section */ 552 | }; 553 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 554 | } 555 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AS-Devs/signalr_flutter/8bd721a9c572120d3a71bc12edf7baaec88bfb5b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AS-Devs/signalr_flutter/8bd721a9c572120d3a71bc12edf7baaec88bfb5b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AS-Devs/signalr_flutter/8bd721a9c572120d3a71bc12edf7baaec88bfb5b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AS-Devs/signalr_flutter/8bd721a9c572120d3a71bc12edf7baaec88bfb5b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AS-Devs/signalr_flutter/8bd721a9c572120d3a71bc12edf7baaec88bfb5b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AS-Devs/signalr_flutter/8bd721a9c572120d3a71bc12edf7baaec88bfb5b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AS-Devs/signalr_flutter/8bd721a9c572120d3a71bc12edf7baaec88bfb5b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AS-Devs/signalr_flutter/8bd721a9c572120d3a71bc12edf7baaec88bfb5b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AS-Devs/signalr_flutter/8bd721a9c572120d3a71bc12edf7baaec88bfb5b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AS-Devs/signalr_flutter/8bd721a9c572120d3a71bc12edf7baaec88bfb5b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AS-Devs/signalr_flutter/8bd721a9c572120d3a71bc12edf7baaec88bfb5b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AS-Devs/signalr_flutter/8bd721a9c572120d3a71bc12edf7baaec88bfb5b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AS-Devs/signalr_flutter/8bd721a9c572120d3a71bc12edf7baaec88bfb5b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AS-Devs/signalr_flutter/8bd721a9c572120d3a71bc12edf7baaec88bfb5b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AS-Devs/signalr_flutter/8bd721a9c572120d3a71bc12edf7baaec88bfb5b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AS-Devs/signalr_flutter/8bd721a9c572120d3a71bc12edf7baaec88bfb5b/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AS-Devs/signalr_flutter/8bd721a9c572120d3a71bc12edf7baaec88bfb5b/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AS-Devs/signalr_flutter/8bd721a9c572120d3a71bc12edf7baaec88bfb5b/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | signalr_flutter_example 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | CADisableMinimumFrameDurationOnPhone 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: avoid_print 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'dart:async'; 5 | 6 | import 'package:signalr_flutter/signalr_api.dart'; 7 | import 'package:signalr_flutter/signalr_flutter.dart'; 8 | 9 | void main() { 10 | runApp(const MyApp()); 11 | } 12 | 13 | class MyApp extends StatefulWidget { 14 | const MyApp({Key? key}) : super(key: key); 15 | 16 | @override 17 | State createState() => _MyAppState(); 18 | } 19 | 20 | class _MyAppState extends State { 21 | String signalRStatus = "disconnected"; 22 | late SignalR signalR; 23 | 24 | @override 25 | void initState() { 26 | super.initState(); 27 | initPlatformState(); 28 | } 29 | 30 | // Platform messages are asynchronous, so we initialize in an async method. 31 | Future initPlatformState() async { 32 | signalR = SignalR( 33 | "", 34 | "", 35 | hubMethods: [""], 36 | statusChangeCallback: _onStatusChange, 37 | hubCallback: _onNewMessage, 38 | ); 39 | } 40 | 41 | @override 42 | Widget build(BuildContext context) { 43 | return MaterialApp( 44 | home: Scaffold( 45 | appBar: AppBar( 46 | title: const Text("SignalR Plugin Example App"), 47 | ), 48 | body: Column( 49 | crossAxisAlignment: CrossAxisAlignment.stretch, 50 | mainAxisAlignment: MainAxisAlignment.center, 51 | children: [ 52 | Text( 53 | "Connection Status: $signalRStatus\n", 54 | style: Theme.of(context).textTheme.titleLarge, 55 | textAlign: TextAlign.center, 56 | ), 57 | Padding( 58 | padding: const EdgeInsets.only(top: 20.0), 59 | child: ElevatedButton( 60 | onPressed: _buttonTapped, 61 | child: const Text("Invoke Method"), 62 | ), 63 | ) 64 | ], 65 | ), 66 | floatingActionButton: FloatingActionButton( 67 | child: const Icon(Icons.cast_connected), 68 | onPressed: () async { 69 | final isConnected = await signalR.isConnected(); 70 | if (!isConnected) { 71 | final connId = await signalR.connect(); 72 | print("Connection ID: $connId"); 73 | } else { 74 | signalR.stop(); 75 | } 76 | }, 77 | ), 78 | ), 79 | ); 80 | } 81 | 82 | void _onStatusChange(ConnectionStatus? status) { 83 | if (mounted) { 84 | setState(() { 85 | signalRStatus = status?.name ?? ConnectionStatus.disconnected.name; 86 | }); 87 | } 88 | } 89 | 90 | void _onNewMessage(String methodName, String message) { 91 | print("MethodName = $methodName, Message = $message"); 92 | } 93 | 94 | void _buttonTapped() async { 95 | try { 96 | final result = await signalR.invokeMethod( 97 | "", 98 | arguments: [""], 99 | ); 100 | print(result); 101 | } catch (e) { 102 | print(e); 103 | } 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /example/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" 9 | url: "https://pub.dev" 10 | source: hosted 11 | version: "2.11.0" 12 | boolean_selector: 13 | dependency: transitive 14 | description: 15 | name: boolean_selector 16 | sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" 17 | url: "https://pub.dev" 18 | source: hosted 19 | version: "2.1.1" 20 | characters: 21 | dependency: transitive 22 | description: 23 | name: characters 24 | sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" 25 | url: "https://pub.dev" 26 | source: hosted 27 | version: "1.3.0" 28 | clock: 29 | dependency: transitive 30 | description: 31 | name: clock 32 | sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf 33 | url: "https://pub.dev" 34 | source: hosted 35 | version: "1.1.1" 36 | collection: 37 | dependency: transitive 38 | description: 39 | name: collection 40 | sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a 41 | url: "https://pub.dev" 42 | source: hosted 43 | version: "1.18.0" 44 | cupertino_icons: 45 | dependency: "direct main" 46 | description: 47 | name: cupertino_icons 48 | sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be 49 | url: "https://pub.dev" 50 | source: hosted 51 | version: "1.0.5" 52 | fake_async: 53 | dependency: transitive 54 | description: 55 | name: fake_async 56 | sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" 57 | url: "https://pub.dev" 58 | source: hosted 59 | version: "1.3.1" 60 | flutter: 61 | dependency: "direct main" 62 | description: flutter 63 | source: sdk 64 | version: "0.0.0" 65 | flutter_lints: 66 | dependency: "direct dev" 67 | description: 68 | name: flutter_lints 69 | sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c 70 | url: "https://pub.dev" 71 | source: hosted 72 | version: "2.0.1" 73 | flutter_test: 74 | dependency: "direct dev" 75 | description: flutter 76 | source: sdk 77 | version: "0.0.0" 78 | leak_tracker: 79 | dependency: transitive 80 | description: 81 | name: leak_tracker 82 | sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" 83 | url: "https://pub.dev" 84 | source: hosted 85 | version: "10.0.0" 86 | leak_tracker_flutter_testing: 87 | dependency: transitive 88 | description: 89 | name: leak_tracker_flutter_testing 90 | sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 91 | url: "https://pub.dev" 92 | source: hosted 93 | version: "2.0.1" 94 | leak_tracker_testing: 95 | dependency: transitive 96 | description: 97 | name: leak_tracker_testing 98 | sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 99 | url: "https://pub.dev" 100 | source: hosted 101 | version: "2.0.1" 102 | lints: 103 | dependency: transitive 104 | description: 105 | name: lints 106 | sha256: "5e4a9cd06d447758280a8ac2405101e0e2094d2a1dbdd3756aec3fe7775ba593" 107 | url: "https://pub.dev" 108 | source: hosted 109 | version: "2.0.1" 110 | matcher: 111 | dependency: transitive 112 | description: 113 | name: matcher 114 | sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb 115 | url: "https://pub.dev" 116 | source: hosted 117 | version: "0.12.16+1" 118 | material_color_utilities: 119 | dependency: transitive 120 | description: 121 | name: material_color_utilities 122 | sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" 123 | url: "https://pub.dev" 124 | source: hosted 125 | version: "0.8.0" 126 | meta: 127 | dependency: transitive 128 | description: 129 | name: meta 130 | sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 131 | url: "https://pub.dev" 132 | source: hosted 133 | version: "1.11.0" 134 | path: 135 | dependency: transitive 136 | description: 137 | name: path 138 | sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" 139 | url: "https://pub.dev" 140 | source: hosted 141 | version: "1.9.0" 142 | signalr_flutter: 143 | dependency: "direct main" 144 | description: 145 | path: ".." 146 | relative: true 147 | source: path 148 | version: "0.2.0" 149 | sky_engine: 150 | dependency: transitive 151 | description: flutter 152 | source: sdk 153 | version: "0.0.99" 154 | source_span: 155 | dependency: transitive 156 | description: 157 | name: source_span 158 | sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" 159 | url: "https://pub.dev" 160 | source: hosted 161 | version: "1.10.0" 162 | stack_trace: 163 | dependency: transitive 164 | description: 165 | name: stack_trace 166 | sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" 167 | url: "https://pub.dev" 168 | source: hosted 169 | version: "1.11.1" 170 | stream_channel: 171 | dependency: transitive 172 | description: 173 | name: stream_channel 174 | sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 175 | url: "https://pub.dev" 176 | source: hosted 177 | version: "2.1.2" 178 | string_scanner: 179 | dependency: transitive 180 | description: 181 | name: string_scanner 182 | sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" 183 | url: "https://pub.dev" 184 | source: hosted 185 | version: "1.2.0" 186 | term_glyph: 187 | dependency: transitive 188 | description: 189 | name: term_glyph 190 | sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 191 | url: "https://pub.dev" 192 | source: hosted 193 | version: "1.2.1" 194 | test_api: 195 | dependency: transitive 196 | description: 197 | name: test_api 198 | sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" 199 | url: "https://pub.dev" 200 | source: hosted 201 | version: "0.6.1" 202 | vector_math: 203 | dependency: transitive 204 | description: 205 | name: vector_math 206 | sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" 207 | url: "https://pub.dev" 208 | source: hosted 209 | version: "2.1.4" 210 | vm_service: 211 | dependency: transitive 212 | description: 213 | name: vm_service 214 | sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 215 | url: "https://pub.dev" 216 | source: hosted 217 | version: "13.0.0" 218 | sdks: 219 | dart: ">=3.2.0 <4.0.0" 220 | flutter: ">=3.19.0" 221 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: signalr_flutter_example 2 | description: Demonstrates how to use the signalr_flutter plugin. 3 | version: 1.1.0+1 4 | 5 | # The following line prevents the package from being accidentally published to 6 | # pub.dev using `flutter pub publish`. This is preferred for private packages. 7 | publish_to: "none" # Remove this line if you wish to publish to pub.dev 8 | 9 | environment: 10 | flutter: ">=3.19.0" 11 | sdk: ">=3.2.0" 12 | 13 | # Dependencies specify other packages that your package needs in order to work. 14 | # To automatically upgrade your package dependencies to the latest versions 15 | # consider running `flutter pub upgrade --major-versions`. Alternatively, 16 | # dependencies can be manually updated by changing the version numbers below to 17 | # the latest version available on pub.dev. To see which dependencies have newer 18 | # versions available, run `flutter pub outdated`. 19 | dependencies: 20 | flutter: 21 | sdk: flutter 22 | 23 | signalr_flutter: 24 | # When depending on this package from a real application you should use: 25 | # signalr_flutter: ^x.y.z 26 | # See https://dart.dev/tools/pub/dependencies#version-constraints 27 | # The example app is bundled with the plugin so we use a path dependency on 28 | # the parent directory to use the current plugin's version. 29 | path: ../ 30 | 31 | # The following adds the Cupertino Icons font to your application. 32 | # Use with the CupertinoIcons class for iOS style icons. 33 | cupertino_icons: ^1.0.5 34 | 35 | dev_dependencies: 36 | flutter_test: 37 | sdk: flutter 38 | 39 | # The "flutter_lints" package below contains a set of recommended lints to 40 | # encourage good coding practices. The lint set provided by the package is 41 | # activated in the `analysis_options.yaml` file located at the root of your 42 | # package. See that file for information about deactivating specific lint 43 | # rules and activating additional ones. 44 | flutter_lints: ^2.0.1 45 | 46 | # For information on the generic Dart part of this file, see the 47 | # following page: https://dart.dev/tools/pub/pubspec 48 | 49 | # The following section is specific to Flutter. 50 | flutter: 51 | 52 | uses-material-design: true -------------------------------------------------------------------------------- /example/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:signalr_flutter_example/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Verify Platform version', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(const MyApp()); 17 | 18 | // Verify that platform version is retrieved. 19 | expect( 20 | find.byWidgetPredicate( 21 | (Widget widget) => 22 | widget is Text && widget.data!.startsWith('Running on:'), 23 | ), 24 | findsOneWidget, 25 | ); 26 | }); 27 | } 28 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | GeneratedPluginRegistrant.h 13 | GeneratedPluginRegistrant.m 14 | 15 | .generated/ 16 | 17 | *.pbxuser 18 | *.mode1v3 19 | *.mode2v3 20 | *.perspectivev3 21 | 22 | !default.pbxuser 23 | !default.mode1v3 24 | !default.mode2v3 25 | !default.perspectivev3 26 | 27 | xcuserdata 28 | 29 | *.moved-aside 30 | 31 | *.pyc 32 | *sync/ 33 | Icon? 34 | .tags* 35 | 36 | /Flutter/Generated.xcconfig 37 | /Flutter/ephemeral/ 38 | /Flutter/flutter_export_environment.sh -------------------------------------------------------------------------------- /ios/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AS-Devs/signalr_flutter/8bd721a9c572120d3a71bc12edf7baaec88bfb5b/ios/Assets/.gitkeep -------------------------------------------------------------------------------- /ios/Assets/SwiftR.js: -------------------------------------------------------------------------------- 1 | window.swiftR = { 2 | connection: null, 3 | hubs: {}, 4 | transport: ['webSockets','serverSentEvents','longPolling'], 5 | headers: {}, 6 | messages: {} 7 | }; 8 | 9 | $(function () { 10 | $.ajaxSetup({ 11 | beforeSend: function (jqxhr) { 12 | for (var h in swiftR.headers) { 13 | jqxhr.setRequestHeader(h, swiftR.headers[h]); 14 | } 15 | } 16 | }); 17 | postMessage({ message: 'ready' }); 18 | }); 19 | 20 | function initialize(baseUrl, isHub) { 21 | swiftR.connection = isHub ? $.hubConnection(baseUrl) : $.connection(baseUrl); 22 | var connection = swiftR.connection; 23 | 24 | connection.logging = true; 25 | 26 | if (!isHub) { 27 | connection.received(function (data) { 28 | postMessage({ data: data }); 29 | }); 30 | } 31 | 32 | connection.starting(function () { 33 | postMessage({ message: 'starting' }); 34 | }); 35 | 36 | connection.connectionSlow(function () { 37 | postMessage({ message: 'connectionSlow' }); 38 | }); 39 | 40 | connection.reconnecting(function () { 41 | postMessage({ message: 'reconnecting' }); 42 | }); 43 | 44 | connection.reconnected(function () { 45 | postMessage({ message: 'reconnected' }); 46 | }); 47 | 48 | connection.disconnected(function () { 49 | postMessage({ message: 'disconnected' }); 50 | }); 51 | 52 | connection.error(function (error) { 53 | postMessage({ message: 'error', error: processError(error) }); 54 | }); 55 | } 56 | 57 | function start() { 58 | swiftR.connection.start({ transport: swiftR.transport }).done(function () { 59 | postMessage({ message: 'connected', connectionId: swiftR.connection.id }); 60 | }).fail(function () { 61 | postMessage({ message: 'connectionFailed' }); 62 | }); 63 | } 64 | 65 | function addHandler(id, hubName, method) { 66 | var hub = ensureHub(hubName); 67 | 68 | hub.on(method, function () { 69 | postMessage({ 70 | id: id, 71 | hub: hub.hubName, 72 | method: method, 73 | arguments: [].slice.call(arguments) 74 | }); 75 | }); 76 | } 77 | 78 | function postMessage(msg) { 79 | var id = Math.random().toString(36).slice(2, 10); 80 | swiftR.messages[id] = msg; 81 | 82 | if (window.webkit) { 83 | webkit.messageHandlers.interOp.postMessage(id); 84 | } else { 85 | var frame = $('