-
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix websocket usage in web env, add simple web example (#85)
- Loading branch information
Showing
19 changed files
with
137 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
example/flutter_app/ios/Flutter/flutter_export_environment.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
#!/bin/sh | ||
# This is a generated file; do not edit or check into version control. | ||
export "FLUTTER_ROOT=/usr/local/Caskroom/flutter/2.0.6/flutter" | ||
export "FLUTTER_ROOT=/usr/local/Caskroom/flutter/3.10.6/flutter" | ||
export "FLUTTER_APPLICATION_PATH=/Users/fz/projects/centrifugal/centrifuge-dart/example/flutter_app" | ||
export "COCOAPODS_PARALLEL_CODE_SIGN=true" | ||
export "FLUTTER_TARGET=lib/main.dart" | ||
export "FLUTTER_BUILD_DIR=build" | ||
export "SYMROOT=${SOURCE_ROOT}/../build/ios" | ||
export "FLUTTER_BUILD_NAME=1.0.0" | ||
export "FLUTTER_BUILD_NUMBER=1" | ||
export "DART_OBFUSCATION=false" | ||
export "TRACK_WIDGET_CREATION=false" | ||
export "TRACK_WIDGET_CREATION=true" | ||
export "TREE_SHAKE_ICONS=false" | ||
export "PACKAGE_CONFIG=.packages" | ||
export "PACKAGE_CONFIG=.dart_tool/package_config.json" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# https://dart.dev/guides/libraries/private-files | ||
# Created by `dart pub` | ||
.dart_tool/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## 1.0.0 | ||
|
||
- Initial version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
An absolute bare-bones web app. | ||
|
||
``` | ||
dart pub global activate webdev | ||
webdev serve | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# This file configures the static analysis results for your project (errors, | ||
# warnings, and lints). | ||
# | ||
# This enables the 'recommended' set of lints from `package:lints`. | ||
# This set helps identify many issues that may lead to problems when running | ||
# or consuming Dart code, and enforces writing Dart using a single, idiomatic | ||
# style and format. | ||
# | ||
# If you want a smaller set of lints you can change this to specify | ||
# 'package:lints/core.yaml'. These are just the most critical lints | ||
# (the recommended set includes the core lints). | ||
# The core lints are also what is used by pub.dev for scoring packages. | ||
|
||
include: package:lints/recommended.yaml | ||
|
||
# Uncomment the following section to specify additional rules. | ||
|
||
# linter: | ||
# rules: | ||
# - camel_case_types | ||
|
||
# analyzer: | ||
# exclude: | ||
# - path/to/excluded/files/** | ||
|
||
# For more information about the core and recommended set of lints, see | ||
# https://dart.dev/go/core-lints | ||
|
||
# For additional information about configuring this file, see | ||
# https://dart.dev/guides/language/analysis-options |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: web_app | ||
description: An absolute bare-bones web app. | ||
version: 1.0.0 | ||
# repository: https://github.com/my_org/my_repo | ||
|
||
environment: | ||
sdk: ^3.2.4 | ||
|
||
# Add regular dependencies here. | ||
dependencies: | ||
centrifuge: | ||
path: ../../ | ||
|
||
publish_to: none | ||
|
||
dev_dependencies: | ||
build_runner: ^2.4.0 | ||
build_web_compilers: ^4.0.0 | ||
lints: ^2.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html> | ||
|
||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta name="scaffolded-by" content="https://github.com/dart-lang/sdk"> | ||
<title>web_app</title> | ||
<link rel="stylesheet" href="styles.css"> | ||
<script defer src="main.dart.js"></script> | ||
</head> | ||
|
||
<body> | ||
|
||
<div id="output"></div> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import 'dart:html'; | ||
|
||
import 'package:centrifuge/centrifuge.dart'; | ||
|
||
void main() { | ||
querySelector('#output')?.text = 'Your Dart app is running.'; | ||
|
||
void onEvent(dynamic event) { | ||
querySelector('#output')?.text = 'client> $event'; | ||
} | ||
|
||
const url = 'ws://localhost:8000/connection/websocket'; | ||
Client client = createClient( | ||
url, | ||
ClientConfig(), | ||
); | ||
|
||
// State changes. | ||
client.connecting.listen(onEvent); | ||
client.connected.listen(onEvent); | ||
client.disconnected.listen(onEvent); | ||
// Handle async errors. | ||
client.error.listen(onEvent); | ||
|
||
client.connect(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
@import url(https://fonts.googleapis.com/css?family=Roboto); | ||
|
||
html, body { | ||
width: 100%; | ||
height: 100%; | ||
margin: 0; | ||
padding: 0; | ||
font-family: 'Roboto', sans-serif; | ||
} | ||
|
||
#output { | ||
padding: 20px; | ||
text-align: center; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters