-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Refactor to work with flutter web (#79)
* feat: Refactor to work with flutter web
- Loading branch information
1 parent
bfdaa63
commit bfbb3c8
Showing
52 changed files
with
2,796 additions
and
1,744 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,21 @@ | ||
|
||
import 'dart:isolate'; | ||
|
||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:integration_test/integration_test.dart'; | ||
import 'package:iris_method_channel/iris_method_channel.dart'; | ||
import 'package:iris_method_channel/src/platform/io/iris_event_io.dart'; | ||
|
||
void main() { | ||
IntegrationTestWidgetsFlutterBinding.ensureInitialized(); | ||
|
||
testWidgets('IrisEvent smoke test', | ||
(tester) async { | ||
await tester.pumpAndSettle(); | ||
testWidgets('IrisEvent smoke test', (tester) async { | ||
await tester.pumpAndSettle(); | ||
|
||
IrisEvent irisEvent = IrisEvent(); | ||
irisEvent.initialize(); | ||
final testPort = ReceivePort(); | ||
irisEvent.registerEventHandler(testPort.sendPort); | ||
irisEvent.unregisterEventHandler(testPort.sendPort); | ||
irisEvent.onEventPtr; | ||
irisEvent.dispose(); | ||
}); | ||
} | ||
IrisEventIO irisEvent = IrisEventIO(); | ||
irisEvent.initialize(); | ||
final testPort = ReceivePort(); | ||
irisEvent.registerEventHandler(testPort.sendPort); | ||
irisEvent.unregisterEventHandler(testPort.sendPort); | ||
irisEvent.onEventPtr; | ||
irisEvent.dispose(); | ||
}); | ||
} |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,59 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<!-- | ||
If you are serving your web app in a path other than the root, change the | ||
href value below to reflect the base path you are serving from. | ||
The path provided below has to start and end with a slash "/" in order for | ||
it to work correctly. | ||
For more details: | ||
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base | ||
This is a placeholder for base href that will be replaced by the value of | ||
the `--base-href` argument provided to `flutter build`. | ||
--> | ||
<base href="$FLUTTER_BASE_HREF"> | ||
|
||
<meta charset="UTF-8"> | ||
<meta content="IE=Edge" http-equiv="X-UA-Compatible"> | ||
<meta name="description" content="Demonstrates how to use the iris_method_channel plugin."> | ||
|
||
<!-- iOS meta tags & icons --> | ||
<meta name="apple-mobile-web-app-capable" content="yes"> | ||
<meta name="apple-mobile-web-app-status-bar-style" content="black"> | ||
<meta name="apple-mobile-web-app-title" content="iris_method_channel_example"> | ||
<link rel="apple-touch-icon" href="icons/Icon-192.png"> | ||
|
||
<!-- Favicon --> | ||
<link rel="icon" type="image/png" href="favicon.png"/> | ||
|
||
<title>iris_method_channel_example</title> | ||
<link rel="manifest" href="manifest.json"> | ||
|
||
<script> | ||
// The value below is injected by flutter build, do not touch. | ||
var serviceWorkerVersion = null; | ||
</script> | ||
<!-- This script adds the flutter initialization JS code --> | ||
<script src="flutter.js" defer></script> | ||
</head> | ||
<body> | ||
<script> | ||
window.addEventListener('load', function(ev) { | ||
// Download main.dart.js | ||
_flutter.loader.loadEntrypoint({ | ||
serviceWorker: { | ||
serviceWorkerVersion: serviceWorkerVersion, | ||
}, | ||
onEntrypointLoaded: function(engineInitializer) { | ||
engineInitializer.initializeEngine().then(function(appRunner) { | ||
appRunner.runApp(); | ||
}); | ||
} | ||
}); | ||
}); | ||
</script> | ||
</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,35 @@ | ||
{ | ||
"name": "iris_method_channel_example", | ||
"short_name": "iris_method_channel_example", | ||
"start_url": ".", | ||
"display": "standalone", | ||
"background_color": "#0175C2", | ||
"theme_color": "#0175C2", | ||
"description": "Demonstrates how to use the iris_method_channel plugin.", | ||
"orientation": "portrait-primary", | ||
"prefer_related_applications": false, | ||
"icons": [ | ||
{ | ||
"src": "icons/Icon-192.png", | ||
"sizes": "192x192", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "icons/Icon-512.png", | ||
"sizes": "512x512", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "icons/Icon-maskable-192.png", | ||
"sizes": "192x192", | ||
"type": "image/png", | ||
"purpose": "maskable" | ||
}, | ||
{ | ||
"src": "icons/Icon-maskable-512.png", | ||
"sizes": "512x512", | ||
"type": "image/png", | ||
"purpose": "maskable" | ||
} | ||
] | ||
} |
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,5 +1,7 @@ | ||
export 'src/bindings/native_iris_api_common_bindings.dart'; | ||
export 'src/iris_event.dart'; | ||
export 'src/iris_handles.dart'; | ||
export 'src/iris_method_channel.dart'; | ||
export 'src/native_bindings_delegate.dart'; | ||
export 'src/platform/iris_event_interface.dart'; | ||
export 'src/platform/iris_method_channel_interface.dart'; | ||
export 'src/platform/platform_bindings_delegate_interface.dart'; | ||
export 'src/platform/utils.dart'; | ||
export 'src/scoped_objects.dart'; |
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 @@ | ||
/// Export the common bindings of iris of `dart:io` | ||
export 'src/platform/io/bindings/native_iris_api_common_bindings.dart'; |
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 @@ | ||
/// Export the common bindings of iris of web | ||
export 'src/platform/web/bindings/iris_api_common_bindings_js.dart'; |
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,17 @@ | ||
// In order to *not* need this ignore, consider extracting the "web" version | ||
// of your plugin as a separate package, instead of inlining it in the same | ||
// package as the core of your plugin. | ||
// ignore: avoid_web_libraries_in_flutter | ||
|
||
import 'package:flutter_web_plugins/flutter_web_plugins.dart'; | ||
|
||
/// A web implementation of the IrisMethodChannelPlatform of the IrisMethodChannel plugin. | ||
class IrisMethodChannelWeb { | ||
/// Constructs a IrisMethodChannelWeb | ||
IrisMethodChannelWeb(); | ||
|
||
// ignore: public_member_api_docs | ||
static void registerWith(Registrar registrar) { | ||
// do nothing | ||
} | ||
} |
Oops, something went wrong.