1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-09 06:18:49 +00:00

Clean up ng-flutter a bit (#2236)

No functional change, just while I was verifying it still works with the
latest Angular releases, completed some cleanup as well.
This commit is contained in:
Parker Lougheed
2024-04-08 16:22:25 -05:00
committed by GitHub
parent 37e149d8a6
commit 6b8f18392d
10 changed files with 97 additions and 103 deletions

View File

@@ -3,5 +3,3 @@ library;
export 'js_interop/counter_state_manager.dart';
export 'js_interop/helper.dart' show broadcastAppEvent;
export 'dart:js_interop' show createJSInteropWrapper;

View File

@@ -4,7 +4,8 @@ import 'package:web/web.dart';
/// Locates the root of the flutter app (for now, the first element that has
/// a flt-renderer tag), and dispatches a JS event named [name] with [data].
void broadcastAppEvent(String name, JSObject data) {
final HTMLElement? root = document.querySelector('[flt-renderer]') as HTMLElement?;
final HTMLElement? root =
document.querySelector('[flt-renderer]') as HTMLElement?;
assert(root != null, 'Flutter root element cannot be found!');
final eventDetails = CustomEventInit(detail: data);