Skip to content

Commit

Permalink
removed plugin_platform_interface dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
abner committed Apr 4, 2021
1 parent d1c571a commit 0a2c33f
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions lib/javascript_runtime.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

import 'dart:async';
import 'dart:convert';
import 'dart:ffi';
Expand Down Expand Up @@ -57,24 +55,9 @@ class FlutterJsPlatformEmpty extends JavascriptRuntime {
}
}

abstract class JavascriptRuntime extends PlatformInterface {
static final Object _token = Object();
static JavascriptRuntime get instance => _instance;
static JavascriptRuntime _instance = FlutterJsPlatformEmpty();

abstract class JavascriptRuntime {
static bool debugEnabled = false;

JavascriptRuntime() : super(token: _token);

/// Platform-specific plugins should set this with their own platform-specific
/// class that extends [UrlLauncherPlatform] when they register themselves.
// TODO(amirh): Extract common platform interface logic.
// https://github.com/flutter/flutter/issues/43368
static set instance(JavascriptRuntime instance) {
PlatformInterface.verifyToken(instance, _token);
_instance = instance;
}

@protected
JavascriptRuntime init() {
initChannelFunctions();
Expand Down

0 comments on commit 0a2c33f

Please sign in to comment.