Skip to content

Commit

Permalink
move extension to correct file
Browse files Browse the repository at this point in the history
  • Loading branch information
navaronbracke committed Mar 6, 2025
1 parent fc2e584 commit b285835
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
9 changes: 9 additions & 0 deletions auth0_flutter/lib/src/web/js_interop.dart
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,12 @@ extension type Auth0Client._(JSObject _) implements JSObject {
external JSPromise<JSBoolean> isAuthenticated();
external JSPromise<JSAny?> logout([final LogoutOptions? logoutParams]);
}

// TODO: remove this extension when updating to Dart 3.6.0
extension JSArrayExt on JSArray<JSString> {
@JS('length')
external int get arrayLength;

@JS('at')
external JSFunction get elementAt;
}
11 changes: 2 additions & 9 deletions auth0_flutter/lib/src/web/js_interop_utils.dart
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
import 'dart:js_interop';
import 'dart:js_interop_unsafe';

import 'js_interop.dart';

@JS('Object.keys')
external JSArray<JSString> keys(final JSObject o);

// TODO: remove this extension when updating to Dart 3.6.0
extension JSArrayExt on JSArray<JSString> {
@JS('length')
external int get arrayLength;

@JS('at')
external JSFunction get elementAt;
}

class JsInteropUtils {
/// Rebuilds the input object, omitting values that are null
static T stripNulls<T extends JSObject>(final T obj) {
Expand Down

0 comments on commit b285835

Please sign in to comment.