Platform Interface - Dart
Platform Interface - Dart
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/widgets.dart';
import 'webview_flutter.dart';
/// Description of the error that can be used to communicate the problem to th
e user.
final String description;
/// Gets the URL for which the resource request was made.
///
/// This value is not provided on iOS. Alternatively, you can keep track of
/// the last values provided to [WebViewPlatformController.loadUrl].
final String failingUrl;
}
/// Removes JavaScript channel names from the set of enabled channels.
///
/// This disables channels that were previously enabled by [addJavaScriptChann
els] or through
/// [CreationParams.javascriptChannelNames].
Future<void> removeJavascriptChannels(Set<String> javascriptChannelNames) {
throw UnimplementedError(
"WebView removeJavascriptChannels is not implemented on the current plat
form");
}
final T _value;
@override
bool operator ==(Object other) {
if (other.runtimeType != runtimeType) return false;
final WebSetting<T> typedOther = other;
return typedOther.isPresent == isPresent && typedOther._value == _value;
}
@override
int get hashCode => hashValues(_value, isPresent);
}
@override
String toString() {
return 'WebSettings(javascriptMode: $javascriptMode, hasNavigationDelegate:
$hasNavigationDelegate, debuggingEnabled: $debuggingEnabled, gestureNavigationEn
abled: $gestureNavigationEnabled, userAgent: $userAgent)';
}
}
/// The initial set of JavaScript channels that are configured for this webvie
w.
///
/// For each value in this set the platform's webview should make sure that a
corresponding
/// property with a postMessage method is set on `window`. For example for a J
avaScript channel
/// named `Foo` it should be possible for JavaScript code executing in the web
view to do
///
/// ```javascript
/// Foo.postMessage('hello');
/// ```
// TODO(amirh): describe what should happen when postMessage is called once th
at code is migrated
// to PlatformWebView.
final Set<String> javascriptChannelNames;
/// The value used for the HTTP User-Agent: request header.
///
/// When null the platform's webview default is used for the User-Agent header
.
final String userAgent;
@override
String toString() {
return '$runtimeType(initialUrl: $initialUrl, settings: $webSettings, javasc
riptChannelNames: $javascriptChannelNames, UserAgent: $userAgent)';
}
}