Updated generator
This commit is contained in:
parent
8968353551
commit
015b5f33ab
@ -16,8 +16,9 @@
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
- On Android, the `InAppWebView` widget uses hybrid composition by default (`useHybridComposition: true`).
|
||||
- All properties of `GeolocationPermissionShowPromptResponse` cannot be `null`;
|
||||
- On Android, the `InAppWebView` widget uses hybrid composition by default (`useHybridComposition: true`)
|
||||
- All properties of `GeolocationPermissionShowPromptResponse` cannot be `null`
|
||||
- Removed `URLProtectionSpace.iosIsProxy` property
|
||||
|
||||
## 5.4.3+7
|
||||
|
||||
|
@ -119,7 +119,7 @@ class ExchangeableObjectGenerator
|
||||
var defaultValueCode =
|
||||
parameter.defaultValueCode?.replaceFirst("_.", ".");
|
||||
var constructorField =
|
||||
'${!isNullable && defaultValueCode == null ? 'required ' : ''}$parameterType $parameterName${defaultValueCode != null ? ' = $defaultValueCode' : ''}';
|
||||
'${!isNullable && defaultValueCode == null ? 'required ' : ''}${parameterType.toString().replaceFirst("_", "")} $parameterName${defaultValueCode != null ? ' = $defaultValueCode' : ''}';
|
||||
if (parameter.hasDeprecated) {
|
||||
deprecatedFields.add(parameter);
|
||||
constructorField =
|
||||
@ -157,6 +157,7 @@ class ExchangeableObjectGenerator
|
||||
classBuffer.writeln(constructorBody
|
||||
.toString()
|
||||
.replaceAll(className, extClassName)
|
||||
.replaceAll("_.", ".")
|
||||
.replaceAll("@ExchangeableObjectConstructor()", ""));
|
||||
}
|
||||
} else if (constructorFields.length > 0) {
|
||||
@ -192,7 +193,8 @@ class ExchangeableObjectGenerator
|
||||
.replaceFirst("Use ", "")
|
||||
.replaceFirst(" instead", "")
|
||||
.trim();
|
||||
final fieldElement = visitor.fields[fieldName]!;
|
||||
final fieldElement = visitor.fields[fieldName];
|
||||
if (fieldElement != null) {
|
||||
final fieldTypeElement = fieldElement.type.element;
|
||||
final deprecatedFieldTypeElement = deprecatedField.type.element;
|
||||
|
||||
@ -224,6 +226,7 @@ class ExchangeableObjectGenerator
|
||||
}
|
||||
classBuffer.writeln(';');
|
||||
}
|
||||
}
|
||||
classBuffer.writeln('}');
|
||||
} else if (!hasCustomConstructor) {
|
||||
classBuffer.writeln(';');
|
||||
|
@ -6,7 +6,7 @@ import 'test_enum.dart';
|
||||
part 'test_class.g.dart';
|
||||
|
||||
///Custom docs
|
||||
@ExchangeableObject()
|
||||
// @ExchangeableObject()
|
||||
@SupportedPlatforms(platforms: [
|
||||
AndroidPlatform(
|
||||
apiName: "TestClass",
|
||||
@ -20,7 +20,7 @@ part 'test_class.g.dart';
|
||||
),
|
||||
WebPlatform(),
|
||||
])
|
||||
class TestClass_ extends TestClass3 {
|
||||
class TestClass_ extends TestClass3_ {
|
||||
///Docs 1
|
||||
String test1;
|
||||
///Docs 2
|
||||
@ -51,10 +51,125 @@ class TestClass_ extends TestClass3 {
|
||||
|
||||
}
|
||||
|
||||
class TestClass3 {
|
||||
@ExchangeableObject()
|
||||
class TestClass3_ {
|
||||
String asd;
|
||||
|
||||
TestClass3({required this.asd});
|
||||
TestClass3_({required this.asd});
|
||||
}
|
||||
|
||||
///Class that represents the navigation request used by the [WebView.onCreateWindow] event.
|
||||
@ExchangeableObject()
|
||||
class CreateWindowAction_ extends NavigationAction_ {
|
||||
///The window id. Used by [WebView] to create a new WebView.
|
||||
int windowId;
|
||||
|
||||
///Use [isDialog] instead.
|
||||
@Deprecated("Use isDialog instead")
|
||||
bool? androidIsDialog;
|
||||
|
||||
///Indicates if the new window should be a dialog, rather than a full-size window.
|
||||
@SupportedPlatforms(
|
||||
platforms: [
|
||||
AndroidPlatform()
|
||||
]
|
||||
)
|
||||
bool? isDialog;
|
||||
|
||||
CreateWindowAction_(
|
||||
{required this.windowId,
|
||||
@Deprecated('Use isDialog instead')
|
||||
this.androidIsDialog,
|
||||
this.isDialog,
|
||||
required bool isForMainFrame,
|
||||
@Deprecated('Use hasGesture instead')
|
||||
bool? androidHasGesture,
|
||||
@Deprecated('Use isRedirect instead')
|
||||
bool? androidIsRedirect,
|
||||
bool? hasGesture,
|
||||
bool? isRedirect,
|
||||
@Deprecated('Use navigationType instead')
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
TestClass3_? iosWKNavigationType,
|
||||
TestClass3_? navigationType}) : super(
|
||||
isForMainFrame: isForMainFrame,
|
||||
hasGesture: hasGesture,
|
||||
isRedirect: isRedirect,
|
||||
navigationType: navigationType
|
||||
);
|
||||
}
|
||||
|
||||
///An object that contains information about an action that causes navigation to occur.
|
||||
@ExchangeableObject()
|
||||
class NavigationAction_ {
|
||||
///Indicates whether the request was made for the main frame.
|
||||
///
|
||||
///**NOTE for Android**: If the request is associated to the [WebView.onCreateWindow] event, this is always `true`.
|
||||
///Also, on Android < 21, this is always `true`.
|
||||
bool isForMainFrame;
|
||||
|
||||
///Use [hasGesture] instead.
|
||||
@Deprecated('Use hasGesture instead')
|
||||
bool? androidHasGesture;
|
||||
|
||||
///Gets whether a gesture (such as a click) was associated with the request.
|
||||
///For security reasons in certain situations this method may return `false` even though
|
||||
///the sequence of events which caused the request to be created was initiated by a user
|
||||
///gesture.
|
||||
@SupportedPlatforms(
|
||||
platforms: [
|
||||
AndroidPlatform(
|
||||
available: "21",
|
||||
apiName: "WebResourceRequest.hasGesture",
|
||||
apiUrl: "https://developer.android.com/reference/android/webkit/WebResourceRequest#hasGesture()",
|
||||
note: "On Android < 21, this is always `false`"
|
||||
)
|
||||
]
|
||||
)
|
||||
bool? hasGesture;
|
||||
|
||||
///Use [isRedirect] instead.
|
||||
@Deprecated('Use isRedirect instead')
|
||||
bool? androidIsRedirect;
|
||||
|
||||
///Gets whether the request was a result of a server-side redirect.
|
||||
///
|
||||
///**NOTE**: If the request is associated to the [WebView.onCreateWindow] event, this is always `false`.
|
||||
///Also, on Android < 21, this is always `false`.
|
||||
@SupportedPlatforms(
|
||||
platforms: [
|
||||
AndroidPlatform(
|
||||
available: "21",
|
||||
apiName: "WebResourceRequest.isRedirect",
|
||||
apiUrl: "https://developer.android.com/reference/android/webkit/WebResourceRequest#isRedirect()"
|
||||
)
|
||||
]
|
||||
)
|
||||
bool? isRedirect;
|
||||
|
||||
///Use [navigationType] instead.
|
||||
@Deprecated("Use navigationType instead")
|
||||
TestClass3_? iosWKNavigationType;
|
||||
|
||||
///The type of action triggering the navigation.
|
||||
///
|
||||
///**NOTE**: available only on iOS.
|
||||
TestClass3_? navigationType;
|
||||
|
||||
///A value indicating whether the web content used a download attribute to indicate that this should be downloaded.
|
||||
///
|
||||
///**NOTE**: available only on iOS.
|
||||
bool? shouldPerformDownload;
|
||||
|
||||
NavigationAction_(
|
||||
{required this.isForMainFrame,
|
||||
@Deprecated('Use hasGesture instead') this.androidHasGesture,
|
||||
this.hasGesture,
|
||||
@Deprecated('Use isRedirect instead') this.androidIsRedirect,
|
||||
this.isRedirect,
|
||||
@Deprecated("Use navigationType instead") this.iosWKNavigationType,
|
||||
this.navigationType,
|
||||
this.shouldPerformDownload});
|
||||
}
|
||||
|
||||
class Util {
|
||||
|
@ -57,7 +57,6 @@ extension URLProtectionSpace {
|
||||
"authenticationMethod": authenticationMethod,
|
||||
"distinguishedNames": distinguishedNames,
|
||||
"receivesCredentialSecurely": receivesCredentialSecurely,
|
||||
"isProxy": isProxy(),
|
||||
"proxyType": proxyType
|
||||
]
|
||||
}
|
||||
|
@ -1,11 +1,15 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
|
||||
|
||||
import '../in_app_webview/webview.dart';
|
||||
|
||||
import 'client_cert_response_action.dart';
|
||||
|
||||
part 'client_cert_response.g.dart';
|
||||
|
||||
///Class that represents the response used by the [WebView.onReceivedClientCertRequest] event.
|
||||
class ClientCertResponse {
|
||||
@ExchangeableObject()
|
||||
class ClientCertResponse_ {
|
||||
///The file path of the certificate to use.
|
||||
String certificatePath;
|
||||
|
||||
@ -17,48 +21,28 @@ class ClientCertResponse {
|
||||
String? androidKeyStoreType;
|
||||
|
||||
///An Android-specific property used by Java [KeyStore](https://developer.android.com/reference/java/security/KeyStore) class to get the instance.
|
||||
@SupportedPlatforms(platforms: [
|
||||
AndroidPlatform()
|
||||
])
|
||||
String? keyStoreType;
|
||||
|
||||
///Indicate the [ClientCertResponseAction] to take in response of the client certificate challenge.
|
||||
ClientCertResponseAction? action;
|
||||
ClientCertResponseAction_? action;
|
||||
|
||||
ClientCertResponse(
|
||||
@ExchangeableObjectConstructor()
|
||||
ClientCertResponse_(
|
||||
{required this.certificatePath,
|
||||
this.certificatePassword = "",
|
||||
@Deprecated('Use keyStoreType instead')
|
||||
this.androidKeyStoreType = "PKCS12",
|
||||
this.keyStoreType = "PKCS12",
|
||||
this.action = ClientCertResponseAction.CANCEL}) {
|
||||
if (this.action == ClientCertResponseAction.PROCEED)
|
||||
this.action = ClientCertResponseAction_.CANCEL}) {
|
||||
if (this.action == ClientCertResponseAction_.PROCEED)
|
||||
assert(certificatePath.isNotEmpty);
|
||||
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.keyStoreType = this.keyStoreType ?? this.androidKeyStoreType;
|
||||
|
||||
if (!kIsWeb && defaultTargetPlatform == TargetPlatform.android)
|
||||
assert(this.keyStoreType != null);
|
||||
}
|
||||
|
||||
///Converts instance to a map.
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"certificatePath": certificatePath,
|
||||
"certificatePassword": certificatePassword,
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"androidKeyStoreType": keyStoreType ?? androidKeyStoreType,
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"keyStoreType": keyStoreType ?? androidKeyStoreType,
|
||||
"action": action?.toValue()
|
||||
};
|
||||
}
|
||||
|
||||
///Converts instance to a map.
|
||||
Map<String, dynamic> toJson() {
|
||||
return this.toMap();
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toMap().toString();
|
||||
}
|
||||
}
|
77
lib/src/types/client_cert_response.g.dart
Normal file
77
lib/src/types/client_cert_response.g.dart
Normal file
@ -0,0 +1,77 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'client_cert_response.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// ExchangeableObjectGenerator
|
||||
// **************************************************************************
|
||||
|
||||
///Class that represents the response used by the [WebView.onReceivedClientCertRequest] event.
|
||||
class ClientCertResponse {
|
||||
///The file path of the certificate to use.
|
||||
String certificatePath;
|
||||
|
||||
///The certificate password.
|
||||
String? certificatePassword;
|
||||
|
||||
///Use [keyStoreType] instead.
|
||||
@Deprecated('Use keyStoreType instead')
|
||||
String? androidKeyStoreType;
|
||||
|
||||
///An Android-specific property used by Java [KeyStore](https://developer.android.com/reference/java/security/KeyStore) class to get the instance.
|
||||
///
|
||||
///**Supported Platforms/Implementations**:
|
||||
///- Android native WebView
|
||||
String? keyStoreType;
|
||||
|
||||
///Indicate the [ClientCertResponseAction] to take in response of the client certificate challenge.
|
||||
ClientCertResponseAction? action;
|
||||
ClientCertResponse(
|
||||
{required this.certificatePath,
|
||||
this.certificatePassword = "",
|
||||
@Deprecated('Use keyStoreType instead')
|
||||
this.androidKeyStoreType = "PKCS12",
|
||||
this.keyStoreType = "PKCS12",
|
||||
this.action = ClientCertResponseAction.CANCEL}) {
|
||||
if (this.action == ClientCertResponseAction.PROCEED)
|
||||
assert(certificatePath.isNotEmpty);
|
||||
this.keyStoreType = this.keyStoreType ?? this.androidKeyStoreType;
|
||||
if (!kIsWeb && defaultTargetPlatform == TargetPlatform.android)
|
||||
assert(this.keyStoreType != null);
|
||||
}
|
||||
|
||||
///Gets a possible [ClientCertResponse] instance from a [Map] value.
|
||||
static ClientCertResponse? fromMap(Map<String, dynamic>? map) {
|
||||
if (map == null) {
|
||||
return null;
|
||||
}
|
||||
final instance = ClientCertResponse(
|
||||
certificatePath: map['certificatePath'],
|
||||
);
|
||||
instance.certificatePassword = map['certificatePassword'];
|
||||
instance.androidKeyStoreType = map['keyStoreType'];
|
||||
instance.keyStoreType = map['keyStoreType'];
|
||||
instance.action = ClientCertResponseAction.fromNativeValue(map['action']);
|
||||
return instance;
|
||||
}
|
||||
|
||||
///Converts instance to a map.
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"certificatePath": certificatePath,
|
||||
"certificatePassword": certificatePassword,
|
||||
"keyStoreType": keyStoreType,
|
||||
"action": action?.toNativeValue(),
|
||||
};
|
||||
}
|
||||
|
||||
///Converts instance to a map.
|
||||
Map<String, dynamic> toJson() {
|
||||
return toMap();
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ClientCertResponse{certificatePath: $certificatePath, certificatePassword: $certificatePassword, keyStoreType: $keyStoreType, action: $action}';
|
||||
}
|
||||
}
|
@ -1,25 +1,22 @@
|
||||
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
|
||||
|
||||
import 'client_cert_response.dart';
|
||||
|
||||
part 'client_cert_response_action.g.dart';
|
||||
|
||||
///Class used by [ClientCertResponse] class.
|
||||
class ClientCertResponseAction {
|
||||
@ExchangeableEnum()
|
||||
class ClientCertResponseAction_ {
|
||||
// ignore: unused_field
|
||||
final int _value;
|
||||
|
||||
const ClientCertResponseAction._internal(this._value);
|
||||
|
||||
///Gets [int] value.
|
||||
int toValue() => _value;
|
||||
const ClientCertResponseAction_._internal(this._value);
|
||||
|
||||
///Cancel this request.
|
||||
static const CANCEL = const ClientCertResponseAction._internal(0);
|
||||
static const CANCEL = const ClientCertResponseAction_._internal(0);
|
||||
|
||||
///Proceed with the specified certificate.
|
||||
static const PROCEED = const ClientCertResponseAction._internal(1);
|
||||
static const PROCEED = const ClientCertResponseAction_._internal(1);
|
||||
|
||||
///Ignore the request for now.
|
||||
static const IGNORE = const ClientCertResponseAction._internal(2);
|
||||
|
||||
bool operator ==(value) => value == _value;
|
||||
|
||||
@override
|
||||
int get hashCode => _value.hashCode;
|
||||
static const IGNORE = const ClientCertResponseAction_._internal(2);
|
||||
}
|
85
lib/src/types/client_cert_response_action.g.dart
Normal file
85
lib/src/types/client_cert_response_action.g.dart
Normal file
@ -0,0 +1,85 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'client_cert_response_action.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// ExchangeableEnumGenerator
|
||||
// **************************************************************************
|
||||
|
||||
///Class used by [ClientCertResponse] class.
|
||||
class ClientCertResponseAction {
|
||||
final int _value;
|
||||
final int _nativeValue;
|
||||
const ClientCertResponseAction._internal(this._value, this._nativeValue);
|
||||
// ignore: unused_element
|
||||
factory ClientCertResponseAction._internalMultiPlatform(
|
||||
int value, Function nativeValue) =>
|
||||
ClientCertResponseAction._internal(value, nativeValue());
|
||||
|
||||
///Cancel this request.
|
||||
static const CANCEL = ClientCertResponseAction._internal(0, 0);
|
||||
|
||||
///Proceed with the specified certificate.
|
||||
static const PROCEED = ClientCertResponseAction._internal(1, 1);
|
||||
|
||||
///Ignore the request for now.
|
||||
static const IGNORE = ClientCertResponseAction._internal(2, 2);
|
||||
|
||||
///Set of all values of [ClientCertResponseAction].
|
||||
static final Set<ClientCertResponseAction> values = [
|
||||
ClientCertResponseAction.CANCEL,
|
||||
ClientCertResponseAction.PROCEED,
|
||||
ClientCertResponseAction.IGNORE,
|
||||
].toSet();
|
||||
|
||||
///Gets a possible [ClientCertResponseAction] instance from [int] value.
|
||||
static ClientCertResponseAction? fromValue(int? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return ClientCertResponseAction.values
|
||||
.firstWhere((element) => element.toValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets a possible [ClientCertResponseAction] instance from a native value.
|
||||
static ClientCertResponseAction? fromNativeValue(int? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return ClientCertResponseAction.values
|
||||
.firstWhere((element) => element.toNativeValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets [int] value.
|
||||
int toValue() => _value;
|
||||
|
||||
///Gets [int] native value.
|
||||
int toNativeValue() => _nativeValue;
|
||||
|
||||
@override
|
||||
int get hashCode => _value.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(value) => value == _value;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
switch (_value) {
|
||||
case 0:
|
||||
return 'CANCEL';
|
||||
case 1:
|
||||
return 'PROCEED';
|
||||
case 2:
|
||||
return 'IGNORE';
|
||||
}
|
||||
return _value.toString();
|
||||
}
|
||||
}
|
@ -1,52 +1,29 @@
|
||||
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
|
||||
|
||||
part 'compress_format.g.dart';
|
||||
|
||||
///Class that represents the known formats a bitmap can be compressed into.
|
||||
class CompressFormat {
|
||||
@ExchangeableEnum()
|
||||
class CompressFormat_ {
|
||||
// ignore: unused_field
|
||||
final String _value;
|
||||
|
||||
const CompressFormat._internal(this._value);
|
||||
|
||||
///Set of all values of [CompressFormat].
|
||||
static final Set<CompressFormat> values = [
|
||||
CompressFormat.JPEG,
|
||||
CompressFormat.PNG,
|
||||
CompressFormat.WEBP,
|
||||
CompressFormat.WEBP_LOSSY,
|
||||
CompressFormat.WEBP_LOSSLESS,
|
||||
].toSet();
|
||||
|
||||
///Gets a possible [CompressFormat] instance from a [String] value.
|
||||
static CompressFormat? fromValue(String? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return CompressFormat.values
|
||||
.firstWhere((element) => element.toValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets [String] value.
|
||||
String toValue() => _value;
|
||||
|
||||
@override
|
||||
String toString() => _value;
|
||||
const CompressFormat_._internal(this._value);
|
||||
|
||||
///Compress to the `PNG` format.
|
||||
///PNG is lossless, so `quality` is ignored.
|
||||
static const PNG = const CompressFormat._internal("PNG");
|
||||
static const PNG = const CompressFormat_._internal("PNG");
|
||||
|
||||
///Compress to the `JPEG` format.
|
||||
///Quality of `0` means compress for the smallest size.
|
||||
///`100` means compress for max visual quality.
|
||||
static const JPEG = const CompressFormat._internal("JPEG");
|
||||
static const JPEG = const CompressFormat_._internal("JPEG");
|
||||
|
||||
///Compress to the `WEBP` lossy format.
|
||||
///Quality of `0` means compress for the smallest size.
|
||||
///`100` means compress for max visual quality.
|
||||
///
|
||||
///**NOTE**: available only on Android.
|
||||
static const WEBP = const CompressFormat._internal("WEBP");
|
||||
static const WEBP = const CompressFormat_._internal("WEBP");
|
||||
|
||||
///Compress to the `WEBP` lossy format.
|
||||
///Quality of `0` means compress for the smallest size.
|
||||
@ -55,7 +32,7 @@ class CompressFormat {
|
||||
///**NOTE**: available only on Android.
|
||||
///
|
||||
///**NOTE for Android**: available on Android 30+.
|
||||
static const WEBP_LOSSY = const CompressFormat._internal("WEBP_LOSSY");
|
||||
static const WEBP_LOSSY = const CompressFormat_._internal("WEBP_LOSSY");
|
||||
|
||||
///Compress to the `WEBP` lossless format.
|
||||
///Quality refers to how much effort to put into compression.
|
||||
@ -65,10 +42,5 @@ class CompressFormat {
|
||||
///**NOTE**: available only on Android.
|
||||
///
|
||||
///**NOTE for Android**: available on Android 30+.
|
||||
static const WEBP_LOSSLESS = const CompressFormat._internal("WEBP_LOSSLESS");
|
||||
|
||||
bool operator ==(value) => value == _value;
|
||||
|
||||
@override
|
||||
int get hashCode => _value.hashCode;
|
||||
static const WEBP_LOSSLESS = const CompressFormat_._internal("WEBP_LOSSLESS");
|
||||
}
|
107
lib/src/types/compress_format.g.dart
Normal file
107
lib/src/types/compress_format.g.dart
Normal file
@ -0,0 +1,107 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'compress_format.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// ExchangeableEnumGenerator
|
||||
// **************************************************************************
|
||||
|
||||
///Class that represents the known formats a bitmap can be compressed into.
|
||||
class CompressFormat {
|
||||
final String _value;
|
||||
final String _nativeValue;
|
||||
const CompressFormat._internal(this._value, this._nativeValue);
|
||||
// ignore: unused_element
|
||||
factory CompressFormat._internalMultiPlatform(
|
||||
String value, Function nativeValue) =>
|
||||
CompressFormat._internal(value, nativeValue());
|
||||
|
||||
///Compress to the `PNG` format.
|
||||
///PNG is lossless, so `quality` is ignored.
|
||||
static const PNG = CompressFormat._internal('PNG', 'PNG');
|
||||
|
||||
///Compress to the `JPEG` format.
|
||||
///Quality of `0` means compress for the smallest size.
|
||||
///`100` means compress for max visual quality.
|
||||
static const JPEG = CompressFormat._internal('JPEG', 'JPEG');
|
||||
|
||||
///Compress to the `WEBP` lossy format.
|
||||
///Quality of `0` means compress for the smallest size.
|
||||
///`100` means compress for max visual quality.
|
||||
///
|
||||
///**NOTE**: available only on Android.
|
||||
static const WEBP = CompressFormat._internal('WEBP', 'WEBP');
|
||||
|
||||
///Compress to the `WEBP` lossy format.
|
||||
///Quality of `0` means compress for the smallest size.
|
||||
///`100` means compress for max visual quality.
|
||||
///
|
||||
///**NOTE**: available only on Android.
|
||||
///
|
||||
///**NOTE for Android**: available on Android 30+.
|
||||
static const WEBP_LOSSY =
|
||||
CompressFormat._internal('WEBP_LOSSY', 'WEBP_LOSSY');
|
||||
|
||||
///Compress to the `WEBP` lossless format.
|
||||
///Quality refers to how much effort to put into compression.
|
||||
///A value of `0` means to compress quickly, resulting in a relatively large file size.
|
||||
///`100` means to spend more time compressing, resulting in a smaller file.
|
||||
///
|
||||
///**NOTE**: available only on Android.
|
||||
///
|
||||
///**NOTE for Android**: available on Android 30+.
|
||||
static const WEBP_LOSSLESS =
|
||||
CompressFormat._internal('WEBP_LOSSLESS', 'WEBP_LOSSLESS');
|
||||
|
||||
///Set of all values of [CompressFormat].
|
||||
static final Set<CompressFormat> values = [
|
||||
CompressFormat.PNG,
|
||||
CompressFormat.JPEG,
|
||||
CompressFormat.WEBP,
|
||||
CompressFormat.WEBP_LOSSY,
|
||||
CompressFormat.WEBP_LOSSLESS,
|
||||
].toSet();
|
||||
|
||||
///Gets a possible [CompressFormat] instance from [String] value.
|
||||
static CompressFormat? fromValue(String? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return CompressFormat.values
|
||||
.firstWhere((element) => element.toValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets a possible [CompressFormat] instance from a native value.
|
||||
static CompressFormat? fromNativeValue(String? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return CompressFormat.values
|
||||
.firstWhere((element) => element.toNativeValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets [String] value.
|
||||
String toValue() => _value;
|
||||
|
||||
///Gets [String] native value.
|
||||
String toNativeValue() => _nativeValue;
|
||||
|
||||
@override
|
||||
int get hashCode => _value.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(value) => value == _value;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return _value;
|
||||
}
|
||||
}
|
@ -1,45 +1,23 @@
|
||||
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
|
||||
|
||||
import '../in_app_webview/webview.dart';
|
||||
|
||||
import 'console_message_level.dart';
|
||||
|
||||
part 'console_message.g.dart';
|
||||
|
||||
///Class representing a JavaScript console message from WebCore.
|
||||
///This could be a issued by a call to one of the console logging functions (e.g. console.log('...')) or a JavaScript error on the page.
|
||||
///
|
||||
///To receive notifications of these messages, use the [WebView.onConsoleMessage] event.
|
||||
class ConsoleMessage {
|
||||
@ExchangeableObject()
|
||||
class ConsoleMessage_ {
|
||||
///Console message
|
||||
String message;
|
||||
|
||||
///Console messsage level
|
||||
ConsoleMessageLevel messageLevel;
|
||||
ConsoleMessageLevel_ messageLevel;
|
||||
|
||||
ConsoleMessage(
|
||||
{this.message = "", this.messageLevel = ConsoleMessageLevel.LOG});
|
||||
|
||||
///Gets a possible [ConsoleMessage] instance from a [Map] value.
|
||||
static ConsoleMessage? fromMap(Map<String, dynamic>? map) {
|
||||
if (map == null) {
|
||||
return null;
|
||||
}
|
||||
return ConsoleMessage(
|
||||
message: map["message"],
|
||||
messageLevel: ConsoleMessageLevel.fromValue(map["messageLevel"]) ??
|
||||
ConsoleMessageLevel.LOG,
|
||||
);
|
||||
}
|
||||
|
||||
///Converts instance to a map.
|
||||
Map<String, dynamic> toMap() {
|
||||
return {"message": message, "messageLevel": messageLevel.toValue()};
|
||||
}
|
||||
|
||||
///Converts instance to a map.
|
||||
Map<String, dynamic> toJson() {
|
||||
return this.toMap();
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toMap().toString();
|
||||
}
|
||||
ConsoleMessage_(
|
||||
{this.message = "", this.messageLevel = ConsoleMessageLevel_.LOG});
|
||||
}
|
51
lib/src/types/console_message.g.dart
Normal file
51
lib/src/types/console_message.g.dart
Normal file
@ -0,0 +1,51 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'console_message.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// ExchangeableObjectGenerator
|
||||
// **************************************************************************
|
||||
|
||||
///Class representing a JavaScript console message from WebCore.
|
||||
///This could be a issued by a call to one of the console logging functions (e.g. console.log('...')) or a JavaScript error on the page.
|
||||
///
|
||||
///To receive notifications of these messages, use the [WebView.onConsoleMessage] event.
|
||||
class ConsoleMessage {
|
||||
///Console message
|
||||
String message;
|
||||
|
||||
///Console messsage level
|
||||
ConsoleMessageLevel messageLevel;
|
||||
ConsoleMessage(
|
||||
{this.message = "", this.messageLevel = ConsoleMessageLevel.LOG});
|
||||
|
||||
///Gets a possible [ConsoleMessage] instance from a [Map] value.
|
||||
static ConsoleMessage? fromMap(Map<String, dynamic>? map) {
|
||||
if (map == null) {
|
||||
return null;
|
||||
}
|
||||
final instance = ConsoleMessage();
|
||||
instance.message = map['message'];
|
||||
instance.messageLevel =
|
||||
ConsoleMessageLevel.fromNativeValue(map['messageLevel'])!;
|
||||
return instance;
|
||||
}
|
||||
|
||||
///Converts instance to a map.
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"message": message,
|
||||
"messageLevel": messageLevel.toNativeValue(),
|
||||
};
|
||||
}
|
||||
|
||||
///Converts instance to a map.
|
||||
Map<String, dynamic> toJson() {
|
||||
return toMap();
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ConsoleMessage{message: $message, messageLevel: $messageLevel}';
|
||||
}
|
||||
}
|
@ -1,68 +1,26 @@
|
||||
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
|
||||
|
||||
part 'console_message_level.g.dart';
|
||||
|
||||
///Class representing the level of a console message.
|
||||
class ConsoleMessageLevel {
|
||||
@ExchangeableEnum()
|
||||
class ConsoleMessageLevel_ {
|
||||
// ignore: unused_field
|
||||
final int _value;
|
||||
|
||||
const ConsoleMessageLevel._internal(this._value);
|
||||
|
||||
///Set of all values of [ConsoleMessageLevel].
|
||||
static final Set<ConsoleMessageLevel> values = [
|
||||
ConsoleMessageLevel.TIP,
|
||||
ConsoleMessageLevel.LOG,
|
||||
ConsoleMessageLevel.WARNING,
|
||||
ConsoleMessageLevel.ERROR,
|
||||
ConsoleMessageLevel.DEBUG,
|
||||
].toSet();
|
||||
|
||||
///Gets a possible [ConsoleMessageLevel] instance from an [int] value.
|
||||
static ConsoleMessageLevel? fromValue(int? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return ConsoleMessageLevel.values
|
||||
.firstWhere((element) => element.toValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets [int] value.
|
||||
int toValue() => _value;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
switch (_value) {
|
||||
case 0:
|
||||
return "TIP";
|
||||
case 2:
|
||||
return "WARNING";
|
||||
case 3:
|
||||
return "ERROR";
|
||||
case 4:
|
||||
return "DEBUG";
|
||||
case 1:
|
||||
default:
|
||||
return "LOG";
|
||||
}
|
||||
}
|
||||
const ConsoleMessageLevel_._internal(this._value);
|
||||
|
||||
///Console TIP level
|
||||
static const TIP = const ConsoleMessageLevel._internal(0);
|
||||
static const TIP = const ConsoleMessageLevel_._internal(0);
|
||||
|
||||
///Console LOG level
|
||||
static const LOG = const ConsoleMessageLevel._internal(1);
|
||||
static const LOG = const ConsoleMessageLevel_._internal(1);
|
||||
|
||||
///Console WARNING level
|
||||
static const WARNING = const ConsoleMessageLevel._internal(2);
|
||||
static const WARNING = const ConsoleMessageLevel_._internal(2);
|
||||
|
||||
///Console ERROR level
|
||||
static const ERROR = const ConsoleMessageLevel._internal(3);
|
||||
static const ERROR = const ConsoleMessageLevel_._internal(3);
|
||||
|
||||
///Console DEBUG level
|
||||
static const DEBUG = const ConsoleMessageLevel._internal(4);
|
||||
|
||||
bool operator ==(value) => value == _value;
|
||||
|
||||
@override
|
||||
int get hashCode => _value.hashCode;
|
||||
static const DEBUG = const ConsoleMessageLevel_._internal(4);
|
||||
}
|
97
lib/src/types/console_message_level.g.dart
Normal file
97
lib/src/types/console_message_level.g.dart
Normal file
@ -0,0 +1,97 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'console_message_level.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// ExchangeableEnumGenerator
|
||||
// **************************************************************************
|
||||
|
||||
///Class representing the level of a console message.
|
||||
class ConsoleMessageLevel {
|
||||
final int _value;
|
||||
final int _nativeValue;
|
||||
const ConsoleMessageLevel._internal(this._value, this._nativeValue);
|
||||
// ignore: unused_element
|
||||
factory ConsoleMessageLevel._internalMultiPlatform(
|
||||
int value, Function nativeValue) =>
|
||||
ConsoleMessageLevel._internal(value, nativeValue());
|
||||
|
||||
///Console TIP level
|
||||
static const TIP = ConsoleMessageLevel._internal(0, 0);
|
||||
|
||||
///Console LOG level
|
||||
static const LOG = ConsoleMessageLevel._internal(1, 1);
|
||||
|
||||
///Console WARNING level
|
||||
static const WARNING = ConsoleMessageLevel._internal(2, 2);
|
||||
|
||||
///Console ERROR level
|
||||
static const ERROR = ConsoleMessageLevel._internal(3, 3);
|
||||
|
||||
///Console DEBUG level
|
||||
static const DEBUG = ConsoleMessageLevel._internal(4, 4);
|
||||
|
||||
///Set of all values of [ConsoleMessageLevel].
|
||||
static final Set<ConsoleMessageLevel> values = [
|
||||
ConsoleMessageLevel.TIP,
|
||||
ConsoleMessageLevel.LOG,
|
||||
ConsoleMessageLevel.WARNING,
|
||||
ConsoleMessageLevel.ERROR,
|
||||
ConsoleMessageLevel.DEBUG,
|
||||
].toSet();
|
||||
|
||||
///Gets a possible [ConsoleMessageLevel] instance from [int] value.
|
||||
static ConsoleMessageLevel? fromValue(int? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return ConsoleMessageLevel.values
|
||||
.firstWhere((element) => element.toValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets a possible [ConsoleMessageLevel] instance from a native value.
|
||||
static ConsoleMessageLevel? fromNativeValue(int? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return ConsoleMessageLevel.values
|
||||
.firstWhere((element) => element.toNativeValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets [int] value.
|
||||
int toValue() => _value;
|
||||
|
||||
///Gets [int] native value.
|
||||
int toNativeValue() => _nativeValue;
|
||||
|
||||
@override
|
||||
int get hashCode => _value.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(value) => value == _value;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
switch (_value) {
|
||||
case 0:
|
||||
return 'TIP';
|
||||
case 1:
|
||||
return 'LOG';
|
||||
case 2:
|
||||
return 'WARNING';
|
||||
case 3:
|
||||
return 'ERROR';
|
||||
case 4:
|
||||
return 'DEBUG';
|
||||
}
|
||||
return _value.toString();
|
||||
}
|
||||
}
|
@ -1,52 +1,26 @@
|
||||
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
|
||||
|
||||
import '../content_blocker.dart';
|
||||
|
||||
part 'content_blocker_action_type.g.dart';
|
||||
|
||||
///Class that represents the kind of action that can be used with a [ContentBlockerTrigger].
|
||||
class ContentBlockerActionType {
|
||||
@ExchangeableEnum()
|
||||
class ContentBlockerActionType_ {
|
||||
// ignore: unused_field
|
||||
final String _value;
|
||||
|
||||
const ContentBlockerActionType._internal(this._value);
|
||||
|
||||
///Set of all values of [ContentBlockerActionType].
|
||||
static final Set<ContentBlockerActionType> values = [
|
||||
ContentBlockerActionType.BLOCK,
|
||||
ContentBlockerActionType.CSS_DISPLAY_NONE,
|
||||
ContentBlockerActionType.MAKE_HTTPS,
|
||||
].toSet();
|
||||
|
||||
///Gets a possible [ContentBlockerActionType] instance from a [String] value.
|
||||
static ContentBlockerActionType? fromValue(String? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return ContentBlockerActionType.values
|
||||
.firstWhere((element) => element.toValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets [String] value.
|
||||
String toValue() => _value;
|
||||
|
||||
@override
|
||||
String toString() => _value;
|
||||
const ContentBlockerActionType_._internal(this._value);
|
||||
|
||||
///Stops loading of the resource. If the resource was cached, the cache is ignored.
|
||||
static const BLOCK = const ContentBlockerActionType._internal('block');
|
||||
static const BLOCK = const ContentBlockerActionType_._internal('block');
|
||||
|
||||
///Hides elements of the page based on a CSS selector. A selector field contains the selector list. Any matching element has its display property set to none, which hides it.
|
||||
///
|
||||
///**NOTE**: on Android, JavaScript must be enabled.
|
||||
static const CSS_DISPLAY_NONE =
|
||||
const ContentBlockerActionType._internal('css-display-none');
|
||||
const ContentBlockerActionType_._internal('css-display-none');
|
||||
|
||||
///Changes a URL from http to https. URLs with a specified (nondefault) port and links using other protocols are unaffected.
|
||||
static const MAKE_HTTPS =
|
||||
const ContentBlockerActionType._internal('make-https');
|
||||
|
||||
bool operator ==(value) => value == _value;
|
||||
|
||||
@override
|
||||
int get hashCode => _value.hashCode;
|
||||
const ContentBlockerActionType_._internal('make-https');
|
||||
}
|
81
lib/src/types/content_blocker_action_type.g.dart
Normal file
81
lib/src/types/content_blocker_action_type.g.dart
Normal file
@ -0,0 +1,81 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'content_blocker_action_type.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// ExchangeableEnumGenerator
|
||||
// **************************************************************************
|
||||
|
||||
///Class that represents the kind of action that can be used with a [ContentBlockerTrigger].
|
||||
class ContentBlockerActionType {
|
||||
final String _value;
|
||||
final String _nativeValue;
|
||||
const ContentBlockerActionType._internal(this._value, this._nativeValue);
|
||||
// ignore: unused_element
|
||||
factory ContentBlockerActionType._internalMultiPlatform(
|
||||
String value, Function nativeValue) =>
|
||||
ContentBlockerActionType._internal(value, nativeValue());
|
||||
|
||||
///Stops loading of the resource. If the resource was cached, the cache is ignored.
|
||||
static const BLOCK = ContentBlockerActionType._internal('block', 'block');
|
||||
|
||||
///Hides elements of the page based on a CSS selector. A selector field contains the selector list. Any matching element has its display property set to none, which hides it.
|
||||
///
|
||||
///**NOTE**: on Android, JavaScript must be enabled.
|
||||
static const CSS_DISPLAY_NONE = ContentBlockerActionType._internal(
|
||||
'css-display-none', 'css-display-none');
|
||||
|
||||
///Changes a URL from http to https. URLs with a specified (nondefault) port and links using other protocols are unaffected.
|
||||
static const MAKE_HTTPS =
|
||||
ContentBlockerActionType._internal('make-https', 'make-https');
|
||||
|
||||
///Set of all values of [ContentBlockerActionType].
|
||||
static final Set<ContentBlockerActionType> values = [
|
||||
ContentBlockerActionType.BLOCK,
|
||||
ContentBlockerActionType.CSS_DISPLAY_NONE,
|
||||
ContentBlockerActionType.MAKE_HTTPS,
|
||||
].toSet();
|
||||
|
||||
///Gets a possible [ContentBlockerActionType] instance from [String] value.
|
||||
static ContentBlockerActionType? fromValue(String? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return ContentBlockerActionType.values
|
||||
.firstWhere((element) => element.toValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets a possible [ContentBlockerActionType] instance from a native value.
|
||||
static ContentBlockerActionType? fromNativeValue(String? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return ContentBlockerActionType.values
|
||||
.firstWhere((element) => element.toNativeValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets [String] value.
|
||||
String toValue() => _value;
|
||||
|
||||
///Gets [String] native value.
|
||||
String toNativeValue() => _nativeValue;
|
||||
|
||||
@override
|
||||
int get hashCode => _value.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(value) => value == _value;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return _value;
|
||||
}
|
||||
}
|
@ -1,46 +1,21 @@
|
||||
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
|
||||
|
||||
import '../content_blocker.dart';
|
||||
|
||||
part 'content_blocker_trigger_load_type.g.dart';
|
||||
|
||||
///Class that represents the possible load type for a [ContentBlockerTrigger].
|
||||
class ContentBlockerTriggerLoadType {
|
||||
@ExchangeableEnum()
|
||||
class ContentBlockerTriggerLoadType_ {
|
||||
// ignore: unused_field
|
||||
final String _value;
|
||||
|
||||
const ContentBlockerTriggerLoadType._internal(this._value);
|
||||
|
||||
///Set of all values of [ContentBlockerTriggerLoadType].
|
||||
static final Set<ContentBlockerTriggerLoadType> values = [
|
||||
ContentBlockerTriggerLoadType.FIRST_PARTY,
|
||||
ContentBlockerTriggerLoadType.THIRD_PARTY,
|
||||
].toSet();
|
||||
|
||||
///Gets a possible [ContentBlockerTriggerLoadType] instance from a [String] value.
|
||||
static ContentBlockerTriggerLoadType? fromValue(String? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return ContentBlockerTriggerLoadType.values
|
||||
.firstWhere((element) => element.toValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets [String] value.
|
||||
String toValue() => _value;
|
||||
|
||||
@override
|
||||
String toString() => _value;
|
||||
const ContentBlockerTriggerLoadType_._internal(this._value);
|
||||
|
||||
///FIRST_PARTY is triggered only if the resource has the same scheme, domain, and port as the main page resource.
|
||||
static const FIRST_PARTY =
|
||||
const ContentBlockerTriggerLoadType._internal('first-party');
|
||||
const ContentBlockerTriggerLoadType_._internal('first-party');
|
||||
|
||||
///THIRD_PARTY is triggered if the resource is not from the same domain as the main page resource.
|
||||
static const THIRD_PARTY =
|
||||
const ContentBlockerTriggerLoadType._internal('third-party');
|
||||
|
||||
bool operator ==(value) => value == _value;
|
||||
|
||||
@override
|
||||
int get hashCode => _value.hashCode;
|
||||
const ContentBlockerTriggerLoadType_._internal('third-party');
|
||||
}
|
75
lib/src/types/content_blocker_trigger_load_type.g.dart
Normal file
75
lib/src/types/content_blocker_trigger_load_type.g.dart
Normal file
@ -0,0 +1,75 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'content_blocker_trigger_load_type.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// ExchangeableEnumGenerator
|
||||
// **************************************************************************
|
||||
|
||||
///Class that represents the possible load type for a [ContentBlockerTrigger].
|
||||
class ContentBlockerTriggerLoadType {
|
||||
final String _value;
|
||||
final String _nativeValue;
|
||||
const ContentBlockerTriggerLoadType._internal(this._value, this._nativeValue);
|
||||
// ignore: unused_element
|
||||
factory ContentBlockerTriggerLoadType._internalMultiPlatform(
|
||||
String value, Function nativeValue) =>
|
||||
ContentBlockerTriggerLoadType._internal(value, nativeValue());
|
||||
|
||||
///FIRST_PARTY is triggered only if the resource has the same scheme, domain, and port as the main page resource.
|
||||
static const FIRST_PARTY =
|
||||
ContentBlockerTriggerLoadType._internal('first-party', 'first-party');
|
||||
|
||||
///THIRD_PARTY is triggered if the resource is not from the same domain as the main page resource.
|
||||
static const THIRD_PARTY =
|
||||
ContentBlockerTriggerLoadType._internal('third-party', 'third-party');
|
||||
|
||||
///Set of all values of [ContentBlockerTriggerLoadType].
|
||||
static final Set<ContentBlockerTriggerLoadType> values = [
|
||||
ContentBlockerTriggerLoadType.FIRST_PARTY,
|
||||
ContentBlockerTriggerLoadType.THIRD_PARTY,
|
||||
].toSet();
|
||||
|
||||
///Gets a possible [ContentBlockerTriggerLoadType] instance from [String] value.
|
||||
static ContentBlockerTriggerLoadType? fromValue(String? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return ContentBlockerTriggerLoadType.values
|
||||
.firstWhere((element) => element.toValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets a possible [ContentBlockerTriggerLoadType] instance from a native value.
|
||||
static ContentBlockerTriggerLoadType? fromNativeValue(String? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return ContentBlockerTriggerLoadType.values
|
||||
.firstWhere((element) => element.toNativeValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets [String] value.
|
||||
String toValue() => _value;
|
||||
|
||||
///Gets [String] native value.
|
||||
String toNativeValue() => _nativeValue;
|
||||
|
||||
@override
|
||||
int get hashCode => _value.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(value) => value == _value;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return _value;
|
||||
}
|
||||
}
|
@ -1,61 +1,31 @@
|
||||
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
|
||||
|
||||
import '../content_blocker.dart';
|
||||
|
||||
part 'content_blocker_trigger_resource_type.g.dart';
|
||||
|
||||
///Class that represents the possible resource type defined for a [ContentBlockerTrigger].
|
||||
class ContentBlockerTriggerResourceType {
|
||||
@ExchangeableEnum()
|
||||
class ContentBlockerTriggerResourceType_ {
|
||||
// ignore: unused_field
|
||||
final String _value;
|
||||
|
||||
const ContentBlockerTriggerResourceType._internal(this._value);
|
||||
|
||||
///Set of all values of [ContentBlockerTriggerResourceType].
|
||||
static final Set<ContentBlockerTriggerResourceType> values = [
|
||||
ContentBlockerTriggerResourceType.DOCUMENT,
|
||||
ContentBlockerTriggerResourceType.IMAGE,
|
||||
ContentBlockerTriggerResourceType.STYLE_SHEET,
|
||||
ContentBlockerTriggerResourceType.SCRIPT,
|
||||
ContentBlockerTriggerResourceType.FONT,
|
||||
ContentBlockerTriggerResourceType.MEDIA,
|
||||
ContentBlockerTriggerResourceType.SVG_DOCUMENT,
|
||||
ContentBlockerTriggerResourceType.RAW,
|
||||
].toSet();
|
||||
|
||||
///Gets a possible [ContentBlockerTriggerResourceType] instance from a [String] value.
|
||||
static ContentBlockerTriggerResourceType? fromValue(String? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return ContentBlockerTriggerResourceType.values
|
||||
.firstWhere((element) => element.toValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets [String] value.
|
||||
String toValue() => _value;
|
||||
|
||||
@override
|
||||
String toString() => _value;
|
||||
const ContentBlockerTriggerResourceType_._internal(this._value);
|
||||
|
||||
static const DOCUMENT =
|
||||
const ContentBlockerTriggerResourceType._internal('document');
|
||||
const ContentBlockerTriggerResourceType_._internal('document');
|
||||
static const IMAGE =
|
||||
const ContentBlockerTriggerResourceType._internal('image');
|
||||
const ContentBlockerTriggerResourceType_._internal('image');
|
||||
static const STYLE_SHEET =
|
||||
const ContentBlockerTriggerResourceType._internal('style-sheet');
|
||||
const ContentBlockerTriggerResourceType_._internal('style-sheet');
|
||||
static const SCRIPT =
|
||||
const ContentBlockerTriggerResourceType._internal('script');
|
||||
static const FONT = const ContentBlockerTriggerResourceType._internal('font');
|
||||
const ContentBlockerTriggerResourceType_._internal('script');
|
||||
static const FONT =
|
||||
const ContentBlockerTriggerResourceType_._internal('font');
|
||||
static const MEDIA =
|
||||
const ContentBlockerTriggerResourceType._internal('media');
|
||||
const ContentBlockerTriggerResourceType_._internal('media');
|
||||
static const SVG_DOCUMENT =
|
||||
const ContentBlockerTriggerResourceType._internal('svg-document');
|
||||
const ContentBlockerTriggerResourceType_._internal('svg-document');
|
||||
|
||||
///Any untyped load
|
||||
static const RAW = const ContentBlockerTriggerResourceType._internal('raw');
|
||||
|
||||
bool operator ==(value) => value == _value;
|
||||
|
||||
@override
|
||||
int get hashCode => _value.hashCode;
|
||||
static const RAW = const ContentBlockerTriggerResourceType_._internal('raw');
|
||||
}
|
91
lib/src/types/content_blocker_trigger_resource_type.g.dart
Normal file
91
lib/src/types/content_blocker_trigger_resource_type.g.dart
Normal file
@ -0,0 +1,91 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'content_blocker_trigger_resource_type.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// ExchangeableEnumGenerator
|
||||
// **************************************************************************
|
||||
|
||||
///Class that represents the possible resource type defined for a [ContentBlockerTrigger].
|
||||
class ContentBlockerTriggerResourceType {
|
||||
final String _value;
|
||||
final String _nativeValue;
|
||||
const ContentBlockerTriggerResourceType._internal(
|
||||
this._value, this._nativeValue);
|
||||
// ignore: unused_element
|
||||
factory ContentBlockerTriggerResourceType._internalMultiPlatform(
|
||||
String value, Function nativeValue) =>
|
||||
ContentBlockerTriggerResourceType._internal(value, nativeValue());
|
||||
static const DOCUMENT =
|
||||
ContentBlockerTriggerResourceType._internal('document', 'document');
|
||||
static const IMAGE =
|
||||
ContentBlockerTriggerResourceType._internal('image', 'image');
|
||||
static const STYLE_SHEET =
|
||||
ContentBlockerTriggerResourceType._internal('style-sheet', 'style-sheet');
|
||||
static const SCRIPT =
|
||||
ContentBlockerTriggerResourceType._internal('script', 'script');
|
||||
static const FONT =
|
||||
ContentBlockerTriggerResourceType._internal('font', 'font');
|
||||
static const MEDIA =
|
||||
ContentBlockerTriggerResourceType._internal('media', 'media');
|
||||
static const SVG_DOCUMENT = ContentBlockerTriggerResourceType._internal(
|
||||
'svg-document', 'svg-document');
|
||||
|
||||
///Any untyped load
|
||||
static const RAW = ContentBlockerTriggerResourceType._internal('raw', 'raw');
|
||||
|
||||
///Set of all values of [ContentBlockerTriggerResourceType].
|
||||
static final Set<ContentBlockerTriggerResourceType> values = [
|
||||
ContentBlockerTriggerResourceType.DOCUMENT,
|
||||
ContentBlockerTriggerResourceType.IMAGE,
|
||||
ContentBlockerTriggerResourceType.STYLE_SHEET,
|
||||
ContentBlockerTriggerResourceType.SCRIPT,
|
||||
ContentBlockerTriggerResourceType.FONT,
|
||||
ContentBlockerTriggerResourceType.MEDIA,
|
||||
ContentBlockerTriggerResourceType.SVG_DOCUMENT,
|
||||
ContentBlockerTriggerResourceType.RAW,
|
||||
].toSet();
|
||||
|
||||
///Gets a possible [ContentBlockerTriggerResourceType] instance from [String] value.
|
||||
static ContentBlockerTriggerResourceType? fromValue(String? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return ContentBlockerTriggerResourceType.values
|
||||
.firstWhere((element) => element.toValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets a possible [ContentBlockerTriggerResourceType] instance from a native value.
|
||||
static ContentBlockerTriggerResourceType? fromNativeValue(String? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return ContentBlockerTriggerResourceType.values
|
||||
.firstWhere((element) => element.toNativeValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets [String] value.
|
||||
String toValue() => _value;
|
||||
|
||||
///Gets [String] native value.
|
||||
String toNativeValue() => _nativeValue;
|
||||
|
||||
@override
|
||||
int get hashCode => _value.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(value) => value == _value;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return _value;
|
||||
}
|
||||
}
|
@ -24,7 +24,6 @@ class ContentWorld {
|
||||
}
|
||||
|
||||
///The default world for clients.
|
||||
// ignore: non_constant_identifier_names
|
||||
static final ContentWorld DEFAULT_CLIENT =
|
||||
ContentWorld.world(name: "defaultClient");
|
||||
|
||||
@ -32,7 +31,6 @@ class ContentWorld {
|
||||
///This property contains the content world for scripts that the current webpage executes.
|
||||
///Be careful when manipulating variables in this content world.
|
||||
///If you modify a variable with the same name as one the webpage uses, you may unintentionally disrupt the normal operation of that page.
|
||||
// ignore: non_constant_identifier_names
|
||||
static final ContentWorld PAGE = ContentWorld.world(name: "page");
|
||||
|
||||
///Converts instance to a map.
|
||||
|
@ -1,8 +1,13 @@
|
||||
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
|
||||
|
||||
import '../cookie_manager.dart';
|
||||
import 'http_cookie_same_site_policy.dart';
|
||||
|
||||
part 'cookie.g.dart';
|
||||
|
||||
///Class that represents a cookie returned by the [CookieManager].
|
||||
class Cookie {
|
||||
@ExchangeableObject()
|
||||
class Cookie_ {
|
||||
///The cookie name.
|
||||
String name;
|
||||
|
||||
@ -27,7 +32,7 @@ class Cookie {
|
||||
///The cookie same site policy.
|
||||
///
|
||||
///**NOTE**: on Android it will be always `null`.
|
||||
HTTPCookieSameSitePolicy? sameSite;
|
||||
HTTPCookieSameSitePolicy_? sameSite;
|
||||
|
||||
///Indicates if the cookie is secure or not.
|
||||
///
|
||||
@ -44,7 +49,7 @@ class Cookie {
|
||||
///**NOTE**: on Android it will be always `null`.
|
||||
String? path;
|
||||
|
||||
Cookie(
|
||||
Cookie_(
|
||||
{required this.name,
|
||||
required this.value,
|
||||
this.expiresDate,
|
||||
@ -54,29 +59,4 @@ class Cookie {
|
||||
this.isSecure,
|
||||
this.isHttpOnly,
|
||||
this.path});
|
||||
|
||||
///Converts instance to a map.
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"name": name,
|
||||
"value": value,
|
||||
"expiresDate": expiresDate,
|
||||
"isSessionOnly": isSessionOnly,
|
||||
"domain": domain,
|
||||
"sameSite": sameSite?.toValue(),
|
||||
"isSecure": isSecure,
|
||||
"isHttpOnly": isHttpOnly,
|
||||
"path": path
|
||||
};
|
||||
}
|
||||
|
||||
///Converts instance to a map.
|
||||
Map<String, dynamic> toJson() {
|
||||
return this.toMap();
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toMap().toString();
|
||||
}
|
||||
}
|
106
lib/src/types/cookie.g.dart
Normal file
106
lib/src/types/cookie.g.dart
Normal file
@ -0,0 +1,106 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'cookie.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// ExchangeableObjectGenerator
|
||||
// **************************************************************************
|
||||
|
||||
///Class that represents a cookie returned by the [CookieManager].
|
||||
class Cookie {
|
||||
///The cookie name.
|
||||
String name;
|
||||
|
||||
///The cookie value.
|
||||
dynamic value;
|
||||
|
||||
///The cookie expiration date in milliseconds.
|
||||
///
|
||||
///**NOTE**: on Android it will be always `null`.
|
||||
int? expiresDate;
|
||||
|
||||
///Indicates if the cookie is a session only cookie.
|
||||
///
|
||||
///**NOTE**: on Android it will be always `null`.
|
||||
bool? isSessionOnly;
|
||||
|
||||
///The cookie domain.
|
||||
///
|
||||
///**NOTE**: on Android it will be always `null`.
|
||||
String? domain;
|
||||
|
||||
///The cookie same site policy.
|
||||
///
|
||||
///**NOTE**: on Android it will be always `null`.
|
||||
HTTPCookieSameSitePolicy? sameSite;
|
||||
|
||||
///Indicates if the cookie is secure or not.
|
||||
///
|
||||
///**NOTE**: on Android it will be always `null`.
|
||||
bool? isSecure;
|
||||
|
||||
///Indicates if the cookie is a http only cookie.
|
||||
///
|
||||
///**NOTE**: on Android it will be always `null`.
|
||||
bool? isHttpOnly;
|
||||
|
||||
///The cookie path.
|
||||
///
|
||||
///**NOTE**: on Android it will be always `null`.
|
||||
String? path;
|
||||
Cookie(
|
||||
{required this.name,
|
||||
this.value,
|
||||
this.expiresDate,
|
||||
this.isSessionOnly,
|
||||
this.domain,
|
||||
this.sameSite,
|
||||
this.isSecure,
|
||||
this.isHttpOnly,
|
||||
this.path});
|
||||
|
||||
///Gets a possible [Cookie] instance from a [Map] value.
|
||||
static Cookie? fromMap(Map<String, dynamic>? map) {
|
||||
if (map == null) {
|
||||
return null;
|
||||
}
|
||||
final instance = Cookie(
|
||||
name: map['name'],
|
||||
value: map['value'],
|
||||
);
|
||||
instance.expiresDate = map['expiresDate'];
|
||||
instance.isSessionOnly = map['isSessionOnly'];
|
||||
instance.domain = map['domain'];
|
||||
instance.sameSite =
|
||||
HTTPCookieSameSitePolicy.fromNativeValue(map['sameSite']);
|
||||
instance.isSecure = map['isSecure'];
|
||||
instance.isHttpOnly = map['isHttpOnly'];
|
||||
instance.path = map['path'];
|
||||
return instance;
|
||||
}
|
||||
|
||||
///Converts instance to a map.
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"name": name,
|
||||
"value": value,
|
||||
"expiresDate": expiresDate,
|
||||
"isSessionOnly": isSessionOnly,
|
||||
"domain": domain,
|
||||
"sameSite": sameSite?.toNativeValue(),
|
||||
"isSecure": isSecure,
|
||||
"isHttpOnly": isHttpOnly,
|
||||
"path": path,
|
||||
};
|
||||
}
|
||||
|
||||
///Converts instance to a map.
|
||||
Map<String, dynamic> toJson() {
|
||||
return toMap();
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Cookie{name: $name, value: $value, expiresDate: $expiresDate, isSessionOnly: $isSessionOnly, domain: $domain, sameSite: $sameSite, isSecure: $isSecure, isHttpOnly: $isHttpOnly, path: $path}';
|
||||
}
|
||||
}
|
@ -1,3 +1,5 @@
|
||||
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
|
||||
|
||||
import '../in_app_webview/webview.dart';
|
||||
import 'navigation_action.dart';
|
||||
import 'window_features.dart';
|
||||
@ -5,8 +7,11 @@ import 'url_request.dart';
|
||||
import 'frame_info.dart';
|
||||
import 'navigation_type.dart';
|
||||
|
||||
part 'create_window_action.g.dart';
|
||||
|
||||
///Class that represents the navigation request used by the [WebView.onCreateWindow] event.
|
||||
class CreateWindowAction extends NavigationAction {
|
||||
@ExchangeableObject()
|
||||
class CreateWindowAction_ extends NavigationAction_ {
|
||||
///The window id. Used by [WebView] to create a new WebView.
|
||||
int windowId;
|
||||
|
||||
@ -15,20 +20,29 @@ class CreateWindowAction extends NavigationAction {
|
||||
bool? androidIsDialog;
|
||||
|
||||
///Indicates if the new window should be a dialog, rather than a full-size window.
|
||||
///
|
||||
///**NOTE**: available only on Android.
|
||||
@SupportedPlatforms(
|
||||
platforms: [
|
||||
AndroidPlatform()
|
||||
]
|
||||
)
|
||||
bool? isDialog;
|
||||
|
||||
///Use [windowFeatures] instead.
|
||||
@Deprecated("Use windowFeatures instead")
|
||||
IOSWKWindowFeatures? iosWindowFeatures;
|
||||
IOSWKWindowFeatures_? iosWindowFeatures;
|
||||
|
||||
///Window features requested by the webpage.
|
||||
///
|
||||
///**NOTE**: available only on iOS.
|
||||
WindowFeatures? windowFeatures;
|
||||
@SupportedPlatforms(
|
||||
platforms: [
|
||||
IOSPlatform(
|
||||
apiName: "WKWindowFeatures",
|
||||
apiUrl: "https://developer.apple.com/documentation/webkit/wkwindowfeatures"
|
||||
)
|
||||
]
|
||||
)
|
||||
WindowFeatures_? windowFeatures;
|
||||
|
||||
CreateWindowAction(
|
||||
CreateWindowAction_(
|
||||
{required this.windowId,
|
||||
@Deprecated('Use isDialog instead')
|
||||
this.androidIsDialog,
|
||||
@ -36,7 +50,7 @@ class CreateWindowAction extends NavigationAction {
|
||||
@Deprecated('Use windowFeatures instead')
|
||||
this.iosWindowFeatures,
|
||||
this.windowFeatures,
|
||||
required URLRequest request,
|
||||
required URLRequest_ request,
|
||||
required bool isForMainFrame,
|
||||
@Deprecated('Use hasGesture instead')
|
||||
bool? androidHasGesture,
|
||||
@ -46,113 +60,27 @@ class CreateWindowAction extends NavigationAction {
|
||||
bool? isRedirect,
|
||||
@Deprecated('Use navigationType instead')
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
IOSWKNavigationType? iosWKNavigationType,
|
||||
NavigationType? navigationType,
|
||||
IOSWKNavigationType_? iosWKNavigationType,
|
||||
NavigationType_? navigationType,
|
||||
@Deprecated('Use sourceFrame instead')
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
IOSWKFrameInfo? iosSourceFrame,
|
||||
FrameInfo? sourceFrame,
|
||||
IOSWKFrameInfo_? iosSourceFrame,
|
||||
FrameInfo_? sourceFrame,
|
||||
@Deprecated('Use targetFrame instead')
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
IOSWKFrameInfo? iosTargetFrame,
|
||||
FrameInfo? targetFrame})
|
||||
IOSWKFrameInfo_? iosTargetFrame,
|
||||
FrameInfo_? targetFrame})
|
||||
: super(
|
||||
request: request,
|
||||
isForMainFrame: isForMainFrame,
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
androidHasGesture: hasGesture ?? androidHasGesture,
|
||||
hasGesture: hasGesture ?? androidHasGesture,
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
androidIsRedirect: isRedirect ?? androidIsRedirect,
|
||||
isRedirect: isRedirect ?? androidIsRedirect,
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
iosWKNavigationType:
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
IOSWKNavigationType.fromValue(navigationType?.toValue()) ??
|
||||
iosWKNavigationType,
|
||||
navigationType: navigationType ??
|
||||
NavigationType.fromValue(iosWKNavigationType?.toValue()),
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
iosSourceFrame:
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
IOSWKFrameInfo.fromMap(sourceFrame?.toMap()) ?? iosSourceFrame,
|
||||
sourceFrame:
|
||||
sourceFrame ?? FrameInfo.fromMap(iosSourceFrame?.toMap()),
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
iosTargetFrame:
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
IOSWKFrameInfo.fromMap(targetFrame?.toMap()) ?? iosTargetFrame,
|
||||
targetFrame:
|
||||
targetFrame ?? FrameInfo.fromMap(iosTargetFrame?.toMap())) {
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.isDialog = this.isDialog ?? this.androidIsDialog;
|
||||
this.windowFeatures = this.windowFeatures ??
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
WindowFeatures.fromMap(this.iosWindowFeatures?.toMap());
|
||||
}
|
||||
|
||||
///Gets a possible [CreateWindowAction] instance from a [Map] value.
|
||||
static CreateWindowAction? fromMap(Map<String, dynamic>? map) {
|
||||
if (map == null) {
|
||||
return null;
|
||||
}
|
||||
return CreateWindowAction(
|
||||
windowId: map["windowId"],
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
androidIsDialog: map["isDialog"] ?? map["androidIsDialog"],
|
||||
isDialog: map["isDialog"] ?? map["androidIsDialog"],
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
iosWindowFeatures: IOSWKWindowFeatures.fromMap(
|
||||
map["windowFeatures"]?.cast<String, dynamic>()),
|
||||
windowFeatures: WindowFeatures.fromMap(
|
||||
map["windowFeatures"]?.cast<String, dynamic>()),
|
||||
request: URLRequest.fromMap(map["request"].cast<String, dynamic>())!,
|
||||
isForMainFrame: map["isForMainFrame"],
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
androidHasGesture: map["hasGesture"],
|
||||
hasGesture: map["hasGesture"],
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
androidIsRedirect: map["isRedirect"],
|
||||
isRedirect: map["isRedirect"],
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
iosWKNavigationType:
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
IOSWKNavigationType.fromValue(map["navigationType"]),
|
||||
navigationType: NavigationType.fromValue(map["navigationType"]),
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
iosSourceFrame:
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
IOSWKFrameInfo.fromMap(map["sourceFrame"]?.cast<String, dynamic>()),
|
||||
sourceFrame:
|
||||
FrameInfo.fromMap(map["sourceFrame"]?.cast<String, dynamic>()),
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
iosTargetFrame:
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
IOSWKFrameInfo.fromMap(map["targetFrame"]?.cast<String, dynamic>()),
|
||||
targetFrame:
|
||||
FrameInfo.fromMap(map["targetFrame"]?.cast<String, dynamic>()));
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
var createWindowActionMap = super.toMap();
|
||||
createWindowActionMap.addAll({
|
||||
"windowId": windowId,
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"androidIsDialog": isDialog ?? androidIsDialog,
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"isDialog": isDialog ?? androidIsDialog,
|
||||
"iosWindowFeatures":
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
windowFeatures?.toMap() ?? iosWindowFeatures?.toMap(),
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"windowFeatures": windowFeatures?.toMap() ?? iosWindowFeatures?.toMap(),
|
||||
});
|
||||
return createWindowActionMap;
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toMap().toString();
|
||||
}
|
||||
androidHasGesture: androidHasGesture,
|
||||
hasGesture: hasGesture,
|
||||
androidIsRedirect: androidIsRedirect,
|
||||
isRedirect: isRedirect,
|
||||
iosWKNavigationType: iosWKNavigationType,
|
||||
navigationType: navigationType,
|
||||
iosSourceFrame: iosSourceFrame,
|
||||
sourceFrame: sourceFrame,
|
||||
iosTargetFrame: iosTargetFrame,
|
||||
targetFrame: targetFrame);
|
||||
}
|
140
lib/src/types/create_window_action.g.dart
Normal file
140
lib/src/types/create_window_action.g.dart
Normal file
@ -0,0 +1,140 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'create_window_action.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// ExchangeableObjectGenerator
|
||||
// **************************************************************************
|
||||
|
||||
///Class that represents the navigation request used by the [WebView.onCreateWindow] event.
|
||||
class CreateWindowAction extends NavigationAction {
|
||||
///The window id. Used by [WebView] to create a new WebView.
|
||||
int windowId;
|
||||
|
||||
///Use [isDialog] instead.
|
||||
@Deprecated('Use isDialog instead')
|
||||
bool? androidIsDialog;
|
||||
|
||||
///Indicates if the new window should be a dialog, rather than a full-size window.
|
||||
///
|
||||
///**Supported Platforms/Implementations**:
|
||||
///- Android native WebView
|
||||
bool? isDialog;
|
||||
|
||||
///Use [windowFeatures] instead.
|
||||
@Deprecated('Use windowFeatures instead')
|
||||
IOSWKWindowFeatures? iosWindowFeatures;
|
||||
|
||||
///Window features requested by the webpage.
|
||||
///
|
||||
///**Supported Platforms/Implementations**:
|
||||
///- iOS ([Official API - WKWindowFeatures](https://developer.apple.com/documentation/webkit/wkwindowfeatures))
|
||||
WindowFeatures? windowFeatures;
|
||||
CreateWindowAction(
|
||||
{required this.windowId,
|
||||
@Deprecated('Use isDialog instead')
|
||||
this.androidIsDialog,
|
||||
this.isDialog,
|
||||
@Deprecated('Use windowFeatures instead')
|
||||
this.iosWindowFeatures,
|
||||
this.windowFeatures,
|
||||
required URLRequest request,
|
||||
required bool isForMainFrame,
|
||||
@Deprecated('Use hasGesture instead')
|
||||
bool? androidHasGesture,
|
||||
bool? hasGesture,
|
||||
@Deprecated('Use isRedirect instead')
|
||||
bool? androidIsRedirect,
|
||||
bool? isRedirect,
|
||||
@Deprecated('Use navigationType instead')
|
||||
IOSWKNavigationType? iosWKNavigationType,
|
||||
NavigationType? navigationType,
|
||||
@Deprecated('Use sourceFrame instead')
|
||||
IOSWKFrameInfo? iosSourceFrame,
|
||||
FrameInfo? sourceFrame,
|
||||
@Deprecated('Use targetFrame instead')
|
||||
IOSWKFrameInfo? iosTargetFrame,
|
||||
FrameInfo? targetFrame,
|
||||
bool? shouldPerformDownload})
|
||||
: super(
|
||||
request: request,
|
||||
isForMainFrame: isForMainFrame,
|
||||
androidHasGesture: androidHasGesture,
|
||||
hasGesture: hasGesture,
|
||||
androidIsRedirect: androidIsRedirect,
|
||||
isRedirect: isRedirect,
|
||||
iosWKNavigationType: iosWKNavigationType,
|
||||
navigationType: navigationType,
|
||||
iosSourceFrame: iosSourceFrame,
|
||||
sourceFrame: sourceFrame,
|
||||
iosTargetFrame: iosTargetFrame,
|
||||
targetFrame: targetFrame,
|
||||
shouldPerformDownload: shouldPerformDownload) {
|
||||
isDialog = isDialog ?? androidIsDialog;
|
||||
windowFeatures =
|
||||
windowFeatures ?? WindowFeatures.fromMap(iosWindowFeatures?.toMap());
|
||||
}
|
||||
|
||||
///Gets a possible [CreateWindowAction] instance from a [Map] value.
|
||||
static CreateWindowAction? fromMap(Map<String, dynamic>? map) {
|
||||
if (map == null) {
|
||||
return null;
|
||||
}
|
||||
final instance = CreateWindowAction(
|
||||
request: URLRequest.fromMap(map['request']?.cast<String, dynamic>())!,
|
||||
isForMainFrame: map['isForMainFrame'],
|
||||
windowId: map['windowId'],
|
||||
);
|
||||
instance.androidHasGesture = map['hasGesture'];
|
||||
instance.hasGesture = map['hasGesture'];
|
||||
instance.androidIsRedirect = map['isRedirect'];
|
||||
instance.isRedirect = map['isRedirect'];
|
||||
instance.iosWKNavigationType =
|
||||
IOSWKNavigationType.fromNativeValue(map['navigationType']);
|
||||
instance.navigationType =
|
||||
NavigationType.fromNativeValue(map['navigationType']);
|
||||
instance.iosSourceFrame =
|
||||
IOSWKFrameInfo.fromMap(map['sourceFrame']?.cast<String, dynamic>());
|
||||
instance.sourceFrame =
|
||||
FrameInfo.fromMap(map['sourceFrame']?.cast<String, dynamic>());
|
||||
instance.iosTargetFrame =
|
||||
IOSWKFrameInfo.fromMap(map['targetFrame']?.cast<String, dynamic>());
|
||||
instance.targetFrame =
|
||||
FrameInfo.fromMap(map['targetFrame']?.cast<String, dynamic>());
|
||||
instance.shouldPerformDownload = map['shouldPerformDownload'];
|
||||
instance.androidIsDialog = map['isDialog'];
|
||||
instance.isDialog = map['isDialog'];
|
||||
instance.iosWindowFeatures = IOSWKWindowFeatures.fromMap(
|
||||
map['windowFeatures']?.cast<String, dynamic>());
|
||||
instance.windowFeatures =
|
||||
WindowFeatures.fromMap(map['windowFeatures']?.cast<String, dynamic>());
|
||||
return instance;
|
||||
}
|
||||
|
||||
///Converts instance to a map.
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"request": request.toMap(),
|
||||
"isForMainFrame": isForMainFrame,
|
||||
"hasGesture": hasGesture,
|
||||
"isRedirect": isRedirect,
|
||||
"navigationType": navigationType?.toNativeValue(),
|
||||
"sourceFrame": sourceFrame?.toMap(),
|
||||
"targetFrame": targetFrame?.toMap(),
|
||||
"shouldPerformDownload": shouldPerformDownload,
|
||||
"windowId": windowId,
|
||||
"isDialog": isDialog,
|
||||
"windowFeatures": windowFeatures?.toMap(),
|
||||
};
|
||||
}
|
||||
|
||||
///Converts instance to a map.
|
||||
Map<String, dynamic> toJson() {
|
||||
return toMap();
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'CreateWindowAction{request: $request, isForMainFrame: $isForMainFrame, hasGesture: $hasGesture, isRedirect: $isRedirect, navigationType: $navigationType, sourceFrame: $sourceFrame, targetFrame: $targetFrame, shouldPerformDownload: $shouldPerformDownload, windowId: $windowId, isDialog: $isDialog, windowFeatures: $windowFeatures}';
|
||||
}
|
||||
}
|
@ -1,47 +1,22 @@
|
||||
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
|
||||
|
||||
import 'script_html_tag_attributes.dart';
|
||||
import 'css_link_html_tag_attributes.dart';
|
||||
|
||||
part 'cross_origin.g.dart';
|
||||
|
||||
///Class that represents the `crossorigin` content attribute on media elements, which is a CORS settings attribute.
|
||||
///It could be used with [ScriptHtmlTagAttributes] and [CSSLinkHtmlTagAttributes]
|
||||
///when fetching a resource `<link>` or a `<script>` (or resources fetched by the `<script>`).
|
||||
class CrossOrigin {
|
||||
@ExchangeableEnum()
|
||||
class CrossOrigin_ {
|
||||
// ignore: unused_field
|
||||
final String _value;
|
||||
|
||||
const CrossOrigin._internal(this._value);
|
||||
|
||||
///Set of all values of [CrossOrigin].
|
||||
static final Set<CrossOrigin> values = [
|
||||
CrossOrigin.ANONYMOUS,
|
||||
CrossOrigin.USE_CREDENTIALS,
|
||||
].toSet();
|
||||
|
||||
///Gets a possible [CrossOrigin] instance from a [String] value.
|
||||
static CrossOrigin? fromValue(String? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return CrossOrigin.values
|
||||
.firstWhere((element) => element.toValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets [String] value.
|
||||
String toValue() => _value;
|
||||
|
||||
@override
|
||||
String toString() => _value;
|
||||
const CrossOrigin_._internal(this._value);
|
||||
|
||||
///CORS requests for this element will have the credentials flag set to 'same-origin'.
|
||||
static const ANONYMOUS = const CrossOrigin._internal("anonymous");
|
||||
static const ANONYMOUS = const CrossOrigin_._internal("anonymous");
|
||||
|
||||
///CORS requests for this element will have the credentials flag set to 'include'.
|
||||
static const USE_CREDENTIALS = const CrossOrigin._internal("use-credentials");
|
||||
|
||||
bool operator ==(value) => value == _value;
|
||||
|
||||
@override
|
||||
int get hashCode => _value.hashCode;
|
||||
static const USE_CREDENTIALS = const CrossOrigin_._internal("use-credentials");
|
||||
}
|
76
lib/src/types/cross_origin.g.dart
Normal file
76
lib/src/types/cross_origin.g.dart
Normal file
@ -0,0 +1,76 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'cross_origin.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// ExchangeableEnumGenerator
|
||||
// **************************************************************************
|
||||
|
||||
///Class that represents the `crossorigin` content attribute on media elements, which is a CORS settings attribute.
|
||||
///It could be used with [ScriptHtmlTagAttributes] and [CSSLinkHtmlTagAttributes]
|
||||
///when fetching a resource `<link>` or a `<script>` (or resources fetched by the `<script>`).
|
||||
class CrossOrigin {
|
||||
final String _value;
|
||||
final String _nativeValue;
|
||||
const CrossOrigin._internal(this._value, this._nativeValue);
|
||||
// ignore: unused_element
|
||||
factory CrossOrigin._internalMultiPlatform(
|
||||
String value, Function nativeValue) =>
|
||||
CrossOrigin._internal(value, nativeValue());
|
||||
|
||||
///CORS requests for this element will have the credentials flag set to 'same-origin'.
|
||||
static const ANONYMOUS = CrossOrigin._internal('anonymous', 'anonymous');
|
||||
|
||||
///CORS requests for this element will have the credentials flag set to 'include'.
|
||||
static const USE_CREDENTIALS =
|
||||
CrossOrigin._internal('use-credentials', 'use-credentials');
|
||||
|
||||
///Set of all values of [CrossOrigin].
|
||||
static final Set<CrossOrigin> values = [
|
||||
CrossOrigin.ANONYMOUS,
|
||||
CrossOrigin.USE_CREDENTIALS,
|
||||
].toSet();
|
||||
|
||||
///Gets a possible [CrossOrigin] instance from [String] value.
|
||||
static CrossOrigin? fromValue(String? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return CrossOrigin.values
|
||||
.firstWhere((element) => element.toValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets a possible [CrossOrigin] instance from a native value.
|
||||
static CrossOrigin? fromNativeValue(String? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return CrossOrigin.values
|
||||
.firstWhere((element) => element.toNativeValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets [String] value.
|
||||
String toValue() => _value;
|
||||
|
||||
///Gets [String] native value.
|
||||
String toNativeValue() => _nativeValue;
|
||||
|
||||
@override
|
||||
int get hashCode => _value.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(value) => value == _value;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return _value;
|
||||
}
|
||||
}
|
@ -1,50 +1,24 @@
|
||||
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
|
||||
|
||||
import 'url_request.dart';
|
||||
import 'security_origin.dart';
|
||||
|
||||
part 'frame_info.g.dart';
|
||||
|
||||
///An object that contains information about a frame on a webpage.
|
||||
class FrameInfo {
|
||||
@ExchangeableObject()
|
||||
class FrameInfo_ {
|
||||
///A Boolean value indicating whether the frame is the web site's main frame or a subframe.
|
||||
bool isMainFrame;
|
||||
|
||||
///The frame’s current request.
|
||||
URLRequest? request;
|
||||
URLRequest_? request;
|
||||
|
||||
///The frame’s security origin.
|
||||
SecurityOrigin? securityOrigin;
|
||||
SecurityOrigin_? securityOrigin;
|
||||
|
||||
FrameInfo(
|
||||
FrameInfo_(
|
||||
{required this.isMainFrame, required this.request, this.securityOrigin});
|
||||
|
||||
///Gets a possible [FrameInfo] instance from a [Map] value.
|
||||
static FrameInfo? fromMap(Map<String, dynamic>? map) {
|
||||
if (map == null) {
|
||||
return null;
|
||||
}
|
||||
return FrameInfo(
|
||||
isMainFrame: map["isMainFrame"],
|
||||
request: URLRequest.fromMap(map["request"]?.cast<String, dynamic>()),
|
||||
securityOrigin: SecurityOrigin.fromMap(
|
||||
map["securityOrigin"]?.cast<String, dynamic>()));
|
||||
}
|
||||
|
||||
///Converts instance to a map.
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"isMainFrame": isMainFrame,
|
||||
"request": request?.toMap(),
|
||||
"securityOrigin": securityOrigin?.toMap()
|
||||
};
|
||||
}
|
||||
|
||||
///Converts instance to a map.
|
||||
Map<String, dynamic> toJson() {
|
||||
return this.toMap();
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toMap().toString();
|
||||
}
|
||||
}
|
||||
|
||||
///An object that contains information about a frame on a webpage.
|
||||
@ -53,47 +27,17 @@ class FrameInfo {
|
||||
///
|
||||
///Use [FrameInfo] instead.
|
||||
@Deprecated("Use FrameInfo instead")
|
||||
class IOSWKFrameInfo {
|
||||
@ExchangeableObject()
|
||||
class IOSWKFrameInfo_ {
|
||||
///A Boolean value indicating whether the frame is the web site's main frame or a subframe.
|
||||
bool isMainFrame;
|
||||
|
||||
///The frame’s current request.
|
||||
URLRequest? request;
|
||||
URLRequest_? request;
|
||||
|
||||
///The frame’s security origin.
|
||||
IOSWKSecurityOrigin? securityOrigin;
|
||||
IOSWKSecurityOrigin_? securityOrigin;
|
||||
|
||||
IOSWKFrameInfo(
|
||||
IOSWKFrameInfo_(
|
||||
{required this.isMainFrame, required this.request, this.securityOrigin});
|
||||
|
||||
///Gets a possible [IOSWKFrameInfo] instance from a [Map] value.
|
||||
static IOSWKFrameInfo? fromMap(Map<String, dynamic>? map) {
|
||||
if (map == null) {
|
||||
return null;
|
||||
}
|
||||
return IOSWKFrameInfo(
|
||||
isMainFrame: map["isMainFrame"],
|
||||
request: URLRequest.fromMap(map["request"]?.cast<String, dynamic>()),
|
||||
securityOrigin: IOSWKSecurityOrigin.fromMap(
|
||||
map["securityOrigin"]?.cast<String, dynamic>()));
|
||||
}
|
||||
|
||||
///Converts instance to a map.
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"isMainFrame": isMainFrame,
|
||||
"request": request?.toMap(),
|
||||
"securityOrigin": securityOrigin?.toMap()
|
||||
};
|
||||
}
|
||||
|
||||
///Converts instance to a map.
|
||||
Map<String, dynamic> toJson() {
|
||||
return this.toMap();
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toMap().toString();
|
||||
}
|
||||
}
|
103
lib/src/types/frame_info.g.dart
Normal file
103
lib/src/types/frame_info.g.dart
Normal file
@ -0,0 +1,103 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'frame_info.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// ExchangeableObjectGenerator
|
||||
// **************************************************************************
|
||||
|
||||
///An object that contains information about a frame on a webpage.
|
||||
class FrameInfo {
|
||||
///A Boolean value indicating whether the frame is the web site's main frame or a subframe.
|
||||
bool isMainFrame;
|
||||
|
||||
///The frame’s current request.
|
||||
URLRequest? request;
|
||||
|
||||
///The frame’s security origin.
|
||||
dynamic securityOrigin;
|
||||
FrameInfo({required this.isMainFrame, this.request, this.securityOrigin});
|
||||
|
||||
///Gets a possible [FrameInfo] instance from a [Map] value.
|
||||
static FrameInfo? fromMap(Map<String, dynamic>? map) {
|
||||
if (map == null) {
|
||||
return null;
|
||||
}
|
||||
final instance = FrameInfo(
|
||||
isMainFrame: map['isMainFrame'],
|
||||
request: URLRequest.fromMap(map['request']?.cast<String, dynamic>()),
|
||||
);
|
||||
instance.securityOrigin = map['securityOrigin'];
|
||||
return instance;
|
||||
}
|
||||
|
||||
///Converts instance to a map.
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"isMainFrame": isMainFrame,
|
||||
"request": request?.toMap(),
|
||||
"securityOrigin": securityOrigin,
|
||||
};
|
||||
}
|
||||
|
||||
///Converts instance to a map.
|
||||
Map<String, dynamic> toJson() {
|
||||
return toMap();
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'FrameInfo{isMainFrame: $isMainFrame, request: $request, securityOrigin: $securityOrigin}';
|
||||
}
|
||||
}
|
||||
|
||||
///An object that contains information about a frame on a webpage.
|
||||
///
|
||||
///**NOTE**: available only on iOS.
|
||||
///
|
||||
///Use [FrameInfo] instead.
|
||||
@Deprecated('Use FrameInfo instead')
|
||||
class IOSWKFrameInfo {
|
||||
///A Boolean value indicating whether the frame is the web site's main frame or a subframe.
|
||||
bool isMainFrame;
|
||||
|
||||
///The frame’s current request.
|
||||
URLRequest? request;
|
||||
|
||||
///The frame’s security origin.
|
||||
dynamic securityOrigin;
|
||||
IOSWKFrameInfo(
|
||||
{required this.isMainFrame, this.request, this.securityOrigin});
|
||||
|
||||
///Gets a possible [IOSWKFrameInfo] instance from a [Map] value.
|
||||
static IOSWKFrameInfo? fromMap(Map<String, dynamic>? map) {
|
||||
if (map == null) {
|
||||
return null;
|
||||
}
|
||||
final instance = IOSWKFrameInfo(
|
||||
isMainFrame: map['isMainFrame'],
|
||||
request: URLRequest.fromMap(map['request']?.cast<String, dynamic>()),
|
||||
);
|
||||
instance.securityOrigin = map['securityOrigin'];
|
||||
return instance;
|
||||
}
|
||||
|
||||
///Converts instance to a map.
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"isMainFrame": isMainFrame,
|
||||
"request": request?.toMap(),
|
||||
"securityOrigin": securityOrigin,
|
||||
};
|
||||
}
|
||||
|
||||
///Converts instance to a map.
|
||||
Map<String, dynamic> toJson() {
|
||||
return toMap();
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'IOSWKFrameInfo{isMainFrame: $isMainFrame, request: $request, securityOrigin: $securityOrigin}';
|
||||
}
|
||||
}
|
@ -1,56 +1,30 @@
|
||||
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
|
||||
|
||||
import 'cookie.dart';
|
||||
|
||||
part 'http_cookie_same_site_policy.g.dart';
|
||||
|
||||
///Class that represents the same site policy of a cookie. Used by the [Cookie] class.
|
||||
class HTTPCookieSameSitePolicy {
|
||||
@ExchangeableEnum()
|
||||
class HTTPCookieSameSitePolicy_ {
|
||||
// ignore: unused_field
|
||||
final String _value;
|
||||
|
||||
const HTTPCookieSameSitePolicy._internal(this._value);
|
||||
|
||||
///Set of all values of [HTTPCookieSameSitePolicy].
|
||||
static final Set<HTTPCookieSameSitePolicy> values = [
|
||||
HTTPCookieSameSitePolicy.LAX,
|
||||
HTTPCookieSameSitePolicy.STRICT,
|
||||
HTTPCookieSameSitePolicy.NONE,
|
||||
].toSet();
|
||||
|
||||
///Gets a possible [HTTPCookieSameSitePolicy] instance from a [String] value.
|
||||
static HTTPCookieSameSitePolicy? fromValue(String? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return HTTPCookieSameSitePolicy.values
|
||||
.firstWhere((element) => element.toValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets [String] value.
|
||||
String toValue() => _value;
|
||||
|
||||
@override
|
||||
String toString() => _value;
|
||||
const HTTPCookieSameSitePolicy_._internal(this._value);
|
||||
|
||||
///SameSite=Lax;
|
||||
///
|
||||
///Cookies are allowed to be sent with top-level navigations and will be sent along with GET
|
||||
///request initiated by third party website. This is the default value in modern browsers.
|
||||
static const LAX = const HTTPCookieSameSitePolicy._internal("Lax");
|
||||
static const LAX = const HTTPCookieSameSitePolicy_._internal("Lax");
|
||||
|
||||
///SameSite=Strict;
|
||||
///
|
||||
///Cookies will only be sent in a first-party context and not be sent along with requests initiated by third party websites.
|
||||
static const STRICT = const HTTPCookieSameSitePolicy._internal("Strict");
|
||||
static const STRICT = const HTTPCookieSameSitePolicy_._internal("Strict");
|
||||
|
||||
///SameSite=None;
|
||||
///
|
||||
///Cookies will be sent in all contexts, i.e sending cross-origin is allowed.
|
||||
///`None` requires the `Secure` attribute in latest browser versions.
|
||||
static const NONE = const HTTPCookieSameSitePolicy._internal("None");
|
||||
|
||||
bool operator ==(value) => value == _value;
|
||||
|
||||
@override
|
||||
int get hashCode => _value.hashCode;
|
||||
static const NONE = const HTTPCookieSameSitePolicy_._internal("None");
|
||||
}
|
85
lib/src/types/http_cookie_same_site_policy.g.dart
Normal file
85
lib/src/types/http_cookie_same_site_policy.g.dart
Normal file
@ -0,0 +1,85 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'http_cookie_same_site_policy.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// ExchangeableEnumGenerator
|
||||
// **************************************************************************
|
||||
|
||||
///Class that represents the same site policy of a cookie. Used by the [Cookie] class.
|
||||
class HTTPCookieSameSitePolicy {
|
||||
final String _value;
|
||||
final String _nativeValue;
|
||||
const HTTPCookieSameSitePolicy._internal(this._value, this._nativeValue);
|
||||
// ignore: unused_element
|
||||
factory HTTPCookieSameSitePolicy._internalMultiPlatform(
|
||||
String value, Function nativeValue) =>
|
||||
HTTPCookieSameSitePolicy._internal(value, nativeValue());
|
||||
|
||||
///SameSite=Lax;
|
||||
///
|
||||
///Cookies are allowed to be sent with top-level navigations and will be sent along with GET
|
||||
///request initiated by third party website. This is the default value in modern browsers.
|
||||
static const LAX = HTTPCookieSameSitePolicy._internal('Lax', 'Lax');
|
||||
|
||||
///SameSite=Strict;
|
||||
///
|
||||
///Cookies will only be sent in a first-party context and not be sent along with requests initiated by third party websites.
|
||||
static const STRICT = HTTPCookieSameSitePolicy._internal('Strict', 'Strict');
|
||||
|
||||
///SameSite=None;
|
||||
///
|
||||
///Cookies will be sent in all contexts, i.e sending cross-origin is allowed.
|
||||
///`None` requires the `Secure` attribute in latest browser versions.
|
||||
static const NONE = HTTPCookieSameSitePolicy._internal('None', 'None');
|
||||
|
||||
///Set of all values of [HTTPCookieSameSitePolicy].
|
||||
static final Set<HTTPCookieSameSitePolicy> values = [
|
||||
HTTPCookieSameSitePolicy.LAX,
|
||||
HTTPCookieSameSitePolicy.STRICT,
|
||||
HTTPCookieSameSitePolicy.NONE,
|
||||
].toSet();
|
||||
|
||||
///Gets a possible [HTTPCookieSameSitePolicy] instance from [String] value.
|
||||
static HTTPCookieSameSitePolicy? fromValue(String? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return HTTPCookieSameSitePolicy.values
|
||||
.firstWhere((element) => element.toValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets a possible [HTTPCookieSameSitePolicy] instance from a native value.
|
||||
static HTTPCookieSameSitePolicy? fromNativeValue(String? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return HTTPCookieSameSitePolicy.values
|
||||
.firstWhere((element) => element.toNativeValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets [String] value.
|
||||
String toValue() => _value;
|
||||
|
||||
///Gets [String] native value.
|
||||
String toNativeValue() => _nativeValue;
|
||||
|
||||
@override
|
||||
int get hashCode => _value.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(value) => value == _value;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return _value;
|
||||
}
|
||||
}
|
@ -1,17 +1,22 @@
|
||||
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
|
||||
|
||||
import '../in_app_webview/webview.dart';
|
||||
import 'url_request.dart';
|
||||
import 'navigation_type.dart';
|
||||
import 'frame_info.dart';
|
||||
|
||||
part 'navigation_action.g.dart';
|
||||
|
||||
///An object that contains information about an action that causes navigation to occur.
|
||||
class NavigationAction {
|
||||
@ExchangeableObject()
|
||||
class NavigationAction_ {
|
||||
///The URL request object associated with the navigation action.
|
||||
///
|
||||
///**NOTE for Android**: If the request is associated to the [WebView.onCreateWindow] event
|
||||
///and the window has been created using JavaScript, [request.url] will be `null`,
|
||||
///the [request.method] is always `GET`, and [request.headers] value is always `null`.
|
||||
///Also, on Android < 21, the [request.method] is always `GET` and [request.headers] value is always `null`.
|
||||
URLRequest request;
|
||||
URLRequest_ request;
|
||||
|
||||
///Indicates whether the request was made for the main frame.
|
||||
///
|
||||
@ -27,8 +32,16 @@ class NavigationAction {
|
||||
///For security reasons in certain situations this method may return `false` even though
|
||||
///the sequence of events which caused the request to be created was initiated by a user
|
||||
///gesture.
|
||||
///
|
||||
///**NOTE**: available only on Android. On Android < 24, this is always `false`.
|
||||
@SupportedPlatforms(
|
||||
platforms: [
|
||||
AndroidPlatform(
|
||||
available: "21",
|
||||
apiName: "WebResourceRequest.hasGesture",
|
||||
apiUrl: "https://developer.android.com/reference/android/webkit/WebResourceRequest#hasGesture()",
|
||||
note: "On Android < 21, this is always `false`"
|
||||
)
|
||||
]
|
||||
)
|
||||
bool? hasGesture;
|
||||
|
||||
///Use [isRedirect] instead.
|
||||
@ -37,44 +50,77 @@ class NavigationAction {
|
||||
|
||||
///Gets whether the request was a result of a server-side redirect.
|
||||
///
|
||||
///**NOTE**: available only on Android.
|
||||
///If the request is associated to the [WebView.onCreateWindow] event, this is always `false`.
|
||||
///**NOTE**: If the request is associated to the [WebView.onCreateWindow] event, this is always `false`.
|
||||
///Also, on Android < 21, this is always `false`.
|
||||
@SupportedPlatforms(
|
||||
platforms: [
|
||||
AndroidPlatform(
|
||||
available: "21",
|
||||
apiName: "WebResourceRequest.isRedirect",
|
||||
apiUrl: "https://developer.android.com/reference/android/webkit/WebResourceRequest#isRedirect()"
|
||||
)
|
||||
]
|
||||
)
|
||||
bool? isRedirect;
|
||||
|
||||
///Use [navigationType] instead.
|
||||
@Deprecated("Use navigationType instead")
|
||||
IOSWKNavigationType? iosWKNavigationType;
|
||||
IOSWKNavigationType_? iosWKNavigationType;
|
||||
|
||||
///The type of action triggering the navigation.
|
||||
///
|
||||
///**NOTE**: available only on iOS.
|
||||
NavigationType? navigationType;
|
||||
///The type of action triggering the navigation.ì
|
||||
@SupportedPlatforms(
|
||||
platforms: [
|
||||
IOSPlatform(
|
||||
apiName: "WKNavigationAction.navigationType",
|
||||
apiUrl: "https://developer.apple.com/documentation/webkit/wknavigationaction/1401914-navigationtype"
|
||||
)
|
||||
]
|
||||
)
|
||||
NavigationType_? navigationType;
|
||||
|
||||
///Use [sourceFrame] instead.
|
||||
@Deprecated("Use sourceFrame instead")
|
||||
IOSWKFrameInfo? iosSourceFrame;
|
||||
IOSWKFrameInfo_? iosSourceFrame;
|
||||
|
||||
///The frame that requested the navigation.
|
||||
///
|
||||
///**NOTE**: available only on iOS.
|
||||
FrameInfo? sourceFrame;
|
||||
@SupportedPlatforms(
|
||||
platforms: [
|
||||
IOSPlatform(
|
||||
apiName: "WKNavigationAction.sourceFrame",
|
||||
apiUrl: "https://developer.apple.com/documentation/webkit/wknavigationaction/1401926-sourceframe"
|
||||
)
|
||||
]
|
||||
)
|
||||
FrameInfo_? sourceFrame;
|
||||
|
||||
///Use [targetFrame] instead.
|
||||
@Deprecated("Use targetFrame instead")
|
||||
IOSWKFrameInfo? iosTargetFrame;
|
||||
IOSWKFrameInfo_? iosTargetFrame;
|
||||
|
||||
///The frame in which to display the new content.
|
||||
///
|
||||
///**NOTE**: available only on iOS.
|
||||
FrameInfo? targetFrame;
|
||||
@SupportedPlatforms(
|
||||
platforms: [
|
||||
IOSPlatform(
|
||||
apiName: "WKNavigationAction.targetFrame",
|
||||
apiUrl: "https://developer.apple.com/documentation/webkit/wknavigationaction/1401918-targetframe"
|
||||
)
|
||||
]
|
||||
)
|
||||
FrameInfo_? targetFrame;
|
||||
|
||||
///A value indicating whether the web content used a download attribute to indicate that this should be downloaded.
|
||||
///
|
||||
///**NOTE**: available only on iOS.
|
||||
@SupportedPlatforms(
|
||||
platforms: [
|
||||
IOSPlatform(
|
||||
available: "14.5",
|
||||
apiName: "WKNavigationAction.shouldPerformDownload",
|
||||
apiUrl: "https://developer.apple.com/documentation/webkit/wknavigationaction/3727357-shouldperformdownload"
|
||||
)
|
||||
]
|
||||
)
|
||||
bool? shouldPerformDownload;
|
||||
|
||||
NavigationAction(
|
||||
NavigationAction_(
|
||||
{required this.request,
|
||||
required this.isForMainFrame,
|
||||
@Deprecated('Use hasGesture instead') this.androidHasGesture,
|
||||
@ -87,94 +133,5 @@ class NavigationAction {
|
||||
this.sourceFrame,
|
||||
@Deprecated("Use targetFrame instead") this.iosTargetFrame,
|
||||
this.targetFrame,
|
||||
this.shouldPerformDownload}) {
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.hasGesture = this.hasGesture ?? this.androidHasGesture;
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.isRedirect = this.isRedirect ?? this.androidIsRedirect;
|
||||
this.navigationType = this.navigationType ??
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
NavigationType.fromValue(this.iosWKNavigationType?.toValue());
|
||||
this.sourceFrame =
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.sourceFrame ?? FrameInfo.fromMap(this.iosSourceFrame?.toMap());
|
||||
this.targetFrame =
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.targetFrame ?? FrameInfo.fromMap(this.iosTargetFrame?.toMap());
|
||||
}
|
||||
|
||||
///Gets a possible [NavigationAction] instance from a [Map] value.
|
||||
static NavigationAction? fromMap(Map<String, dynamic>? map) {
|
||||
if (map == null) {
|
||||
return null;
|
||||
}
|
||||
return NavigationAction(
|
||||
request: URLRequest.fromMap(map["request"].cast<String, dynamic>())!,
|
||||
isForMainFrame: map["isForMainFrame"],
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
androidHasGesture: map["hasGesture"] ?? map["androidHasGesture"],
|
||||
hasGesture: map["hasGesture"],
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
androidIsRedirect: map["isRedirect"] ?? map["androidIsRedirect"],
|
||||
isRedirect: map["isRedirect"],
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
iosWKNavigationType:
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
IOSWKNavigationType.fromValue(map["navigationType"]),
|
||||
navigationType: NavigationType.fromValue(map["navigationType"]),
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
iosSourceFrame:
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
IOSWKFrameInfo.fromMap(map["sourceFrame"]?.cast<String, dynamic>()),
|
||||
sourceFrame:
|
||||
FrameInfo.fromMap(map["sourceFrame"]?.cast<String, dynamic>()),
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
iosTargetFrame:
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
IOSWKFrameInfo.fromMap(map["targetFrame"]?.cast<String, dynamic>()),
|
||||
targetFrame:
|
||||
FrameInfo.fromMap(map["targetFrame"]?.cast<String, dynamic>()),
|
||||
shouldPerformDownload: map["shouldPerformDownload"]);
|
||||
}
|
||||
|
||||
///Converts instance to a map.
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"request": request.toMap(),
|
||||
"isForMainFrame": isForMainFrame,
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"androidHasGesture": hasGesture ?? androidHasGesture,
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"hasGesture": hasGesture ?? androidHasGesture,
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"isRedirect": isRedirect ?? androidIsRedirect,
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"androidIsRedirect": isRedirect ?? androidIsRedirect,
|
||||
"iosWKNavigationType":
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
navigationType?.toValue() ?? iosWKNavigationType?.toValue(),
|
||||
"navigationType":
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
navigationType?.toValue() ?? iosWKNavigationType?.toValue(),
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"iosSourceFrame": sourceFrame?.toMap() ?? iosSourceFrame?.toMap(),
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"sourceFrame": sourceFrame?.toMap() ?? iosSourceFrame?.toMap(),
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"iosTargetFrame": targetFrame?.toMap() ?? iosTargetFrame?.toMap(),
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"targetFrame": targetFrame?.toMap() ?? iosTargetFrame?.toMap(),
|
||||
"shouldPerformDownload": shouldPerformDownload
|
||||
};
|
||||
}
|
||||
|
||||
///Converts instance to a map.
|
||||
Map<String, dynamic> toJson() {
|
||||
return this.toMap();
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toMap().toString();
|
||||
}
|
||||
this.shouldPerformDownload});
|
||||
}
|
162
lib/src/types/navigation_action.g.dart
Normal file
162
lib/src/types/navigation_action.g.dart
Normal file
@ -0,0 +1,162 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'navigation_action.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// ExchangeableObjectGenerator
|
||||
// **************************************************************************
|
||||
|
||||
///An object that contains information about an action that causes navigation to occur.
|
||||
class NavigationAction {
|
||||
///The URL request object associated with the navigation action.
|
||||
///
|
||||
///**NOTE for Android**: If the request is associated to the [WebView.onCreateWindow] event
|
||||
///and the window has been created using JavaScript, [request.url] will be `null`,
|
||||
///the [request.method] is always `GET`, and [request.headers] value is always `null`.
|
||||
///Also, on Android < 21, the [request.method] is always `GET` and [request.headers] value is always `null`.
|
||||
URLRequest request;
|
||||
|
||||
///Indicates whether the request was made for the main frame.
|
||||
///
|
||||
///**NOTE for Android**: If the request is associated to the [WebView.onCreateWindow] event, this is always `true`.
|
||||
///Also, on Android < 21, this is always `true`.
|
||||
bool isForMainFrame;
|
||||
|
||||
///Use [hasGesture] instead.
|
||||
@Deprecated('Use hasGesture instead')
|
||||
bool? androidHasGesture;
|
||||
|
||||
///Gets whether a gesture (such as a click) was associated with the request.
|
||||
///For security reasons in certain situations this method may return `false` even though
|
||||
///the sequence of events which caused the request to be created was initiated by a user
|
||||
///gesture.
|
||||
///
|
||||
///**NOTE for Android native WebView**: On Android < 21, this is always `false`
|
||||
///
|
||||
///**Supported Platforms/Implementations**:
|
||||
///- Android native WebView 21+ ([Official API - WebResourceRequest.hasGesture](https://developer.android.com/reference/android/webkit/WebResourceRequest#hasGesture()))
|
||||
bool? hasGesture;
|
||||
|
||||
///Use [isRedirect] instead.
|
||||
@Deprecated('Use isRedirect instead')
|
||||
bool? androidIsRedirect;
|
||||
|
||||
///Gets whether the request was a result of a server-side redirect.
|
||||
///
|
||||
///**NOTE**: If the request is associated to the [WebView.onCreateWindow] event, this is always `false`.
|
||||
///Also, on Android < 21, this is always `false`.
|
||||
///
|
||||
///**Supported Platforms/Implementations**:
|
||||
///- Android native WebView 21+ ([Official API - WebResourceRequest.isRedirect](https://developer.android.com/reference/android/webkit/WebResourceRequest#isRedirect()))
|
||||
bool? isRedirect;
|
||||
|
||||
///Use [navigationType] instead.
|
||||
@Deprecated('Use navigationType instead')
|
||||
IOSWKNavigationType? iosWKNavigationType;
|
||||
|
||||
///The type of action triggering the navigation.ì
|
||||
///
|
||||
///**Supported Platforms/Implementations**:
|
||||
///- iOS ([Official API - WKNavigationAction.navigationType](https://developer.apple.com/documentation/webkit/wknavigationaction/1401914-navigationtype))
|
||||
NavigationType? navigationType;
|
||||
|
||||
///Use [sourceFrame] instead.
|
||||
@Deprecated('Use sourceFrame instead')
|
||||
IOSWKFrameInfo? iosSourceFrame;
|
||||
|
||||
///The frame that requested the navigation.
|
||||
///
|
||||
///**Supported Platforms/Implementations**:
|
||||
///- iOS ([Official API - WKNavigationAction.sourceFrame](https://developer.apple.com/documentation/webkit/wknavigationaction/1401926-sourceframe))
|
||||
FrameInfo? sourceFrame;
|
||||
|
||||
///Use [targetFrame] instead.
|
||||
@Deprecated('Use targetFrame instead')
|
||||
IOSWKFrameInfo? iosTargetFrame;
|
||||
|
||||
///The frame in which to display the new content.
|
||||
///
|
||||
///**Supported Platforms/Implementations**:
|
||||
///- iOS ([Official API - WKNavigationAction.targetFrame](https://developer.apple.com/documentation/webkit/wknavigationaction/1401918-targetframe))
|
||||
FrameInfo? targetFrame;
|
||||
|
||||
///A value indicating whether the web content used a download attribute to indicate that this should be downloaded.
|
||||
///
|
||||
///**Supported Platforms/Implementations**:
|
||||
///- iOS 14.5+ ([Official API - WKNavigationAction.shouldPerformDownload](https://developer.apple.com/documentation/webkit/wknavigationaction/3727357-shouldperformdownload))
|
||||
bool? shouldPerformDownload;
|
||||
NavigationAction(
|
||||
{required this.request,
|
||||
required this.isForMainFrame,
|
||||
@Deprecated('Use hasGesture instead') this.androidHasGesture,
|
||||
this.hasGesture,
|
||||
@Deprecated('Use isRedirect instead') this.androidIsRedirect,
|
||||
this.isRedirect,
|
||||
@Deprecated('Use navigationType instead') this.iosWKNavigationType,
|
||||
this.navigationType,
|
||||
@Deprecated('Use sourceFrame instead') this.iosSourceFrame,
|
||||
this.sourceFrame,
|
||||
@Deprecated('Use targetFrame instead') this.iosTargetFrame,
|
||||
this.targetFrame,
|
||||
this.shouldPerformDownload}) {
|
||||
hasGesture = hasGesture ?? androidHasGesture;
|
||||
isRedirect = isRedirect ?? androidIsRedirect;
|
||||
navigationType = navigationType ??
|
||||
NavigationType.fromNativeValue(iosWKNavigationType?.toNativeValue());
|
||||
sourceFrame = sourceFrame ?? FrameInfo.fromMap(iosSourceFrame?.toMap());
|
||||
targetFrame = targetFrame ?? FrameInfo.fromMap(iosTargetFrame?.toMap());
|
||||
}
|
||||
|
||||
///Gets a possible [NavigationAction] instance from a [Map] value.
|
||||
static NavigationAction? fromMap(Map<String, dynamic>? map) {
|
||||
if (map == null) {
|
||||
return null;
|
||||
}
|
||||
final instance = NavigationAction(
|
||||
request: URLRequest.fromMap(map['request']?.cast<String, dynamic>())!,
|
||||
isForMainFrame: map['isForMainFrame'],
|
||||
);
|
||||
instance.androidHasGesture = map['hasGesture'];
|
||||
instance.hasGesture = map['hasGesture'];
|
||||
instance.androidIsRedirect = map['isRedirect'];
|
||||
instance.isRedirect = map['isRedirect'];
|
||||
instance.iosWKNavigationType =
|
||||
IOSWKNavigationType.fromNativeValue(map['navigationType']);
|
||||
instance.navigationType =
|
||||
NavigationType.fromNativeValue(map['navigationType']);
|
||||
instance.iosSourceFrame =
|
||||
IOSWKFrameInfo.fromMap(map['sourceFrame']?.cast<String, dynamic>());
|
||||
instance.sourceFrame =
|
||||
FrameInfo.fromMap(map['sourceFrame']?.cast<String, dynamic>());
|
||||
instance.iosTargetFrame =
|
||||
IOSWKFrameInfo.fromMap(map['targetFrame']?.cast<String, dynamic>());
|
||||
instance.targetFrame =
|
||||
FrameInfo.fromMap(map['targetFrame']?.cast<String, dynamic>());
|
||||
instance.shouldPerformDownload = map['shouldPerformDownload'];
|
||||
return instance;
|
||||
}
|
||||
|
||||
///Converts instance to a map.
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"request": request.toMap(),
|
||||
"isForMainFrame": isForMainFrame,
|
||||
"hasGesture": hasGesture,
|
||||
"isRedirect": isRedirect,
|
||||
"navigationType": navigationType?.toNativeValue(),
|
||||
"sourceFrame": sourceFrame?.toMap(),
|
||||
"targetFrame": targetFrame?.toMap(),
|
||||
"shouldPerformDownload": shouldPerformDownload,
|
||||
};
|
||||
}
|
||||
|
||||
///Converts instance to a map.
|
||||
Map<String, dynamic> toJson() {
|
||||
return toMap();
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'NavigationAction{request: $request, isForMainFrame: $isForMainFrame, hasGesture: $hasGesture, isRedirect: $isRedirect, navigationType: $navigationType, sourceFrame: $sourceFrame, targetFrame: $targetFrame, shouldPerformDownload: $shouldPerformDownload}';
|
||||
}
|
||||
}
|
@ -1,153 +1,59 @@
|
||||
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
|
||||
|
||||
import '../in_app_webview/webview.dart';
|
||||
|
||||
part 'navigation_type.g.dart';
|
||||
|
||||
///Class that represents the type of action triggering a navigation for the [WebView.shouldOverrideUrlLoading] event.
|
||||
class NavigationType {
|
||||
@ExchangeableEnum()
|
||||
class NavigationType_ {
|
||||
// ignore: unused_field
|
||||
final int _value;
|
||||
|
||||
const NavigationType._internal(this._value);
|
||||
|
||||
///Set of all values of [NavigationType].
|
||||
static final Set<NavigationType> values = [
|
||||
NavigationType.LINK_ACTIVATED,
|
||||
NavigationType.FORM_SUBMITTED,
|
||||
NavigationType.BACK_FORWARD,
|
||||
NavigationType.RELOAD,
|
||||
NavigationType.FORM_RESUBMITTED,
|
||||
NavigationType.OTHER,
|
||||
].toSet();
|
||||
|
||||
///Gets a possible [NavigationType] instance from an [int] value.
|
||||
static NavigationType? fromValue(int? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return NavigationType.values
|
||||
.firstWhere((element) => element.toValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets [int] value.
|
||||
int toValue() => _value;
|
||||
const NavigationType_._internal(this._value);
|
||||
|
||||
///A link with an href attribute was activated by the user.
|
||||
static const LINK_ACTIVATED = const NavigationType._internal(0);
|
||||
static const LINK_ACTIVATED = const NavigationType_._internal(0);
|
||||
|
||||
///A form was submitted.
|
||||
static const FORM_SUBMITTED = const NavigationType._internal(1);
|
||||
static const FORM_SUBMITTED = const NavigationType_._internal(1);
|
||||
|
||||
///An item from the back-forward list was requested.
|
||||
static const BACK_FORWARD = const NavigationType._internal(2);
|
||||
static const BACK_FORWARD = const NavigationType_._internal(2);
|
||||
|
||||
///The webpage was reloaded.
|
||||
static const RELOAD = const NavigationType._internal(3);
|
||||
static const RELOAD = const NavigationType_._internal(3);
|
||||
|
||||
///A form was resubmitted (for example by going back, going forward, or reloading).
|
||||
static const FORM_RESUBMITTED = const NavigationType._internal(4);
|
||||
static const FORM_RESUBMITTED = const NavigationType_._internal(4);
|
||||
|
||||
///Navigation is taking place for some other reason.
|
||||
static const OTHER = const NavigationType._internal(-1);
|
||||
|
||||
bool operator ==(value) => value == _value;
|
||||
|
||||
@override
|
||||
int get hashCode => _value.hashCode;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
switch (_value) {
|
||||
case 0:
|
||||
return "LINK_ACTIVATED";
|
||||
case 1:
|
||||
return "FORM_SUBMITTED";
|
||||
case 2:
|
||||
return "BACK_FORWARD";
|
||||
case 3:
|
||||
return "RELOAD";
|
||||
case 4:
|
||||
return "FORM_RESUBMITTED";
|
||||
case -1:
|
||||
default:
|
||||
return "OTHER";
|
||||
}
|
||||
}
|
||||
static const OTHER = const NavigationType_._internal(-1);
|
||||
}
|
||||
|
||||
///Class that represents the type of action triggering a navigation on iOS for the [WebView.shouldOverrideUrlLoading] event.
|
||||
///Use [NavigationType] instead.
|
||||
@Deprecated("Use NavigationType instead")
|
||||
class IOSWKNavigationType {
|
||||
@ExchangeableEnum()
|
||||
class IOSWKNavigationType_ {
|
||||
// ignore: unused_field
|
||||
final int _value;
|
||||
|
||||
const IOSWKNavigationType._internal(this._value);
|
||||
|
||||
///Set of all values of [IOSWKNavigationType].
|
||||
static final Set<IOSWKNavigationType> values = [
|
||||
IOSWKNavigationType.LINK_ACTIVATED,
|
||||
IOSWKNavigationType.FORM_SUBMITTED,
|
||||
IOSWKNavigationType.BACK_FORWARD,
|
||||
IOSWKNavigationType.RELOAD,
|
||||
IOSWKNavigationType.FORM_RESUBMITTED,
|
||||
IOSWKNavigationType.OTHER,
|
||||
].toSet();
|
||||
|
||||
///Gets a possible [IOSWKNavigationType] instance from an [int] value.
|
||||
static IOSWKNavigationType? fromValue(int? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return IOSWKNavigationType.values
|
||||
.firstWhere((element) => element.toValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets [int] value.
|
||||
int toValue() => _value;
|
||||
const IOSWKNavigationType_._internal(this._value);
|
||||
|
||||
///A link with an href attribute was activated by the user.
|
||||
static const LINK_ACTIVATED = const IOSWKNavigationType._internal(0);
|
||||
static const LINK_ACTIVATED = const IOSWKNavigationType_._internal(0);
|
||||
|
||||
///A form was submitted.
|
||||
static const FORM_SUBMITTED = const IOSWKNavigationType._internal(1);
|
||||
static const FORM_SUBMITTED = const IOSWKNavigationType_._internal(1);
|
||||
|
||||
///An item from the back-forward list was requested.
|
||||
static const BACK_FORWARD = const IOSWKNavigationType._internal(2);
|
||||
static const BACK_FORWARD = const IOSWKNavigationType_._internal(2);
|
||||
|
||||
///The webpage was reloaded.
|
||||
static const RELOAD = const IOSWKNavigationType._internal(3);
|
||||
static const RELOAD = const IOSWKNavigationType_._internal(3);
|
||||
|
||||
///A form was resubmitted (for example by going back, going forward, or reloading).
|
||||
static const FORM_RESUBMITTED = const IOSWKNavigationType._internal(4);
|
||||
static const FORM_RESUBMITTED = const IOSWKNavigationType_._internal(4);
|
||||
|
||||
///Navigation is taking place for some other reason.
|
||||
static const OTHER = const IOSWKNavigationType._internal(-1);
|
||||
|
||||
bool operator ==(value) => value == _value;
|
||||
|
||||
@override
|
||||
int get hashCode => _value.hashCode;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
switch (_value) {
|
||||
case 0:
|
||||
return "LINK_ACTIVATED";
|
||||
case 1:
|
||||
return "FORM_SUBMITTED";
|
||||
case 2:
|
||||
return "BACK_FORWARD";
|
||||
case 3:
|
||||
return "RELOAD";
|
||||
case 4:
|
||||
return "FORM_RESUBMITTED";
|
||||
case -1:
|
||||
default:
|
||||
return "OTHER";
|
||||
}
|
||||
}
|
||||
static const OTHER = const IOSWKNavigationType_._internal(-1);
|
||||
}
|
201
lib/src/types/navigation_type.g.dart
Normal file
201
lib/src/types/navigation_type.g.dart
Normal file
@ -0,0 +1,201 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'navigation_type.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// ExchangeableEnumGenerator
|
||||
// **************************************************************************
|
||||
|
||||
///Class that represents the type of action triggering a navigation for the [WebView.shouldOverrideUrlLoading] event.
|
||||
class NavigationType {
|
||||
final int _value;
|
||||
final int _nativeValue;
|
||||
const NavigationType._internal(this._value, this._nativeValue);
|
||||
// ignore: unused_element
|
||||
factory NavigationType._internalMultiPlatform(
|
||||
int value, Function nativeValue) =>
|
||||
NavigationType._internal(value, nativeValue());
|
||||
|
||||
///A link with an href attribute was activated by the user.
|
||||
static const LINK_ACTIVATED = NavigationType._internal(0, 0);
|
||||
|
||||
///A form was submitted.
|
||||
static const FORM_SUBMITTED = NavigationType._internal(1, 1);
|
||||
|
||||
///An item from the back-forward list was requested.
|
||||
static const BACK_FORWARD = NavigationType._internal(2, 2);
|
||||
|
||||
///The webpage was reloaded.
|
||||
static const RELOAD = NavigationType._internal(3, 3);
|
||||
|
||||
///A form was resubmitted (for example by going back, going forward, or reloading).
|
||||
static const FORM_RESUBMITTED = NavigationType._internal(4, 4);
|
||||
|
||||
///Navigation is taking place for some other reason.
|
||||
static const OTHER = NavigationType._internal(-1, -1);
|
||||
|
||||
///Set of all values of [NavigationType].
|
||||
static final Set<NavigationType> values = [
|
||||
NavigationType.LINK_ACTIVATED,
|
||||
NavigationType.FORM_SUBMITTED,
|
||||
NavigationType.BACK_FORWARD,
|
||||
NavigationType.RELOAD,
|
||||
NavigationType.FORM_RESUBMITTED,
|
||||
NavigationType.OTHER,
|
||||
].toSet();
|
||||
|
||||
///Gets a possible [NavigationType] instance from [int] value.
|
||||
static NavigationType? fromValue(int? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return NavigationType.values
|
||||
.firstWhere((element) => element.toValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets a possible [NavigationType] instance from a native value.
|
||||
static NavigationType? fromNativeValue(int? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return NavigationType.values
|
||||
.firstWhere((element) => element.toNativeValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets [int] value.
|
||||
int toValue() => _value;
|
||||
|
||||
///Gets [int] native value.
|
||||
int toNativeValue() => _nativeValue;
|
||||
|
||||
@override
|
||||
int get hashCode => _value.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(value) => value == _value;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
switch (_value) {
|
||||
case 0:
|
||||
return 'LINK_ACTIVATED';
|
||||
case 1:
|
||||
return 'FORM_SUBMITTED';
|
||||
case 2:
|
||||
return 'BACK_FORWARD';
|
||||
case 3:
|
||||
return 'RELOAD';
|
||||
case 4:
|
||||
return 'FORM_RESUBMITTED';
|
||||
case -1:
|
||||
return 'OTHER';
|
||||
}
|
||||
return _value.toString();
|
||||
}
|
||||
}
|
||||
|
||||
///Class that represents the type of action triggering a navigation on iOS for the [WebView.shouldOverrideUrlLoading] event.
|
||||
///Use [NavigationType] instead.
|
||||
@Deprecated('Use NavigationType instead')
|
||||
class IOSWKNavigationType {
|
||||
final int _value;
|
||||
final int _nativeValue;
|
||||
const IOSWKNavigationType._internal(this._value, this._nativeValue);
|
||||
// ignore: unused_element
|
||||
factory IOSWKNavigationType._internalMultiPlatform(
|
||||
int value, Function nativeValue) =>
|
||||
IOSWKNavigationType._internal(value, nativeValue());
|
||||
|
||||
///A link with an href attribute was activated by the user.
|
||||
static const LINK_ACTIVATED = IOSWKNavigationType._internal(0, 0);
|
||||
|
||||
///A form was submitted.
|
||||
static const FORM_SUBMITTED = IOSWKNavigationType._internal(1, 1);
|
||||
|
||||
///An item from the back-forward list was requested.
|
||||
static const BACK_FORWARD = IOSWKNavigationType._internal(2, 2);
|
||||
|
||||
///The webpage was reloaded.
|
||||
static const RELOAD = IOSWKNavigationType._internal(3, 3);
|
||||
|
||||
///A form was resubmitted (for example by going back, going forward, or reloading).
|
||||
static const FORM_RESUBMITTED = IOSWKNavigationType._internal(4, 4);
|
||||
|
||||
///Navigation is taking place for some other reason.
|
||||
static const OTHER = IOSWKNavigationType._internal(-1, -1);
|
||||
|
||||
///Set of all values of [IOSWKNavigationType].
|
||||
static final Set<IOSWKNavigationType> values = [
|
||||
IOSWKNavigationType.LINK_ACTIVATED,
|
||||
IOSWKNavigationType.FORM_SUBMITTED,
|
||||
IOSWKNavigationType.BACK_FORWARD,
|
||||
IOSWKNavigationType.RELOAD,
|
||||
IOSWKNavigationType.FORM_RESUBMITTED,
|
||||
IOSWKNavigationType.OTHER,
|
||||
].toSet();
|
||||
|
||||
///Gets a possible [IOSWKNavigationType] instance from [int] value.
|
||||
static IOSWKNavigationType? fromValue(int? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return IOSWKNavigationType.values
|
||||
.firstWhere((element) => element.toValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets a possible [IOSWKNavigationType] instance from a native value.
|
||||
static IOSWKNavigationType? fromNativeValue(int? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return IOSWKNavigationType.values
|
||||
.firstWhere((element) => element.toNativeValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets [int] value.
|
||||
int toValue() => _value;
|
||||
|
||||
///Gets [int] native value.
|
||||
int toNativeValue() => _nativeValue;
|
||||
|
||||
@override
|
||||
int get hashCode => _value.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(value) => value == _value;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
switch (_value) {
|
||||
case 0:
|
||||
return 'LINK_ACTIVATED';
|
||||
case 1:
|
||||
return 'FORM_SUBMITTED';
|
||||
case 2:
|
||||
return 'BACK_FORWARD';
|
||||
case 3:
|
||||
return 'RELOAD';
|
||||
case 4:
|
||||
return 'FORM_RESUBMITTED';
|
||||
case -1:
|
||||
return 'OTHER';
|
||||
}
|
||||
return _value.toString();
|
||||
}
|
||||
}
|
@ -48,15 +48,19 @@ class URLProtectionSpace_ {
|
||||
SslCertificate_? sslCertificate;
|
||||
|
||||
///The SSL Error associated.
|
||||
SslError? sslError;
|
||||
SslError_? sslError;
|
||||
|
||||
///Use [authenticationMethod] instead.
|
||||
@Deprecated("Use authenticationMethod instead")
|
||||
IOSNSURLProtectionSpaceAuthenticationMethod_? iosAuthenticationMethod;
|
||||
|
||||
///The authentication method used by the receiver.
|
||||
///
|
||||
///**NOTE**: available only on iOS.
|
||||
@SupportedPlatforms(platforms: [
|
||||
IOSPlatform(
|
||||
apiName: "URLProtectionSpace.authenticationMethod",
|
||||
apiUrl: "https://developer.apple.com/documentation/foundation/urlprotectionspace/1415028-authenticationmethod"
|
||||
)
|
||||
])
|
||||
URLProtectionSpaceAuthenticationMethod_? authenticationMethod;
|
||||
|
||||
///Use [distinguishedNames] instead.
|
||||
@ -69,11 +73,15 @@ class URLProtectionSpace_ {
|
||||
///The acceptable certificate-issuing authorities for client certificate authentication.
|
||||
///This value is `null` if the authentication method of the protection space is not client certificate.
|
||||
///The returned issuing authorities are encoded with Distinguished Encoding Rules (DER).
|
||||
///
|
||||
///**NOTE**: available only on iOS.
|
||||
@ExchangeableObjectProperty(
|
||||
deserializer: _distinguishedNamesDeserializer
|
||||
)
|
||||
@SupportedPlatforms(platforms: [
|
||||
IOSPlatform(
|
||||
apiName: "URLProtectionSpace.distinguishedNames",
|
||||
apiUrl: "https://developer.apple.com/documentation/foundation/urlprotectionspace/1417061-distinguishednames"
|
||||
)
|
||||
])
|
||||
List<X509Certificate>? distinguishedNames;
|
||||
|
||||
///Use [receivesCredentialSecurely] instead.
|
||||
@ -82,29 +90,28 @@ class URLProtectionSpace_ {
|
||||
|
||||
///A Boolean value that indicates whether the credentials for the protection space can be sent securely.
|
||||
///This value is `true` if the credentials for the protection space represented by the receiver can be sent securely, `false` otherwise.
|
||||
///
|
||||
///**NOTE**: available only on iOS.
|
||||
@SupportedPlatforms(platforms: [
|
||||
IOSPlatform(
|
||||
apiName: "URLProtectionSpace.receivesCredentialSecurely",
|
||||
apiUrl: "https://developer.apple.com/documentation/foundation/urlprotectionspace/1415176-receivescredentialsecurely"
|
||||
)
|
||||
])
|
||||
bool? receivesCredentialSecurely;
|
||||
|
||||
///Use [isProxy] instead.
|
||||
@Deprecated("Use isProxy instead")
|
||||
bool? iosIsProxy;
|
||||
|
||||
///Returns a Boolean value that indicates whether the receiver does not descend from `NSObject`.
|
||||
///
|
||||
///**NOTE**: available only on iOS.
|
||||
bool? isProxy;
|
||||
|
||||
///Use [proxyType] instead.
|
||||
@Deprecated("Use proxyType instead")
|
||||
IOSNSURLProtectionSpaceProxyType? iosProxyType;
|
||||
IOSNSURLProtectionSpaceProxyType_? iosProxyType;
|
||||
|
||||
///The receiver's proxy type.
|
||||
///This value is `null` if the receiver does not represent a proxy protection space.
|
||||
///The supported proxy types are listed in [URLProtectionSpaceProxyType.values].
|
||||
///
|
||||
///**NOTE**: available only on iOS.
|
||||
URLProtectionSpaceProxyType? proxyType;
|
||||
@SupportedPlatforms(platforms: [
|
||||
IOSPlatform(
|
||||
apiName: "URLProtectionSpace.proxyType",
|
||||
apiUrl: "https://developer.apple.com/documentation/foundation/urlprotectionspace/1411924-proxytype"
|
||||
)
|
||||
])
|
||||
URLProtectionSpaceProxyType_? proxyType;
|
||||
|
||||
URLProtectionSpace_(
|
||||
{required this.host,
|
||||
@ -122,9 +129,6 @@ class URLProtectionSpace_ {
|
||||
@Deprecated("Use receivesCredentialSecurely instead")
|
||||
this.iosReceivesCredentialSecurely,
|
||||
this.receivesCredentialSecurely,
|
||||
@Deprecated("Use isProxy instead")
|
||||
this.iosIsProxy,
|
||||
this.isProxy,
|
||||
@Deprecated("Use proxyType instead")
|
||||
this.iosProxyType,
|
||||
this.proxyType});
|
||||
|
@ -26,7 +26,7 @@ class URLProtectionSpace {
|
||||
SslCertificate? sslCertificate;
|
||||
|
||||
///The SSL Error associated.
|
||||
SslError? sslError;
|
||||
dynamic sslError;
|
||||
|
||||
///Use [authenticationMethod] instead.
|
||||
@Deprecated('Use authenticationMethod instead')
|
||||
@ -34,7 +34,8 @@ class URLProtectionSpace {
|
||||
|
||||
///The authentication method used by the receiver.
|
||||
///
|
||||
///**NOTE**: available only on iOS.
|
||||
///**Supported Platforms/Implementations**:
|
||||
///- iOS ([Official API - URLProtectionSpace.authenticationMethod](https://developer.apple.com/documentation/foundation/urlprotectionspace/1415028-authenticationmethod))
|
||||
URLProtectionSpaceAuthenticationMethod? authenticationMethod;
|
||||
|
||||
///Use [distinguishedNames] instead.
|
||||
@ -45,7 +46,8 @@ class URLProtectionSpace {
|
||||
///This value is `null` if the authentication method of the protection space is not client certificate.
|
||||
///The returned issuing authorities are encoded with Distinguished Encoding Rules (DER).
|
||||
///
|
||||
///**NOTE**: available only on iOS.
|
||||
///**Supported Platforms/Implementations**:
|
||||
///- iOS ([Official API - URLProtectionSpace.distinguishedNames](https://developer.apple.com/documentation/foundation/urlprotectionspace/1417061-distinguishednames))
|
||||
List<X509Certificate>? distinguishedNames;
|
||||
|
||||
///Use [receivesCredentialSecurely] instead.
|
||||
@ -55,28 +57,21 @@ class URLProtectionSpace {
|
||||
///A Boolean value that indicates whether the credentials for the protection space can be sent securely.
|
||||
///This value is `true` if the credentials for the protection space represented by the receiver can be sent securely, `false` otherwise.
|
||||
///
|
||||
///**NOTE**: available only on iOS.
|
||||
///**Supported Platforms/Implementations**:
|
||||
///- iOS ([Official API - URLProtectionSpace.receivesCredentialSecurely](https://developer.apple.com/documentation/foundation/urlprotectionspace/1415176-receivescredentialsecurely))
|
||||
bool? receivesCredentialSecurely;
|
||||
|
||||
///Use [isProxy] instead.
|
||||
@Deprecated('Use isProxy instead')
|
||||
bool? iosIsProxy;
|
||||
|
||||
///Returns a Boolean value that indicates whether the receiver does not descend from `NSObject`.
|
||||
///
|
||||
///**NOTE**: available only on iOS.
|
||||
bool? isProxy;
|
||||
|
||||
///Use [proxyType] instead.
|
||||
@Deprecated('Use proxyType instead')
|
||||
IOSNSURLProtectionSpaceProxyType? iosProxyType;
|
||||
dynamic iosProxyType;
|
||||
|
||||
///The receiver's proxy type.
|
||||
///This value is `null` if the receiver does not represent a proxy protection space.
|
||||
///The supported proxy types are listed in [URLProtectionSpaceProxyType.values].
|
||||
///
|
||||
///**NOTE**: available only on iOS.
|
||||
URLProtectionSpaceProxyType? proxyType;
|
||||
///**Supported Platforms/Implementations**:
|
||||
///- iOS ([Official API - URLProtectionSpace.proxyType](https://developer.apple.com/documentation/foundation/urlprotectionspace/1411924-proxytype))
|
||||
dynamic proxyType;
|
||||
URLProtectionSpace(
|
||||
{required this.host,
|
||||
this.protocol,
|
||||
@ -93,9 +88,6 @@ class URLProtectionSpace {
|
||||
@Deprecated('Use receivesCredentialSecurely instead')
|
||||
this.iosReceivesCredentialSecurely,
|
||||
this.receivesCredentialSecurely,
|
||||
@Deprecated('Use isProxy instead')
|
||||
this.iosIsProxy,
|
||||
this.isProxy,
|
||||
@Deprecated('Use proxyType instead')
|
||||
this.iosProxyType,
|
||||
this.proxyType}) {
|
||||
@ -105,9 +97,7 @@ class URLProtectionSpace {
|
||||
distinguishedNames = distinguishedNames ?? iosDistinguishedNames;
|
||||
receivesCredentialSecurely =
|
||||
receivesCredentialSecurely ?? iosReceivesCredentialSecurely;
|
||||
isProxy = isProxy ?? iosIsProxy;
|
||||
proxyType = proxyType ??
|
||||
URLProtectionSpaceProxyType.fromValue(iosProxyType?.toValue());
|
||||
proxyType = proxyType ?? iosProxyType;
|
||||
}
|
||||
|
||||
///Gets a possible [URLProtectionSpace] instance from a [Map] value.
|
||||
@ -123,8 +113,7 @@ class URLProtectionSpace {
|
||||
instance.port = map['port'];
|
||||
instance.sslCertificate =
|
||||
SslCertificate.fromMap(map['sslCertificate']?.cast<String, dynamic>());
|
||||
instance.sslError =
|
||||
SslError.fromMap(map['sslError']?.cast<String, dynamic>());
|
||||
instance.sslError = map['sslError'];
|
||||
instance.iosAuthenticationMethod =
|
||||
IOSNSURLProtectionSpaceAuthenticationMethod.fromNativeValue(
|
||||
map['authenticationMethod']);
|
||||
@ -137,12 +126,8 @@ class URLProtectionSpace {
|
||||
_distinguishedNamesDeserializer(map['distinguishedNames']);
|
||||
instance.iosReceivesCredentialSecurely = map['receivesCredentialSecurely'];
|
||||
instance.receivesCredentialSecurely = map['receivesCredentialSecurely'];
|
||||
instance.iosIsProxy = map['isProxy'];
|
||||
instance.isProxy = map['isProxy'];
|
||||
instance.iosProxyType =
|
||||
IOSNSURLProtectionSpaceProxyType.fromValue(map['proxyType']);
|
||||
instance.proxyType =
|
||||
URLProtectionSpaceProxyType.fromValue(map['proxyType']);
|
||||
instance.iosProxyType = map['proxyType'];
|
||||
instance.proxyType = map['proxyType'];
|
||||
return instance;
|
||||
}
|
||||
|
||||
@ -154,12 +139,11 @@ class URLProtectionSpace {
|
||||
"realm": realm,
|
||||
"port": port,
|
||||
"sslCertificate": sslCertificate?.toMap(),
|
||||
"sslError": sslError?.toMap(),
|
||||
"sslError": sslError,
|
||||
"authenticationMethod": authenticationMethod?.toNativeValue(),
|
||||
"distinguishedNames": distinguishedNames?.map((e) => e.toMap()).toList(),
|
||||
"receivesCredentialSecurely": receivesCredentialSecurely,
|
||||
"isProxy": isProxy,
|
||||
"proxyType": proxyType?.toValue(),
|
||||
"proxyType": proxyType,
|
||||
};
|
||||
}
|
||||
|
||||
@ -170,6 +154,6 @@ class URLProtectionSpace {
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'URLProtectionSpace{host: $host, protocol: $protocol, realm: $realm, port: $port, sslCertificate: $sslCertificate, sslError: $sslError, authenticationMethod: $authenticationMethod, distinguishedNames: $distinguishedNames, receivesCredentialSecurely: $receivesCredentialSecurely, isProxy: $isProxy, proxyType: $proxyType}';
|
||||
return 'URLProtectionSpace{host: $host, protocol: $protocol, realm: $realm, port: $port, sslCertificate: $sslCertificate, sslError: $sslError, authenticationMethod: $authenticationMethod, distinguishedNames: $distinguishedNames, receivesCredentialSecurely: $receivesCredentialSecurely, proxyType: $proxyType}';
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,15 @@
|
||||
import 'dart:typed_data';
|
||||
import 'package:flutter_inappwebview/src/types/url_request_attribution.dart';
|
||||
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
|
||||
|
||||
import 'url_request_cache_policy.dart';
|
||||
import 'url_request_network_service_type.dart';
|
||||
import 'url_request_attribution.dart';
|
||||
|
||||
part 'url_request.g.dart';
|
||||
|
||||
///A URL load request that is independent of protocol or URL scheme.
|
||||
class URLRequest {
|
||||
@ExchangeableObject()
|
||||
class URLRequest_ {
|
||||
///The URL of the request. Setting this to `null` will load `about:blank`.
|
||||
Uri? url;
|
||||
|
||||
@ -25,8 +29,12 @@ class URLRequest {
|
||||
bool? iosAllowsCellularAccess;
|
||||
|
||||
///A Boolean value indicating whether the request is allowed to use the built-in cellular radios to satisfy the request.
|
||||
///
|
||||
///**NOTE**: available only on iOS.
|
||||
@SupportedPlatforms(platforms: [
|
||||
IOSPlatform(
|
||||
apiName: "URLRequest.allowsCellularAccess",
|
||||
apiUrl: "https://developer.apple.com/documentation/foundation/urlrequest/2011607-allowscellularaccess/"
|
||||
)
|
||||
])
|
||||
bool? allowsCellularAccess;
|
||||
|
||||
///Use [allowsConstrainedNetworkAccess] instead.
|
||||
@ -34,8 +42,13 @@ class URLRequest {
|
||||
bool? iosAllowsConstrainedNetworkAccess;
|
||||
|
||||
///A Boolean value that indicates whether the request may use the network when the user has specified Low Data Mode.
|
||||
///
|
||||
///**NOTE**: available only on iOS 13.0+.
|
||||
@SupportedPlatforms(platforms: [
|
||||
IOSPlatform(
|
||||
available: "13.0",
|
||||
apiName: "URLRequest.allowsConstrainedNetworkAccess",
|
||||
apiUrl: "https://developer.apple.com/documentation/foundation/urlrequest/3358304-allowsconstrainednetworkaccess"
|
||||
)
|
||||
])
|
||||
bool? allowsConstrainedNetworkAccess;
|
||||
|
||||
///Use [allowsExpensiveNetworkAccess] instead.
|
||||
@ -43,26 +56,39 @@ class URLRequest {
|
||||
bool? iosAllowsExpensiveNetworkAccess;
|
||||
|
||||
///A Boolean value that indicates whether connections may use a network interface that the system considers expensive.
|
||||
///
|
||||
///**NOTE**: available only on iOS 13.0+.
|
||||
@SupportedPlatforms(platforms: [
|
||||
IOSPlatform(
|
||||
available: "13.0",
|
||||
apiName: "URLRequest.allowsExpensiveNetworkAccess",
|
||||
apiUrl: "https://developer.apple.com/documentation/foundation/urlrequest/3358305-allowsexpensivenetworkaccess"
|
||||
)
|
||||
])
|
||||
bool? allowsExpensiveNetworkAccess;
|
||||
|
||||
///Use [cachePolicy] instead.
|
||||
@Deprecated("Use cachePolicy instead")
|
||||
IOSURLRequestCachePolicy? iosCachePolicy;
|
||||
IOSURLRequestCachePolicy_? iosCachePolicy;
|
||||
|
||||
///The request’s cache policy.
|
||||
///
|
||||
///**NOTE**: available only on iOS.
|
||||
URLRequestCachePolicy? cachePolicy;
|
||||
@SupportedPlatforms(platforms: [
|
||||
IOSPlatform(
|
||||
apiName: "URLRequest.cachePolicy",
|
||||
apiUrl: "https://developer.apple.com/documentation/foundation/urlrequest/2011593-cachepolicy"
|
||||
)
|
||||
])
|
||||
URLRequestCachePolicy_? cachePolicy;
|
||||
|
||||
///Use [httpShouldHandleCookies] instead.
|
||||
@Deprecated("Use httpShouldHandleCookies instead")
|
||||
bool? iosHttpShouldHandleCookies;
|
||||
|
||||
///A Boolean value indicating whether cookies will be sent with and set for this request.
|
||||
///
|
||||
///**NOTE**: available only on iOS.
|
||||
@SupportedPlatforms(platforms: [
|
||||
IOSPlatform(
|
||||
apiName: "URLRequest.httpShouldHandleCookies",
|
||||
apiUrl: "https://developer.apple.com/documentation/foundation/urlrequest/2011548-httpshouldhandlecookies"
|
||||
)
|
||||
])
|
||||
bool? httpShouldHandleCookies;
|
||||
|
||||
///Use [httpShouldUsePipelining] instead.
|
||||
@ -70,26 +96,38 @@ class URLRequest {
|
||||
bool? iosHttpShouldUsePipelining;
|
||||
|
||||
///A Boolean value indicating whether the request should transmit before the previous response is received.
|
||||
///
|
||||
///**NOTE**: available only on iOS.
|
||||
@SupportedPlatforms(platforms: [
|
||||
IOSPlatform(
|
||||
apiName: "URLRequest.httpShouldUsePipelining",
|
||||
apiUrl: "https://developer.apple.com/documentation/foundation/urlrequest/2011508-httpshouldusepipelining"
|
||||
)
|
||||
])
|
||||
bool? httpShouldUsePipelining;
|
||||
|
||||
///Use [networkServiceType] instead.
|
||||
@Deprecated("Use networkServiceType instead")
|
||||
IOSURLRequestNetworkServiceType? iosNetworkServiceType;
|
||||
IOSURLRequestNetworkServiceType_? iosNetworkServiceType;
|
||||
|
||||
///The service type associated with this request.
|
||||
///
|
||||
///**NOTE**: available only on iOS.
|
||||
URLRequestNetworkServiceType? networkServiceType;
|
||||
@SupportedPlatforms(platforms: [
|
||||
IOSPlatform(
|
||||
apiName: "URLRequest.networkServiceType",
|
||||
apiUrl: "https://developer.apple.com/documentation/foundation/urlrequest/2011409-networkservicetype"
|
||||
)
|
||||
])
|
||||
URLRequestNetworkServiceType_? networkServiceType;
|
||||
|
||||
///Use [timeoutInterval] instead.
|
||||
@Deprecated("Use timeoutInterval instead")
|
||||
double? iosTimeoutInterval;
|
||||
|
||||
///The timeout interval of the request.
|
||||
///
|
||||
///**NOTE**: available only on iOS.
|
||||
@SupportedPlatforms(platforms: [
|
||||
IOSPlatform(
|
||||
apiName: "URLRequest.timeoutInterval",
|
||||
apiUrl: "https://developer.apple.com/documentation/foundation/urlrequest/2011509-timeoutinterval"
|
||||
)
|
||||
])
|
||||
double? timeoutInterval;
|
||||
|
||||
///Use [mainDocumentURL] instead.
|
||||
@ -98,25 +136,39 @@ class URLRequest {
|
||||
|
||||
///The main document URL associated with this request.
|
||||
///This URL is used for the cookie “same domain as main document” policy.
|
||||
///
|
||||
///**NOTE**: available only on iOS.
|
||||
@SupportedPlatforms(platforms: [
|
||||
IOSPlatform(
|
||||
apiName: "URLRequest.mainDocumentURL",
|
||||
apiUrl: "https://developer.apple.com/documentation/foundation/urlrequest/2011552-maindocumenturl"
|
||||
)
|
||||
])
|
||||
Uri? mainDocumentURL;
|
||||
|
||||
///`true` if server endpoint is known to support HTTP/3. Enables QUIC racing
|
||||
///without HTTP/3 service discovery. Defaults to `false`.
|
||||
///The default may be `true` in a future OS update.
|
||||
///
|
||||
///**NOTE**: available only on iOS 14.5+.
|
||||
@SupportedPlatforms(platforms: [
|
||||
IOSPlatform(
|
||||
available: "14.5",
|
||||
apiName: "URLRequest.assumesHTTP3Capable",
|
||||
apiUrl: "https://developer.apple.com/documentation/foundation/urlrequest/3738175-assumeshttp3capable"
|
||||
)
|
||||
])
|
||||
bool? assumesHTTP3Capable;
|
||||
|
||||
///The entities that can make a network request.
|
||||
///
|
||||
///If you don’t set a value, the system assumes [URLRequestAttribution.DEVELOPER].
|
||||
///
|
||||
///**NOTE**: available only on iOS 15.0+.
|
||||
URLRequestAttribution? attribution;
|
||||
@SupportedPlatforms(platforms: [
|
||||
IOSPlatform(
|
||||
available: "15.0",
|
||||
apiName: "URLRequest.attribution",
|
||||
apiUrl: "https://developer.apple.com/documentation/foundation/urlrequest/3767318-attribution"
|
||||
)
|
||||
])
|
||||
URLRequestAttribution_? attribution;
|
||||
|
||||
URLRequest({
|
||||
URLRequest_({
|
||||
required this.url,
|
||||
this.method,
|
||||
this.headers,
|
||||
@ -146,150 +198,5 @@ class URLRequest {
|
||||
this.mainDocumentURL,
|
||||
this.assumesHTTP3Capable,
|
||||
this.attribution
|
||||
}) {
|
||||
this.allowsCellularAccess =
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.allowsCellularAccess ?? this.iosAllowsCellularAccess;
|
||||
this.allowsConstrainedNetworkAccess = this.allowsConstrainedNetworkAccess ??
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.iosAllowsConstrainedNetworkAccess;
|
||||
this.allowsExpensiveNetworkAccess = this.allowsExpensiveNetworkAccess ??
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.iosAllowsExpensiveNetworkAccess;
|
||||
this.cachePolicy = this.cachePolicy ??
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
URLRequestCachePolicy.fromValue(this.iosCachePolicy?.toValue());
|
||||
this.httpShouldHandleCookies =
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.httpShouldHandleCookies ?? this.iosHttpShouldHandleCookies;
|
||||
this.httpShouldUsePipelining =
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.httpShouldUsePipelining ?? this.iosHttpShouldUsePipelining;
|
||||
this.networkServiceType =
|
||||
this.networkServiceType ?? URLRequestNetworkServiceType.fromValue(
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.iosNetworkServiceType?.toValue());
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.timeoutInterval = this.timeoutInterval ?? this.iosTimeoutInterval;
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
this.mainDocumentURL = this.mainDocumentURL ?? this.iosMainDocumentURL;
|
||||
}
|
||||
|
||||
///Gets a possible [URLRequest] instance from a [Map] value.
|
||||
static URLRequest? fromMap(Map<String, dynamic>? map) {
|
||||
if (map == null) {
|
||||
return null;
|
||||
}
|
||||
return URLRequest(
|
||||
url: map["url"] != null ? Uri.parse(map["url"]) : null,
|
||||
headers: map["headers"]?.cast<String, String>(),
|
||||
method: map["method"],
|
||||
body: map["body"],
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
iosAllowsCellularAccess: map["allowsCellularAccess"],
|
||||
allowsCellularAccess: map["allowsCellularAccess"],
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
iosAllowsConstrainedNetworkAccess: map["allowsConstrainedNetworkAccess"],
|
||||
allowsConstrainedNetworkAccess: map["allowsConstrainedNetworkAccess"],
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
iosAllowsExpensiveNetworkAccess: map["allowsExpensiveNetworkAccess"],
|
||||
allowsExpensiveNetworkAccess: map["allowsExpensiveNetworkAccess"],
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
iosCachePolicy: IOSURLRequestCachePolicy.fromValue(map["cachePolicy"]),
|
||||
cachePolicy: URLRequestCachePolicy.fromValue(map["cachePolicy"]),
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
iosHttpShouldHandleCookies: map["httpShouldHandleCookies"],
|
||||
httpShouldHandleCookies: map["httpShouldHandleCookies"],
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
iosHttpShouldUsePipelining: map["httpShouldUsePipelining"],
|
||||
httpShouldUsePipelining: map["httpShouldUsePipelining"],
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
iosNetworkServiceType:
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
IOSURLRequestNetworkServiceType.fromValue(map["networkServiceType"]),
|
||||
networkServiceType:
|
||||
URLRequestNetworkServiceType.fromValue(map["networkServiceType"]),
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
iosTimeoutInterval: map["timeoutInterval"],
|
||||
timeoutInterval: map["timeoutInterval"],
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
iosMainDocumentURL: map["mainDocumentURL"] != null
|
||||
? Uri.parse(map["mainDocumentURL"])
|
||||
: null,
|
||||
mainDocumentURL: map["mainDocumentURL"] != null
|
||||
? Uri.parse(map["mainDocumentURL"])
|
||||
: null,
|
||||
assumesHTTP3Capable: map["assumesHTTP3Capable"],
|
||||
attribution: URLRequestAttribution.fromValue(map["attribution"])
|
||||
);
|
||||
}
|
||||
|
||||
///Converts instance to a map.
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"url": url?.toString(),
|
||||
"headers": headers,
|
||||
"method": method,
|
||||
"body": body,
|
||||
"iosAllowsCellularAccess":
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
allowsCellularAccess ?? iosAllowsCellularAccess,
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"allowsCellularAccess": allowsCellularAccess ?? iosAllowsCellularAccess,
|
||||
"iosAllowsConstrainedNetworkAccess":
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
allowsConstrainedNetworkAccess ?? iosAllowsConstrainedNetworkAccess,
|
||||
"allowsConstrainedNetworkAccess":
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
allowsConstrainedNetworkAccess ?? iosAllowsConstrainedNetworkAccess,
|
||||
"iosAllowsExpensiveNetworkAccess":
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
allowsExpensiveNetworkAccess ?? iosAllowsExpensiveNetworkAccess,
|
||||
"allowsExpensiveNetworkAccess":
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
allowsExpensiveNetworkAccess ?? iosAllowsExpensiveNetworkAccess,
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"iosCachePolicy": cachePolicy?.toValue() ?? iosCachePolicy?.toValue(),
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"cachePolicy": cachePolicy?.toValue() ?? iosCachePolicy?.toValue(),
|
||||
"iosHttpShouldHandleCookies":
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
httpShouldHandleCookies ?? iosHttpShouldHandleCookies,
|
||||
"httpShouldHandleCookies":
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
httpShouldHandleCookies ?? iosHttpShouldHandleCookies,
|
||||
"iosHttpShouldUsePipelining":
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
httpShouldUsePipelining ?? iosHttpShouldUsePipelining,
|
||||
"httpShouldUsePipelining":
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
httpShouldUsePipelining ?? iosHttpShouldUsePipelining,
|
||||
"iosNetworkServiceType":
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
networkServiceType?.toValue() ?? iosNetworkServiceType?.toValue(),
|
||||
"networkServiceType":
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
networkServiceType?.toValue() ?? iosNetworkServiceType?.toValue(),
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"iosTimeoutInterval": timeoutInterval ?? iosTimeoutInterval,
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"timeoutInterval": timeoutInterval ?? iosTimeoutInterval,
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"iosMainDocumentURL": (mainDocumentURL ?? iosMainDocumentURL)?.toString(),
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
"mainDocumentURL": (mainDocumentURL ?? iosMainDocumentURL)?.toString(),
|
||||
"assumesHTTP3Capable": assumesHTTP3Capable,
|
||||
"attribution": attribution?.toValue(),
|
||||
};
|
||||
}
|
||||
|
||||
///Converts instance to a map.
|
||||
Map<String, dynamic> toJson() {
|
||||
return this.toMap();
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toMap().toString();
|
||||
}
|
||||
});
|
||||
}
|
260
lib/src/types/url_request.g.dart
Normal file
260
lib/src/types/url_request.g.dart
Normal file
@ -0,0 +1,260 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'url_request.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// ExchangeableObjectGenerator
|
||||
// **************************************************************************
|
||||
|
||||
///A URL load request that is independent of protocol or URL scheme.
|
||||
class URLRequest {
|
||||
///The URL of the request. Setting this to `null` will load `about:blank`.
|
||||
Uri? url;
|
||||
|
||||
///The HTTP request method.
|
||||
///
|
||||
///**NOTE for Android**: it supports only "GET" and "POST" methods.
|
||||
String? method;
|
||||
|
||||
///The data sent as the message body of a request, such as for an HTTP POST request.
|
||||
Uint8List? body;
|
||||
|
||||
///A dictionary containing all of the HTTP header fields for a request.
|
||||
Map<String, String>? headers;
|
||||
|
||||
///Use [allowsCellularAccess] instead.
|
||||
@Deprecated('Use allowsCellularAccess instead')
|
||||
bool? iosAllowsCellularAccess;
|
||||
|
||||
///A Boolean value indicating whether the request is allowed to use the built-in cellular radios to satisfy the request.
|
||||
///
|
||||
///**Supported Platforms/Implementations**:
|
||||
///- iOS ([Official API - URLRequest.allowsCellularAccess](https://developer.apple.com/documentation/foundation/urlrequest/2011607-allowscellularaccess/))
|
||||
bool? allowsCellularAccess;
|
||||
|
||||
///Use [allowsConstrainedNetworkAccess] instead.
|
||||
@Deprecated('Use allowsConstrainedNetworkAccess instead')
|
||||
bool? iosAllowsConstrainedNetworkAccess;
|
||||
|
||||
///A Boolean value that indicates whether the request may use the network when the user has specified Low Data Mode.
|
||||
///
|
||||
///**Supported Platforms/Implementations**:
|
||||
///- iOS 13.0+ ([Official API - URLRequest.allowsConstrainedNetworkAccess](https://developer.apple.com/documentation/foundation/urlrequest/3358304-allowsconstrainednetworkaccess))
|
||||
bool? allowsConstrainedNetworkAccess;
|
||||
|
||||
///Use [allowsExpensiveNetworkAccess] instead.
|
||||
@Deprecated('Use allowsExpensiveNetworkAccess instead')
|
||||
bool? iosAllowsExpensiveNetworkAccess;
|
||||
|
||||
///A Boolean value that indicates whether connections may use a network interface that the system considers expensive.
|
||||
///
|
||||
///**Supported Platforms/Implementations**:
|
||||
///- iOS 13.0+ ([Official API - URLRequest.allowsExpensiveNetworkAccess](https://developer.apple.com/documentation/foundation/urlrequest/3358305-allowsexpensivenetworkaccess))
|
||||
bool? allowsExpensiveNetworkAccess;
|
||||
|
||||
///Use [cachePolicy] instead.
|
||||
@Deprecated('Use cachePolicy instead')
|
||||
IOSURLRequestCachePolicy? iosCachePolicy;
|
||||
|
||||
///The request’s cache policy.
|
||||
///
|
||||
///**Supported Platforms/Implementations**:
|
||||
///- iOS ([Official API - URLRequest.cachePolicy](https://developer.apple.com/documentation/foundation/urlrequest/2011593-cachepolicy))
|
||||
URLRequestCachePolicy? cachePolicy;
|
||||
|
||||
///Use [httpShouldHandleCookies] instead.
|
||||
@Deprecated('Use httpShouldHandleCookies instead')
|
||||
bool? iosHttpShouldHandleCookies;
|
||||
|
||||
///A Boolean value indicating whether cookies will be sent with and set for this request.
|
||||
///
|
||||
///**Supported Platforms/Implementations**:
|
||||
///- iOS ([Official API - URLRequest.httpShouldHandleCookies](https://developer.apple.com/documentation/foundation/urlrequest/2011548-httpshouldhandlecookies))
|
||||
bool? httpShouldHandleCookies;
|
||||
|
||||
///Use [httpShouldUsePipelining] instead.
|
||||
@Deprecated('Use httpShouldUsePipelining instead')
|
||||
bool? iosHttpShouldUsePipelining;
|
||||
|
||||
///A Boolean value indicating whether the request should transmit before the previous response is received.
|
||||
///
|
||||
///**Supported Platforms/Implementations**:
|
||||
///- iOS ([Official API - URLRequest.httpShouldUsePipelining](https://developer.apple.com/documentation/foundation/urlrequest/2011508-httpshouldusepipelining))
|
||||
bool? httpShouldUsePipelining;
|
||||
|
||||
///Use [networkServiceType] instead.
|
||||
@Deprecated('Use networkServiceType instead')
|
||||
IOSURLRequestNetworkServiceType? iosNetworkServiceType;
|
||||
|
||||
///The service type associated with this request.
|
||||
///
|
||||
///**Supported Platforms/Implementations**:
|
||||
///- iOS ([Official API - URLRequest.networkServiceType](https://developer.apple.com/documentation/foundation/urlrequest/2011409-networkservicetype))
|
||||
URLRequestNetworkServiceType? networkServiceType;
|
||||
|
||||
///Use [timeoutInterval] instead.
|
||||
@Deprecated('Use timeoutInterval instead')
|
||||
double? iosTimeoutInterval;
|
||||
|
||||
///The timeout interval of the request.
|
||||
///
|
||||
///**Supported Platforms/Implementations**:
|
||||
///- iOS ([Official API - URLRequest.timeoutInterval](https://developer.apple.com/documentation/foundation/urlrequest/2011509-timeoutinterval))
|
||||
double? timeoutInterval;
|
||||
|
||||
///Use [mainDocumentURL] instead.
|
||||
@Deprecated('Use mainDocumentURL instead')
|
||||
Uri? iosMainDocumentURL;
|
||||
|
||||
///The main document URL associated with this request.
|
||||
///This URL is used for the cookie “same domain as main document” policy.
|
||||
///
|
||||
///**Supported Platforms/Implementations**:
|
||||
///- iOS ([Official API - URLRequest.mainDocumentURL](https://developer.apple.com/documentation/foundation/urlrequest/2011552-maindocumenturl))
|
||||
Uri? mainDocumentURL;
|
||||
|
||||
///`true` if server endpoint is known to support HTTP/3. Enables QUIC racing
|
||||
///without HTTP/3 service discovery. Defaults to `false`.
|
||||
///The default may be `true` in a future OS update.
|
||||
///
|
||||
///**Supported Platforms/Implementations**:
|
||||
///- iOS 14.5+ ([Official API - URLRequest.assumesHTTP3Capable](https://developer.apple.com/documentation/foundation/urlrequest/3738175-assumeshttp3capable))
|
||||
bool? assumesHTTP3Capable;
|
||||
|
||||
///The entities that can make a network request.
|
||||
///
|
||||
///If you don’t set a value, the system assumes [URLRequestAttribution.DEVELOPER].
|
||||
///
|
||||
///**Supported Platforms/Implementations**:
|
||||
///- iOS 15.0+ ([Official API - URLRequest.attribution](https://developer.apple.com/documentation/foundation/urlrequest/3767318-attribution))
|
||||
URLRequestAttribution? attribution;
|
||||
URLRequest(
|
||||
{this.url,
|
||||
this.method,
|
||||
this.body,
|
||||
this.headers,
|
||||
@Deprecated('Use allowsCellularAccess instead')
|
||||
this.iosAllowsCellularAccess,
|
||||
this.allowsCellularAccess,
|
||||
@Deprecated('Use allowsConstrainedNetworkAccess instead')
|
||||
this.iosAllowsConstrainedNetworkAccess,
|
||||
this.allowsConstrainedNetworkAccess,
|
||||
@Deprecated('Use allowsExpensiveNetworkAccess instead')
|
||||
this.iosAllowsExpensiveNetworkAccess,
|
||||
this.allowsExpensiveNetworkAccess,
|
||||
@Deprecated('Use cachePolicy instead')
|
||||
this.iosCachePolicy,
|
||||
this.cachePolicy,
|
||||
@Deprecated('Use httpShouldHandleCookies instead')
|
||||
this.iosHttpShouldHandleCookies,
|
||||
this.httpShouldHandleCookies,
|
||||
@Deprecated('Use httpShouldUsePipelining instead')
|
||||
this.iosHttpShouldUsePipelining,
|
||||
this.httpShouldUsePipelining,
|
||||
@Deprecated('Use networkServiceType instead')
|
||||
this.iosNetworkServiceType,
|
||||
this.networkServiceType,
|
||||
@Deprecated('Use timeoutInterval instead')
|
||||
this.iosTimeoutInterval,
|
||||
this.timeoutInterval,
|
||||
@Deprecated('Use mainDocumentURL instead')
|
||||
this.iosMainDocumentURL,
|
||||
this.mainDocumentURL,
|
||||
this.assumesHTTP3Capable,
|
||||
this.attribution}) {
|
||||
allowsCellularAccess = allowsCellularAccess ?? iosAllowsCellularAccess;
|
||||
allowsConstrainedNetworkAccess =
|
||||
allowsConstrainedNetworkAccess ?? iosAllowsConstrainedNetworkAccess;
|
||||
allowsExpensiveNetworkAccess =
|
||||
allowsExpensiveNetworkAccess ?? iosAllowsExpensiveNetworkAccess;
|
||||
cachePolicy = cachePolicy ??
|
||||
URLRequestCachePolicy.fromNativeValue(iosCachePolicy?.toNativeValue());
|
||||
httpShouldHandleCookies =
|
||||
httpShouldHandleCookies ?? iosHttpShouldHandleCookies;
|
||||
httpShouldUsePipelining =
|
||||
httpShouldUsePipelining ?? iosHttpShouldUsePipelining;
|
||||
networkServiceType = networkServiceType ??
|
||||
URLRequestNetworkServiceType.fromNativeValue(
|
||||
iosNetworkServiceType?.toNativeValue());
|
||||
timeoutInterval = timeoutInterval ?? iosTimeoutInterval;
|
||||
mainDocumentURL = mainDocumentURL ?? iosMainDocumentURL;
|
||||
}
|
||||
|
||||
///Gets a possible [URLRequest] instance from a [Map] value.
|
||||
static URLRequest? fromMap(Map<String, dynamic>? map) {
|
||||
if (map == null) {
|
||||
return null;
|
||||
}
|
||||
final instance = URLRequest(
|
||||
url: map['url'] != null ? Uri.parse(map['url']) : null,
|
||||
);
|
||||
instance.method = map['method'];
|
||||
instance.body = map['body'];
|
||||
instance.headers = map['headers'];
|
||||
instance.iosAllowsCellularAccess = map['allowsCellularAccess'];
|
||||
instance.allowsCellularAccess = map['allowsCellularAccess'];
|
||||
instance.iosAllowsConstrainedNetworkAccess =
|
||||
map['allowsConstrainedNetworkAccess'];
|
||||
instance.allowsConstrainedNetworkAccess =
|
||||
map['allowsConstrainedNetworkAccess'];
|
||||
instance.iosAllowsExpensiveNetworkAccess =
|
||||
map['allowsExpensiveNetworkAccess'];
|
||||
instance.allowsExpensiveNetworkAccess = map['allowsExpensiveNetworkAccess'];
|
||||
instance.iosCachePolicy =
|
||||
IOSURLRequestCachePolicy.fromNativeValue(map['cachePolicy']);
|
||||
instance.cachePolicy =
|
||||
URLRequestCachePolicy.fromNativeValue(map['cachePolicy']);
|
||||
instance.iosHttpShouldHandleCookies = map['httpShouldHandleCookies'];
|
||||
instance.httpShouldHandleCookies = map['httpShouldHandleCookies'];
|
||||
instance.iosHttpShouldUsePipelining = map['httpShouldUsePipelining'];
|
||||
instance.httpShouldUsePipelining = map['httpShouldUsePipelining'];
|
||||
instance.iosNetworkServiceType =
|
||||
IOSURLRequestNetworkServiceType.fromNativeValue(
|
||||
map['networkServiceType']);
|
||||
instance.networkServiceType =
|
||||
URLRequestNetworkServiceType.fromNativeValue(map['networkServiceType']);
|
||||
instance.iosTimeoutInterval = map['timeoutInterval'];
|
||||
instance.timeoutInterval = map['timeoutInterval'];
|
||||
instance.iosMainDocumentURL = map['mainDocumentURL'] != null
|
||||
? Uri.parse(map['mainDocumentURL'])
|
||||
: null;
|
||||
instance.mainDocumentURL = map['mainDocumentURL'] != null
|
||||
? Uri.parse(map['mainDocumentURL'])
|
||||
: null;
|
||||
instance.assumesHTTP3Capable = map['assumesHTTP3Capable'];
|
||||
instance.attribution =
|
||||
URLRequestAttribution.fromNativeValue(map['attribution']);
|
||||
return instance;
|
||||
}
|
||||
|
||||
///Converts instance to a map.
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"url": url?.toString(),
|
||||
"method": method,
|
||||
"body": body,
|
||||
"headers": headers,
|
||||
"allowsCellularAccess": allowsCellularAccess,
|
||||
"allowsConstrainedNetworkAccess": allowsConstrainedNetworkAccess,
|
||||
"allowsExpensiveNetworkAccess": allowsExpensiveNetworkAccess,
|
||||
"cachePolicy": cachePolicy?.toNativeValue(),
|
||||
"httpShouldHandleCookies": httpShouldHandleCookies,
|
||||
"httpShouldUsePipelining": httpShouldUsePipelining,
|
||||
"networkServiceType": networkServiceType?.toNativeValue(),
|
||||
"timeoutInterval": timeoutInterval,
|
||||
"mainDocumentURL": mainDocumentURL?.toString(),
|
||||
"assumesHTTP3Capable": assumesHTTP3Capable,
|
||||
"attribution": attribution?.toNativeValue(),
|
||||
};
|
||||
}
|
||||
|
||||
///Converts instance to a map.
|
||||
Map<String, dynamic> toJson() {
|
||||
return toMap();
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'URLRequest{url: $url, method: $method, body: $body, headers: $headers, allowsCellularAccess: $allowsCellularAccess, allowsConstrainedNetworkAccess: $allowsConstrainedNetworkAccess, allowsExpensiveNetworkAccess: $allowsExpensiveNetworkAccess, cachePolicy: $cachePolicy, httpShouldHandleCookies: $httpShouldHandleCookies, httpShouldUsePipelining: $httpShouldUsePipelining, networkServiceType: $networkServiceType, timeoutInterval: $timeoutInterval, mainDocumentURL: $mainDocumentURL, assumesHTTP3Capable: $assumesHTTP3Capable, attribution: $attribution}';
|
||||
}
|
||||
}
|
@ -1,43 +1,15 @@
|
||||
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
|
||||
|
||||
import 'url_request.dart';
|
||||
|
||||
part 'url_request_attribution.g.dart';
|
||||
|
||||
///Class that represents the constants used to indicate the entities that can make a network request.
|
||||
class URLRequestAttribution {
|
||||
@ExchangeableEnum()
|
||||
class URLRequestAttribution_ {
|
||||
// ignore: unused_field
|
||||
final int _value;
|
||||
|
||||
const URLRequestAttribution._internal(this._value);
|
||||
|
||||
///Set of all values of [URLRequestAttribution].
|
||||
static final Set<URLRequestAttribution> values = [
|
||||
URLRequestAttribution.DEVELOPER,
|
||||
URLRequestAttribution.USER,
|
||||
].toSet();
|
||||
|
||||
///Gets a possible [URLRequestAttribution] instance from an [int] value.
|
||||
static URLRequestAttribution? fromValue(int? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return URLRequestAttribution.values
|
||||
.firstWhere((element) => element.toValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets [int] value.
|
||||
int toValue() => _value;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
switch (_value) {
|
||||
case 1:
|
||||
return "USER";
|
||||
case 0:
|
||||
default:
|
||||
return "DEVELOPER";
|
||||
}
|
||||
}
|
||||
const URLRequestAttribution_._internal(this._value);
|
||||
|
||||
///A developer-initiated network request.
|
||||
///
|
||||
@ -46,15 +18,10 @@ class URLRequestAttribution {
|
||||
///
|
||||
///For cases where the user enters a URL, like in the navigation bar of a web browser, or taps or clicks a URL to load the content it represents, use the [URLRequestAttribution.USER] value instead.
|
||||
static const DEVELOPER =
|
||||
const URLRequestAttribution._internal(0);
|
||||
const URLRequestAttribution_._internal(0);
|
||||
|
||||
///Use this value for the attribution parameter of a [URLRequest] that satisfies a user request to access an explicit, unmodified URL.
|
||||
///In all other cases, use the [URLRequestAttribution.DEVELOPER] value instead.
|
||||
static const USER =
|
||||
const URLRequestAttribution._internal(1);
|
||||
|
||||
bool operator ==(value) => value == _value;
|
||||
|
||||
@override
|
||||
int get hashCode => _value.hashCode;
|
||||
const URLRequestAttribution_._internal(1);
|
||||
}
|
85
lib/src/types/url_request_attribution.g.dart
Normal file
85
lib/src/types/url_request_attribution.g.dart
Normal file
@ -0,0 +1,85 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'url_request_attribution.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// ExchangeableEnumGenerator
|
||||
// **************************************************************************
|
||||
|
||||
///Class that represents the constants used to indicate the entities that can make a network request.
|
||||
class URLRequestAttribution {
|
||||
final int _value;
|
||||
final int _nativeValue;
|
||||
const URLRequestAttribution._internal(this._value, this._nativeValue);
|
||||
// ignore: unused_element
|
||||
factory URLRequestAttribution._internalMultiPlatform(
|
||||
int value, Function nativeValue) =>
|
||||
URLRequestAttribution._internal(value, nativeValue());
|
||||
|
||||
///A developer-initiated network request.
|
||||
///
|
||||
///Use this value for the attribution parameter of a [URLRequest] that your app makes for any purpose other than when the user explicitly accesses a link.
|
||||
///This includes requests that your app makes to get user data. This is the default value.
|
||||
///
|
||||
///For cases where the user enters a URL, like in the navigation bar of a web browser, or taps or clicks a URL to load the content it represents, use the [URLRequestAttribution.USER] value instead.
|
||||
static const DEVELOPER = URLRequestAttribution._internal(0, 0);
|
||||
|
||||
///Use this value for the attribution parameter of a [URLRequest] that satisfies a user request to access an explicit, unmodified URL.
|
||||
///In all other cases, use the [URLRequestAttribution.DEVELOPER] value instead.
|
||||
static const USER = URLRequestAttribution._internal(1, 1);
|
||||
|
||||
///Set of all values of [URLRequestAttribution].
|
||||
static final Set<URLRequestAttribution> values = [
|
||||
URLRequestAttribution.DEVELOPER,
|
||||
URLRequestAttribution.USER,
|
||||
].toSet();
|
||||
|
||||
///Gets a possible [URLRequestAttribution] instance from [int] value.
|
||||
static URLRequestAttribution? fromValue(int? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return URLRequestAttribution.values
|
||||
.firstWhere((element) => element.toValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets a possible [URLRequestAttribution] instance from a native value.
|
||||
static URLRequestAttribution? fromNativeValue(int? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return URLRequestAttribution.values
|
||||
.firstWhere((element) => element.toNativeValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets [int] value.
|
||||
int toValue() => _value;
|
||||
|
||||
///Gets [int] native value.
|
||||
int toNativeValue() => _nativeValue;
|
||||
|
||||
@override
|
||||
int get hashCode => _value.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(value) => value == _value;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
switch (_value) {
|
||||
case 0:
|
||||
return 'DEVELOPER';
|
||||
case 1:
|
||||
return 'USER';
|
||||
}
|
||||
return _value.toString();
|
||||
}
|
||||
}
|
@ -1,69 +1,29 @@
|
||||
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
|
||||
|
||||
part 'url_request_cache_policy.g.dart';
|
||||
|
||||
///Class that represents the constants used to specify interaction with the cached responses.
|
||||
class URLRequestCachePolicy {
|
||||
@ExchangeableEnum()
|
||||
class URLRequestCachePolicy_ {
|
||||
// ignore: unused_field
|
||||
final int _value;
|
||||
|
||||
const URLRequestCachePolicy._internal(this._value);
|
||||
|
||||
///Set of all values of [URLRequestCachePolicy].
|
||||
static final Set<URLRequestCachePolicy> values = [
|
||||
URLRequestCachePolicy.USE_PROTOCOL_CACHE_POLICY,
|
||||
URLRequestCachePolicy.RELOAD_IGNORING_LOCAL_CACHE_DATA,
|
||||
URLRequestCachePolicy.RELOAD_IGNORING_LOCAL_AND_REMOTE_CACHE_DATA,
|
||||
URLRequestCachePolicy.RETURN_CACHE_DATA_ELSE_LOAD,
|
||||
URLRequestCachePolicy.RETURN_CACHE_DATA_DONT_LOAD,
|
||||
URLRequestCachePolicy.RELOAD_REVALIDATING_CACHE_DATA,
|
||||
].toSet();
|
||||
|
||||
///Gets a possible [URLRequestCachePolicy] instance from an [int] value.
|
||||
static URLRequestCachePolicy? fromValue(int? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return URLRequestCachePolicy.values
|
||||
.firstWhere((element) => element.toValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets [int] value.
|
||||
int toValue() => _value;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
switch (_value) {
|
||||
case 1:
|
||||
return "RELOAD_IGNORING_LOCAL_CACHE_DATA";
|
||||
case 2:
|
||||
return "RETURN_CACHE_DATA_ELSE_LOAD";
|
||||
case 3:
|
||||
return "RETURN_CACHE_DATA_DONT_LOAD";
|
||||
case 4:
|
||||
return "RELOAD_IGNORING_LOCAL_AND_REMOTE_CACHE_DATA";
|
||||
case 5:
|
||||
return "RELOAD_REVALIDATING_CACHE_DATA";
|
||||
case 0:
|
||||
default:
|
||||
return "USE_PROTOCOL_CACHE_POLICY";
|
||||
}
|
||||
}
|
||||
const URLRequestCachePolicy_._internal(this._value);
|
||||
|
||||
///Use the caching logic defined in the protocol implementation, if any, for a particular URL load request.
|
||||
///This is the default policy for URL load requests.
|
||||
static const USE_PROTOCOL_CACHE_POLICY =
|
||||
const URLRequestCachePolicy._internal(0);
|
||||
const URLRequestCachePolicy_._internal(0);
|
||||
|
||||
///The URL load should be loaded only from the originating source.
|
||||
///This policy specifies that no existing cache data should be used to satisfy a URL load request.
|
||||
///
|
||||
///**NOTE**: Always use this policy if you are making HTTP or HTTPS byte-range requests.
|
||||
static const RELOAD_IGNORING_LOCAL_CACHE_DATA =
|
||||
const URLRequestCachePolicy._internal(1);
|
||||
const URLRequestCachePolicy_._internal(1);
|
||||
|
||||
///Use existing cache data, regardless or age or expiration date, loading from originating source only if there is no cached data.
|
||||
static const RETURN_CACHE_DATA_ELSE_LOAD =
|
||||
const URLRequestCachePolicy._internal(2);
|
||||
const URLRequestCachePolicy_._internal(2);
|
||||
|
||||
///Use existing cache data, regardless or age or expiration date, and fail if no cached data is available.
|
||||
///
|
||||
@ -71,94 +31,45 @@ class URLRequestCachePolicy {
|
||||
///no attempt is made to load the data from the originating source, and the load is considered to have failed.
|
||||
///This constant specifies a behavior that is similar to an “offline” mode.
|
||||
static const RETURN_CACHE_DATA_DONT_LOAD =
|
||||
const URLRequestCachePolicy._internal(3);
|
||||
const URLRequestCachePolicy_._internal(3);
|
||||
|
||||
///Ignore local cache data, and instruct proxies and other intermediates to disregard their caches so far as the protocol allows.
|
||||
///
|
||||
///**NOTE**: Versions earlier than macOS 15, iOS 13, watchOS 6, and tvOS 13 don’t implement this constant.
|
||||
static const RELOAD_IGNORING_LOCAL_AND_REMOTE_CACHE_DATA =
|
||||
const URLRequestCachePolicy._internal(4);
|
||||
const URLRequestCachePolicy_._internal(4);
|
||||
|
||||
///Use cache data if the origin source can validate it; otherwise, load from the origin.
|
||||
///
|
||||
///**NOTE**: Versions earlier than macOS 15, iOS 13, watchOS 6, and tvOS 13 don’t implement this constant.
|
||||
static const RELOAD_REVALIDATING_CACHE_DATA =
|
||||
const URLRequestCachePolicy._internal(5);
|
||||
|
||||
bool operator ==(value) => value == _value;
|
||||
|
||||
@override
|
||||
int get hashCode => _value.hashCode;
|
||||
const URLRequestCachePolicy_._internal(5);
|
||||
}
|
||||
|
||||
///An iOS-specific Class that represents the constants used to specify interaction with the cached responses.
|
||||
///Use [URLRequestCachePolicy] instead.
|
||||
@Deprecated("Use URLRequestCachePolicy instead")
|
||||
class IOSURLRequestCachePolicy {
|
||||
@ExchangeableEnum()
|
||||
class IOSURLRequestCachePolicy_ {
|
||||
// ignore: unused_field
|
||||
final int _value;
|
||||
|
||||
const IOSURLRequestCachePolicy._internal(this._value);
|
||||
|
||||
///Set of all values of [IOSURLRequestCachePolicy].
|
||||
static final Set<IOSURLRequestCachePolicy> values = [
|
||||
IOSURLRequestCachePolicy.USE_PROTOCOL_CACHE_POLICY,
|
||||
IOSURLRequestCachePolicy.RELOAD_IGNORING_LOCAL_CACHE_DATA,
|
||||
IOSURLRequestCachePolicy.RELOAD_IGNORING_LOCAL_AND_REMOTE_CACHE_DATA,
|
||||
IOSURLRequestCachePolicy.RETURN_CACHE_DATA_ELSE_LOAD,
|
||||
IOSURLRequestCachePolicy.RETURN_CACHE_DATA_DONT_LOAD,
|
||||
IOSURLRequestCachePolicy.RELOAD_REVALIDATING_CACHE_DATA,
|
||||
].toSet();
|
||||
|
||||
///Gets a possible [IOSURLRequestCachePolicy] instance from an [int] value.
|
||||
static IOSURLRequestCachePolicy? fromValue(int? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return IOSURLRequestCachePolicy.values
|
||||
.firstWhere((element) => element.toValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets [int] value.
|
||||
int toValue() => _value;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
switch (_value) {
|
||||
case 1:
|
||||
return "RELOAD_IGNORING_LOCAL_CACHE_DATA";
|
||||
case 2:
|
||||
return "RETURN_CACHE_DATA_ELSE_LOAD";
|
||||
case 3:
|
||||
return "RETURN_CACHE_DATA_DONT_LOAD";
|
||||
case 4:
|
||||
return "RELOAD_IGNORING_LOCAL_AND_REMOTE_CACHE_DATA";
|
||||
case 5:
|
||||
return "RELOAD_REVALIDATING_CACHE_DATA";
|
||||
case 0:
|
||||
default:
|
||||
return "USE_PROTOCOL_CACHE_POLICY";
|
||||
}
|
||||
}
|
||||
const IOSURLRequestCachePolicy_._internal(this._value);
|
||||
|
||||
///Use the caching logic defined in the protocol implementation, if any, for a particular URL load request.
|
||||
///This is the default policy for URL load requests.
|
||||
static const USE_PROTOCOL_CACHE_POLICY =
|
||||
const IOSURLRequestCachePolicy._internal(0);
|
||||
const IOSURLRequestCachePolicy_._internal(0);
|
||||
|
||||
///The URL load should be loaded only from the originating source.
|
||||
///This policy specifies that no existing cache data should be used to satisfy a URL load request.
|
||||
///
|
||||
///**NOTE**: Always use this policy if you are making HTTP or HTTPS byte-range requests.
|
||||
static const RELOAD_IGNORING_LOCAL_CACHE_DATA =
|
||||
const IOSURLRequestCachePolicy._internal(1);
|
||||
const IOSURLRequestCachePolicy_._internal(1);
|
||||
|
||||
///Use existing cache data, regardless or age or expiration date, loading from originating source only if there is no cached data.
|
||||
static const RETURN_CACHE_DATA_ELSE_LOAD =
|
||||
const IOSURLRequestCachePolicy._internal(2);
|
||||
const IOSURLRequestCachePolicy_._internal(2);
|
||||
|
||||
///Use existing cache data, regardless or age or expiration date, and fail if no cached data is available.
|
||||
///
|
||||
@ -166,22 +77,17 @@ class IOSURLRequestCachePolicy {
|
||||
///no attempt is made to load the data from the originating source, and the load is considered to have failed.
|
||||
///This constant specifies a behavior that is similar to an “offline” mode.
|
||||
static const RETURN_CACHE_DATA_DONT_LOAD =
|
||||
const IOSURLRequestCachePolicy._internal(3);
|
||||
const IOSURLRequestCachePolicy_._internal(3);
|
||||
|
||||
///Ignore local cache data, and instruct proxies and other intermediates to disregard their caches so far as the protocol allows.
|
||||
///
|
||||
///**NOTE**: Versions earlier than macOS 15, iOS 13, watchOS 6, and tvOS 13 don’t implement this constant.
|
||||
static const RELOAD_IGNORING_LOCAL_AND_REMOTE_CACHE_DATA =
|
||||
const IOSURLRequestCachePolicy._internal(4);
|
||||
const IOSURLRequestCachePolicy_._internal(4);
|
||||
|
||||
///Use cache data if the origin source can validate it; otherwise, load from the origin.
|
||||
///
|
||||
///**NOTE**: Versions earlier than macOS 15, iOS 13, watchOS 6, and tvOS 13 don’t implement this constant.
|
||||
static const RELOAD_REVALIDATING_CACHE_DATA =
|
||||
const IOSURLRequestCachePolicy._internal(5);
|
||||
|
||||
bool operator ==(value) => value == _value;
|
||||
|
||||
@override
|
||||
int get hashCode => _value.hashCode;
|
||||
const IOSURLRequestCachePolicy_._internal(5);
|
||||
}
|
237
lib/src/types/url_request_cache_policy.g.dart
Normal file
237
lib/src/types/url_request_cache_policy.g.dart
Normal file
@ -0,0 +1,237 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'url_request_cache_policy.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// ExchangeableEnumGenerator
|
||||
// **************************************************************************
|
||||
|
||||
///Class that represents the constants used to specify interaction with the cached responses.
|
||||
class URLRequestCachePolicy {
|
||||
final int _value;
|
||||
final int _nativeValue;
|
||||
const URLRequestCachePolicy._internal(this._value, this._nativeValue);
|
||||
// ignore: unused_element
|
||||
factory URLRequestCachePolicy._internalMultiPlatform(
|
||||
int value, Function nativeValue) =>
|
||||
URLRequestCachePolicy._internal(value, nativeValue());
|
||||
|
||||
///Use the caching logic defined in the protocol implementation, if any, for a particular URL load request.
|
||||
///This is the default policy for URL load requests.
|
||||
static const USE_PROTOCOL_CACHE_POLICY =
|
||||
URLRequestCachePolicy._internal(0, 0);
|
||||
|
||||
///The URL load should be loaded only from the originating source.
|
||||
///This policy specifies that no existing cache data should be used to satisfy a URL load request.
|
||||
///
|
||||
///**NOTE**: Always use this policy if you are making HTTP or HTTPS byte-range requests.
|
||||
static const RELOAD_IGNORING_LOCAL_CACHE_DATA =
|
||||
URLRequestCachePolicy._internal(1, 1);
|
||||
|
||||
///Use existing cache data, regardless or age or expiration date, loading from originating source only if there is no cached data.
|
||||
static const RETURN_CACHE_DATA_ELSE_LOAD =
|
||||
URLRequestCachePolicy._internal(2, 2);
|
||||
|
||||
///Use existing cache data, regardless or age or expiration date, and fail if no cached data is available.
|
||||
///
|
||||
///If there is no existing data in the cache corresponding to a URL load request,
|
||||
///no attempt is made to load the data from the originating source, and the load is considered to have failed.
|
||||
///This constant specifies a behavior that is similar to an “offline” mode.
|
||||
static const RETURN_CACHE_DATA_DONT_LOAD =
|
||||
URLRequestCachePolicy._internal(3, 3);
|
||||
|
||||
///Ignore local cache data, and instruct proxies and other intermediates to disregard their caches so far as the protocol allows.
|
||||
///
|
||||
///**NOTE**: Versions earlier than macOS 15, iOS 13, watchOS 6, and tvOS 13 don’t implement this constant.
|
||||
static const RELOAD_IGNORING_LOCAL_AND_REMOTE_CACHE_DATA =
|
||||
URLRequestCachePolicy._internal(4, 4);
|
||||
|
||||
///Use cache data if the origin source can validate it; otherwise, load from the origin.
|
||||
///
|
||||
///**NOTE**: Versions earlier than macOS 15, iOS 13, watchOS 6, and tvOS 13 don’t implement this constant.
|
||||
static const RELOAD_REVALIDATING_CACHE_DATA =
|
||||
URLRequestCachePolicy._internal(5, 5);
|
||||
|
||||
///Set of all values of [URLRequestCachePolicy].
|
||||
static final Set<URLRequestCachePolicy> values = [
|
||||
URLRequestCachePolicy.USE_PROTOCOL_CACHE_POLICY,
|
||||
URLRequestCachePolicy.RELOAD_IGNORING_LOCAL_CACHE_DATA,
|
||||
URLRequestCachePolicy.RETURN_CACHE_DATA_ELSE_LOAD,
|
||||
URLRequestCachePolicy.RETURN_CACHE_DATA_DONT_LOAD,
|
||||
URLRequestCachePolicy.RELOAD_IGNORING_LOCAL_AND_REMOTE_CACHE_DATA,
|
||||
URLRequestCachePolicy.RELOAD_REVALIDATING_CACHE_DATA,
|
||||
].toSet();
|
||||
|
||||
///Gets a possible [URLRequestCachePolicy] instance from [int] value.
|
||||
static URLRequestCachePolicy? fromValue(int? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return URLRequestCachePolicy.values
|
||||
.firstWhere((element) => element.toValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets a possible [URLRequestCachePolicy] instance from a native value.
|
||||
static URLRequestCachePolicy? fromNativeValue(int? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return URLRequestCachePolicy.values
|
||||
.firstWhere((element) => element.toNativeValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets [int] value.
|
||||
int toValue() => _value;
|
||||
|
||||
///Gets [int] native value.
|
||||
int toNativeValue() => _nativeValue;
|
||||
|
||||
@override
|
||||
int get hashCode => _value.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(value) => value == _value;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
switch (_value) {
|
||||
case 0:
|
||||
return 'USE_PROTOCOL_CACHE_POLICY';
|
||||
case 1:
|
||||
return 'RELOAD_IGNORING_LOCAL_CACHE_DATA';
|
||||
case 2:
|
||||
return 'RETURN_CACHE_DATA_ELSE_LOAD';
|
||||
case 3:
|
||||
return 'RETURN_CACHE_DATA_DONT_LOAD';
|
||||
case 4:
|
||||
return 'RELOAD_IGNORING_LOCAL_AND_REMOTE_CACHE_DATA';
|
||||
case 5:
|
||||
return 'RELOAD_REVALIDATING_CACHE_DATA';
|
||||
}
|
||||
return _value.toString();
|
||||
}
|
||||
}
|
||||
|
||||
///An iOS-specific Class that represents the constants used to specify interaction with the cached responses.
|
||||
///Use [URLRequestCachePolicy] instead.
|
||||
@Deprecated('Use URLRequestCachePolicy instead')
|
||||
class IOSURLRequestCachePolicy {
|
||||
final int _value;
|
||||
final int _nativeValue;
|
||||
const IOSURLRequestCachePolicy._internal(this._value, this._nativeValue);
|
||||
// ignore: unused_element
|
||||
factory IOSURLRequestCachePolicy._internalMultiPlatform(
|
||||
int value, Function nativeValue) =>
|
||||
IOSURLRequestCachePolicy._internal(value, nativeValue());
|
||||
|
||||
///Use the caching logic defined in the protocol implementation, if any, for a particular URL load request.
|
||||
///This is the default policy for URL load requests.
|
||||
static const USE_PROTOCOL_CACHE_POLICY =
|
||||
IOSURLRequestCachePolicy._internal(0, 0);
|
||||
|
||||
///The URL load should be loaded only from the originating source.
|
||||
///This policy specifies that no existing cache data should be used to satisfy a URL load request.
|
||||
///
|
||||
///**NOTE**: Always use this policy if you are making HTTP or HTTPS byte-range requests.
|
||||
static const RELOAD_IGNORING_LOCAL_CACHE_DATA =
|
||||
IOSURLRequestCachePolicy._internal(1, 1);
|
||||
|
||||
///Use existing cache data, regardless or age or expiration date, loading from originating source only if there is no cached data.
|
||||
static const RETURN_CACHE_DATA_ELSE_LOAD =
|
||||
IOSURLRequestCachePolicy._internal(2, 2);
|
||||
|
||||
///Use existing cache data, regardless or age or expiration date, and fail if no cached data is available.
|
||||
///
|
||||
///If there is no existing data in the cache corresponding to a URL load request,
|
||||
///no attempt is made to load the data from the originating source, and the load is considered to have failed.
|
||||
///This constant specifies a behavior that is similar to an “offline” mode.
|
||||
static const RETURN_CACHE_DATA_DONT_LOAD =
|
||||
IOSURLRequestCachePolicy._internal(3, 3);
|
||||
|
||||
///Ignore local cache data, and instruct proxies and other intermediates to disregard their caches so far as the protocol allows.
|
||||
///
|
||||
///**NOTE**: Versions earlier than macOS 15, iOS 13, watchOS 6, and tvOS 13 don’t implement this constant.
|
||||
static const RELOAD_IGNORING_LOCAL_AND_REMOTE_CACHE_DATA =
|
||||
IOSURLRequestCachePolicy._internal(4, 4);
|
||||
|
||||
///Use cache data if the origin source can validate it; otherwise, load from the origin.
|
||||
///
|
||||
///**NOTE**: Versions earlier than macOS 15, iOS 13, watchOS 6, and tvOS 13 don’t implement this constant.
|
||||
static const RELOAD_REVALIDATING_CACHE_DATA =
|
||||
IOSURLRequestCachePolicy._internal(5, 5);
|
||||
|
||||
///Set of all values of [IOSURLRequestCachePolicy].
|
||||
static final Set<IOSURLRequestCachePolicy> values = [
|
||||
IOSURLRequestCachePolicy.USE_PROTOCOL_CACHE_POLICY,
|
||||
IOSURLRequestCachePolicy.RELOAD_IGNORING_LOCAL_CACHE_DATA,
|
||||
IOSURLRequestCachePolicy.RETURN_CACHE_DATA_ELSE_LOAD,
|
||||
IOSURLRequestCachePolicy.RETURN_CACHE_DATA_DONT_LOAD,
|
||||
IOSURLRequestCachePolicy.RELOAD_IGNORING_LOCAL_AND_REMOTE_CACHE_DATA,
|
||||
IOSURLRequestCachePolicy.RELOAD_REVALIDATING_CACHE_DATA,
|
||||
].toSet();
|
||||
|
||||
///Gets a possible [IOSURLRequestCachePolicy] instance from [int] value.
|
||||
static IOSURLRequestCachePolicy? fromValue(int? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return IOSURLRequestCachePolicy.values
|
||||
.firstWhere((element) => element.toValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets a possible [IOSURLRequestCachePolicy] instance from a native value.
|
||||
static IOSURLRequestCachePolicy? fromNativeValue(int? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return IOSURLRequestCachePolicy.values
|
||||
.firstWhere((element) => element.toNativeValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets [int] value.
|
||||
int toValue() => _value;
|
||||
|
||||
///Gets [int] native value.
|
||||
int toNativeValue() => _nativeValue;
|
||||
|
||||
@override
|
||||
int get hashCode => _value.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(value) => value == _value;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
switch (_value) {
|
||||
case 0:
|
||||
return 'USE_PROTOCOL_CACHE_POLICY';
|
||||
case 1:
|
||||
return 'RELOAD_IGNORING_LOCAL_CACHE_DATA';
|
||||
case 2:
|
||||
return 'RETURN_CACHE_DATA_ELSE_LOAD';
|
||||
case 3:
|
||||
return 'RETURN_CACHE_DATA_DONT_LOAD';
|
||||
case 4:
|
||||
return 'RELOAD_IGNORING_LOCAL_AND_REMOTE_CACHE_DATA';
|
||||
case 5:
|
||||
return 'RELOAD_REVALIDATING_CACHE_DATA';
|
||||
}
|
||||
return _value.toString();
|
||||
}
|
||||
}
|
@ -1,195 +1,89 @@
|
||||
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
|
||||
|
||||
part 'url_request_network_service_type.g.dart';
|
||||
|
||||
///Class that represents the constants that specify how a request uses network resources.
|
||||
class URLRequestNetworkServiceType {
|
||||
@ExchangeableEnum()
|
||||
class URLRequestNetworkServiceType_ {
|
||||
// ignore: unused_field
|
||||
final int _value;
|
||||
|
||||
const URLRequestNetworkServiceType._internal(this._value);
|
||||
|
||||
///Set of all values of [URLRequestNetworkServiceType].
|
||||
static final Set<URLRequestNetworkServiceType> values = [
|
||||
URLRequestNetworkServiceType.DEFAULT,
|
||||
URLRequestNetworkServiceType.VIDEO,
|
||||
URLRequestNetworkServiceType.BACKGROUND,
|
||||
URLRequestNetworkServiceType.VOICE,
|
||||
URLRequestNetworkServiceType.RESPONSIVE_DATA,
|
||||
URLRequestNetworkServiceType.AV_STREAMING,
|
||||
URLRequestNetworkServiceType.RESPONSIVE_AV,
|
||||
URLRequestNetworkServiceType.CALL_SIGNALING,
|
||||
].toSet();
|
||||
|
||||
///Gets a possible [URLRequestNetworkServiceType] instance from an [int] value.
|
||||
static URLRequestNetworkServiceType? fromValue(int? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return URLRequestNetworkServiceType.values
|
||||
.firstWhere((element) => element.toValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets [int] value.
|
||||
int toValue() => _value;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
switch (_value) {
|
||||
case 2:
|
||||
return "VIDEO";
|
||||
case 3:
|
||||
return "BACKGROUND";
|
||||
case 4:
|
||||
return "VOICE";
|
||||
case 6:
|
||||
return "RESPONSIVE_DATA";
|
||||
case 8:
|
||||
return "AV_STREAMING";
|
||||
case 9:
|
||||
return "RESPONSIVE_AV";
|
||||
case 11:
|
||||
return "CALL_SIGNALING";
|
||||
case 0:
|
||||
default:
|
||||
return "DEFAULT";
|
||||
}
|
||||
}
|
||||
const URLRequestNetworkServiceType_._internal(this._value);
|
||||
|
||||
///A service type for standard network traffic.
|
||||
static const DEFAULT = const URLRequestNetworkServiceType._internal(0);
|
||||
static const DEFAULT = const URLRequestNetworkServiceType_._internal(0);
|
||||
|
||||
///A service type for video traffic.
|
||||
static const VIDEO = const URLRequestNetworkServiceType._internal(2);
|
||||
static const VIDEO = const URLRequestNetworkServiceType_._internal(2);
|
||||
|
||||
///A service type for background traffic.
|
||||
///
|
||||
///You should specify this type if your app is performing a download that was not requested by the user—for example,
|
||||
///prefetching content so that it will be available when the user chooses to view it.
|
||||
static const BACKGROUND = const URLRequestNetworkServiceType._internal(3);
|
||||
static const BACKGROUND = const URLRequestNetworkServiceType_._internal(3);
|
||||
|
||||
///A service type for voice traffic.
|
||||
static const VOICE = const URLRequestNetworkServiceType._internal(4);
|
||||
static const VOICE = const URLRequestNetworkServiceType_._internal(4);
|
||||
|
||||
///A service type for data that the user is actively waiting for.
|
||||
///
|
||||
///Use this service type for interactive situations where the user is anticipating a quick response, like instant messaging or completing a purchase.
|
||||
static const RESPONSIVE_DATA =
|
||||
const URLRequestNetworkServiceType._internal(6);
|
||||
const URLRequestNetworkServiceType_._internal(6);
|
||||
|
||||
///A service type for streaming audio/video data.
|
||||
static const AV_STREAMING = const URLRequestNetworkServiceType._internal(8);
|
||||
static const AV_STREAMING = const URLRequestNetworkServiceType_._internal(8);
|
||||
|
||||
///A service type for responsive (time-sensitive) audio/video data.
|
||||
static const RESPONSIVE_AV = const URLRequestNetworkServiceType._internal(9);
|
||||
static const RESPONSIVE_AV = const URLRequestNetworkServiceType_._internal(9);
|
||||
|
||||
///A service type for call signaling.
|
||||
///
|
||||
///Use this service type with network traffic that establishes, maintains, or tears down a VoIP call.
|
||||
static const CALL_SIGNALING =
|
||||
const URLRequestNetworkServiceType._internal(11);
|
||||
|
||||
bool operator ==(value) => value == _value;
|
||||
|
||||
@override
|
||||
int get hashCode => _value.hashCode;
|
||||
const URLRequestNetworkServiceType_._internal(11);
|
||||
}
|
||||
|
||||
///An iOS-specific Class that represents the constants that specify how a request uses network resources.
|
||||
///Use [URLRequestNetworkServiceType] instead.
|
||||
@Deprecated("Use URLRequestNetworkServiceType instead")
|
||||
class IOSURLRequestNetworkServiceType {
|
||||
@ExchangeableEnum()
|
||||
class IOSURLRequestNetworkServiceType_ {
|
||||
// ignore: unused_field
|
||||
final int _value;
|
||||
|
||||
const IOSURLRequestNetworkServiceType._internal(this._value);
|
||||
|
||||
///Set of all values of [IOSURLRequestNetworkServiceType].
|
||||
static final Set<IOSURLRequestNetworkServiceType> values = [
|
||||
IOSURLRequestNetworkServiceType.DEFAULT,
|
||||
IOSURLRequestNetworkServiceType.VIDEO,
|
||||
IOSURLRequestNetworkServiceType.BACKGROUND,
|
||||
IOSURLRequestNetworkServiceType.VOICE,
|
||||
IOSURLRequestNetworkServiceType.RESPONSIVE_DATA,
|
||||
IOSURLRequestNetworkServiceType.AV_STREAMING,
|
||||
IOSURLRequestNetworkServiceType.RESPONSIVE_AV,
|
||||
IOSURLRequestNetworkServiceType.CALL_SIGNALING,
|
||||
].toSet();
|
||||
|
||||
///Gets a possible [IOSURLRequestNetworkServiceType] instance from an [int] value.
|
||||
static IOSURLRequestNetworkServiceType? fromValue(int? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return IOSURLRequestNetworkServiceType.values
|
||||
.firstWhere((element) => element.toValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets [int] value.
|
||||
int toValue() => _value;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
switch (_value) {
|
||||
case 2:
|
||||
return "VIDEO";
|
||||
case 3:
|
||||
return "BACKGROUND";
|
||||
case 4:
|
||||
return "VOICE";
|
||||
case 6:
|
||||
return "RESPONSIVE_DATA";
|
||||
case 8:
|
||||
return "AV_STREAMING";
|
||||
case 9:
|
||||
return "RESPONSIVE_AV";
|
||||
case 11:
|
||||
return "CALL_SIGNALING";
|
||||
case 0:
|
||||
default:
|
||||
return "DEFAULT";
|
||||
}
|
||||
}
|
||||
const IOSURLRequestNetworkServiceType_._internal(this._value);
|
||||
|
||||
///A service type for standard network traffic.
|
||||
static const DEFAULT = const IOSURLRequestNetworkServiceType._internal(0);
|
||||
static const DEFAULT = const IOSURLRequestNetworkServiceType_._internal(0);
|
||||
|
||||
///A service type for video traffic.
|
||||
static const VIDEO = const IOSURLRequestNetworkServiceType._internal(2);
|
||||
static const VIDEO = const IOSURLRequestNetworkServiceType_._internal(2);
|
||||
|
||||
///A service type for background traffic.
|
||||
///
|
||||
///You should specify this type if your app is performing a download that was not requested by the user—for example,
|
||||
///prefetching content so that it will be available when the user chooses to view it.
|
||||
static const BACKGROUND = const IOSURLRequestNetworkServiceType._internal(3);
|
||||
static const BACKGROUND = const IOSURLRequestNetworkServiceType_._internal(3);
|
||||
|
||||
///A service type for voice traffic.
|
||||
static const VOICE = const IOSURLRequestNetworkServiceType._internal(4);
|
||||
static const VOICE = const IOSURLRequestNetworkServiceType_._internal(4);
|
||||
|
||||
///A service type for data that the user is actively waiting for.
|
||||
///
|
||||
///Use this service type for interactive situations where the user is anticipating a quick response, like instant messaging or completing a purchase.
|
||||
static const RESPONSIVE_DATA =
|
||||
const IOSURLRequestNetworkServiceType._internal(6);
|
||||
const IOSURLRequestNetworkServiceType_._internal(6);
|
||||
|
||||
///A service type for streaming audio/video data.
|
||||
static const AV_STREAMING =
|
||||
const IOSURLRequestNetworkServiceType._internal(8);
|
||||
const IOSURLRequestNetworkServiceType_._internal(8);
|
||||
|
||||
///A service type for responsive (time-sensitive) audio/video data.
|
||||
static const RESPONSIVE_AV =
|
||||
const IOSURLRequestNetworkServiceType._internal(9);
|
||||
const IOSURLRequestNetworkServiceType_._internal(9);
|
||||
|
||||
///A service type for call signaling.
|
||||
///
|
||||
///Use this service type with network traffic that establishes, maintains, or tears down a VoIP call.
|
||||
static const CALL_SIGNALING =
|
||||
const IOSURLRequestNetworkServiceType._internal(11);
|
||||
|
||||
bool operator ==(value) => value == _value;
|
||||
|
||||
@override
|
||||
int get hashCode => _value.hashCode;
|
||||
const IOSURLRequestNetworkServiceType_._internal(11);
|
||||
}
|
242
lib/src/types/url_request_network_service_type.g.dart
Normal file
242
lib/src/types/url_request_network_service_type.g.dart
Normal file
@ -0,0 +1,242 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'url_request_network_service_type.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// ExchangeableEnumGenerator
|
||||
// **************************************************************************
|
||||
|
||||
///Class that represents the constants that specify how a request uses network resources.
|
||||
class URLRequestNetworkServiceType {
|
||||
final int _value;
|
||||
final int _nativeValue;
|
||||
const URLRequestNetworkServiceType._internal(this._value, this._nativeValue);
|
||||
// ignore: unused_element
|
||||
factory URLRequestNetworkServiceType._internalMultiPlatform(
|
||||
int value, Function nativeValue) =>
|
||||
URLRequestNetworkServiceType._internal(value, nativeValue());
|
||||
|
||||
///A service type for standard network traffic.
|
||||
static const DEFAULT = URLRequestNetworkServiceType._internal(0, 0);
|
||||
|
||||
///A service type for video traffic.
|
||||
static const VIDEO = URLRequestNetworkServiceType._internal(2, 2);
|
||||
|
||||
///A service type for background traffic.
|
||||
///
|
||||
///You should specify this type if your app is performing a download that was not requested by the user—for example,
|
||||
///prefetching content so that it will be available when the user chooses to view it.
|
||||
static const BACKGROUND = URLRequestNetworkServiceType._internal(3, 3);
|
||||
|
||||
///A service type for voice traffic.
|
||||
static const VOICE = URLRequestNetworkServiceType._internal(4, 4);
|
||||
|
||||
///A service type for data that the user is actively waiting for.
|
||||
///
|
||||
///Use this service type for interactive situations where the user is anticipating a quick response, like instant messaging or completing a purchase.
|
||||
static const RESPONSIVE_DATA = URLRequestNetworkServiceType._internal(6, 6);
|
||||
|
||||
///A service type for streaming audio/video data.
|
||||
static const AV_STREAMING = URLRequestNetworkServiceType._internal(8, 8);
|
||||
|
||||
///A service type for responsive (time-sensitive) audio/video data.
|
||||
static const RESPONSIVE_AV = URLRequestNetworkServiceType._internal(9, 9);
|
||||
|
||||
///A service type for call signaling.
|
||||
///
|
||||
///Use this service type with network traffic that establishes, maintains, or tears down a VoIP call.
|
||||
static const CALL_SIGNALING = URLRequestNetworkServiceType._internal(11, 11);
|
||||
|
||||
///Set of all values of [URLRequestNetworkServiceType].
|
||||
static final Set<URLRequestNetworkServiceType> values = [
|
||||
URLRequestNetworkServiceType.DEFAULT,
|
||||
URLRequestNetworkServiceType.VIDEO,
|
||||
URLRequestNetworkServiceType.BACKGROUND,
|
||||
URLRequestNetworkServiceType.VOICE,
|
||||
URLRequestNetworkServiceType.RESPONSIVE_DATA,
|
||||
URLRequestNetworkServiceType.AV_STREAMING,
|
||||
URLRequestNetworkServiceType.RESPONSIVE_AV,
|
||||
URLRequestNetworkServiceType.CALL_SIGNALING,
|
||||
].toSet();
|
||||
|
||||
///Gets a possible [URLRequestNetworkServiceType] instance from [int] value.
|
||||
static URLRequestNetworkServiceType? fromValue(int? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return URLRequestNetworkServiceType.values
|
||||
.firstWhere((element) => element.toValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets a possible [URLRequestNetworkServiceType] instance from a native value.
|
||||
static URLRequestNetworkServiceType? fromNativeValue(int? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return URLRequestNetworkServiceType.values
|
||||
.firstWhere((element) => element.toNativeValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets [int] value.
|
||||
int toValue() => _value;
|
||||
|
||||
///Gets [int] native value.
|
||||
int toNativeValue() => _nativeValue;
|
||||
|
||||
@override
|
||||
int get hashCode => _value.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(value) => value == _value;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
switch (_value) {
|
||||
case 0:
|
||||
return 'DEFAULT';
|
||||
case 2:
|
||||
return 'VIDEO';
|
||||
case 3:
|
||||
return 'BACKGROUND';
|
||||
case 4:
|
||||
return 'VOICE';
|
||||
case 6:
|
||||
return 'RESPONSIVE_DATA';
|
||||
case 8:
|
||||
return 'AV_STREAMING';
|
||||
case 9:
|
||||
return 'RESPONSIVE_AV';
|
||||
case 11:
|
||||
return 'CALL_SIGNALING';
|
||||
}
|
||||
return _value.toString();
|
||||
}
|
||||
}
|
||||
|
||||
///An iOS-specific Class that represents the constants that specify how a request uses network resources.
|
||||
///Use [URLRequestNetworkServiceType] instead.
|
||||
@Deprecated('Use URLRequestNetworkServiceType instead')
|
||||
class IOSURLRequestNetworkServiceType {
|
||||
final int _value;
|
||||
final int _nativeValue;
|
||||
const IOSURLRequestNetworkServiceType._internal(
|
||||
this._value, this._nativeValue);
|
||||
// ignore: unused_element
|
||||
factory IOSURLRequestNetworkServiceType._internalMultiPlatform(
|
||||
int value, Function nativeValue) =>
|
||||
IOSURLRequestNetworkServiceType._internal(value, nativeValue());
|
||||
|
||||
///A service type for standard network traffic.
|
||||
static const DEFAULT = IOSURLRequestNetworkServiceType._internal(0, 0);
|
||||
|
||||
///A service type for video traffic.
|
||||
static const VIDEO = IOSURLRequestNetworkServiceType._internal(2, 2);
|
||||
|
||||
///A service type for background traffic.
|
||||
///
|
||||
///You should specify this type if your app is performing a download that was not requested by the user—for example,
|
||||
///prefetching content so that it will be available when the user chooses to view it.
|
||||
static const BACKGROUND = IOSURLRequestNetworkServiceType._internal(3, 3);
|
||||
|
||||
///A service type for voice traffic.
|
||||
static const VOICE = IOSURLRequestNetworkServiceType._internal(4, 4);
|
||||
|
||||
///A service type for data that the user is actively waiting for.
|
||||
///
|
||||
///Use this service type for interactive situations where the user is anticipating a quick response, like instant messaging or completing a purchase.
|
||||
static const RESPONSIVE_DATA =
|
||||
IOSURLRequestNetworkServiceType._internal(6, 6);
|
||||
|
||||
///A service type for streaming audio/video data.
|
||||
static const AV_STREAMING = IOSURLRequestNetworkServiceType._internal(8, 8);
|
||||
|
||||
///A service type for responsive (time-sensitive) audio/video data.
|
||||
static const RESPONSIVE_AV = IOSURLRequestNetworkServiceType._internal(9, 9);
|
||||
|
||||
///A service type for call signaling.
|
||||
///
|
||||
///Use this service type with network traffic that establishes, maintains, or tears down a VoIP call.
|
||||
static const CALL_SIGNALING =
|
||||
IOSURLRequestNetworkServiceType._internal(11, 11);
|
||||
|
||||
///Set of all values of [IOSURLRequestNetworkServiceType].
|
||||
static final Set<IOSURLRequestNetworkServiceType> values = [
|
||||
IOSURLRequestNetworkServiceType.DEFAULT,
|
||||
IOSURLRequestNetworkServiceType.VIDEO,
|
||||
IOSURLRequestNetworkServiceType.BACKGROUND,
|
||||
IOSURLRequestNetworkServiceType.VOICE,
|
||||
IOSURLRequestNetworkServiceType.RESPONSIVE_DATA,
|
||||
IOSURLRequestNetworkServiceType.AV_STREAMING,
|
||||
IOSURLRequestNetworkServiceType.RESPONSIVE_AV,
|
||||
IOSURLRequestNetworkServiceType.CALL_SIGNALING,
|
||||
].toSet();
|
||||
|
||||
///Gets a possible [IOSURLRequestNetworkServiceType] instance from [int] value.
|
||||
static IOSURLRequestNetworkServiceType? fromValue(int? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return IOSURLRequestNetworkServiceType.values
|
||||
.firstWhere((element) => element.toValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets a possible [IOSURLRequestNetworkServiceType] instance from a native value.
|
||||
static IOSURLRequestNetworkServiceType? fromNativeValue(int? value) {
|
||||
if (value != null) {
|
||||
try {
|
||||
return IOSURLRequestNetworkServiceType.values
|
||||
.firstWhere((element) => element.toNativeValue() == value);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///Gets [int] value.
|
||||
int toValue() => _value;
|
||||
|
||||
///Gets [int] native value.
|
||||
int toNativeValue() => _nativeValue;
|
||||
|
||||
@override
|
||||
int get hashCode => _value.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(value) => value == _value;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
switch (_value) {
|
||||
case 0:
|
||||
return 'DEFAULT';
|
||||
case 2:
|
||||
return 'VIDEO';
|
||||
case 3:
|
||||
return 'BACKGROUND';
|
||||
case 4:
|
||||
return 'VOICE';
|
||||
case 6:
|
||||
return 'RESPONSIVE_DATA';
|
||||
case 8:
|
||||
return 'AV_STREAMING';
|
||||
case 9:
|
||||
return 'RESPONSIVE_AV';
|
||||
case 11:
|
||||
return 'CALL_SIGNALING';
|
||||
}
|
||||
return _value.toString();
|
||||
}
|
||||
}
|
@ -1,5 +1,10 @@
|
||||
import 'package:flutter_inappwebview_internal_annotations/flutter_inappwebview_internal_annotations.dart';
|
||||
|
||||
part 'window_features.g.dart';
|
||||
|
||||
///Class that specifies optional attributes for the containing window when a new web view is requested.
|
||||
class WindowFeatures {
|
||||
@ExchangeableObject()
|
||||
class WindowFeatures_ {
|
||||
///A Boolean value indicating whether the containing window should be resizable, or `null` if resizability is not specified.
|
||||
bool? allowsResizing;
|
||||
|
||||
@ -24,7 +29,7 @@ class WindowFeatures {
|
||||
///A Double value specifying the y-coordinate of the containing window, or `null` if the y-coordinate is not specified.
|
||||
double? y;
|
||||
|
||||
WindowFeatures(
|
||||
WindowFeatures_(
|
||||
{this.allowsResizing,
|
||||
this.height,
|
||||
this.menuBarVisibility,
|
||||
@ -33,52 +38,13 @@ class WindowFeatures {
|
||||
this.width,
|
||||
this.x,
|
||||
this.y});
|
||||
|
||||
///Gets a possible [WindowFeatures] instance from a [Map] value.
|
||||
static WindowFeatures? fromMap(Map<String, dynamic>? map) {
|
||||
if (map == null) {
|
||||
return null;
|
||||
}
|
||||
return WindowFeatures(
|
||||
allowsResizing: map["allowsResizing"],
|
||||
height: map["height"],
|
||||
menuBarVisibility: map["menuBarVisibility"],
|
||||
statusBarVisibility: map["statusBarVisibility"],
|
||||
toolbarsVisibility: map["toolbarsVisibility"],
|
||||
width: map["width"],
|
||||
x: map["x"],
|
||||
y: map["y"]);
|
||||
}
|
||||
|
||||
///Converts instance to a map.
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"allowsResizing": allowsResizing,
|
||||
"height": height,
|
||||
"menuBarVisibility": menuBarVisibility,
|
||||
"statusBarVisibility": statusBarVisibility,
|
||||
"toolbarsVisibility": toolbarsVisibility,
|
||||
"width": width,
|
||||
"x": x,
|
||||
"y": y,
|
||||
};
|
||||
}
|
||||
|
||||
///Converts instance to a map.
|
||||
Map<String, dynamic> toJson() {
|
||||
return this.toMap();
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toMap().toString();
|
||||
}
|
||||
}
|
||||
|
||||
///An iOS-specific class that specifies optional attributes for the containing window when a new web view is requested.
|
||||
///Use [WindowFeatures] instead.
|
||||
@Deprecated("Use WindowFeatures instead")
|
||||
class IOSWKWindowFeatures {
|
||||
@ExchangeableObject()
|
||||
class IOSWKWindowFeatures_ {
|
||||
///A Boolean value indicating whether the containing window should be resizable, or `null` if resizability is not specified.
|
||||
bool? allowsResizing;
|
||||
|
||||
@ -103,7 +69,7 @@ class IOSWKWindowFeatures {
|
||||
///A Double value specifying the y-coordinate of the containing window, or `null` if the y-coordinate is not specified.
|
||||
double? y;
|
||||
|
||||
IOSWKWindowFeatures(
|
||||
IOSWKWindowFeatures_(
|
||||
{this.allowsResizing,
|
||||
this.height,
|
||||
this.menuBarVisibility,
|
||||
@ -112,44 +78,4 @@ class IOSWKWindowFeatures {
|
||||
this.width,
|
||||
this.x,
|
||||
this.y});
|
||||
|
||||
///Gets a possible [IOSWKWindowFeatures] instance from a [Map] value.
|
||||
static IOSWKWindowFeatures? fromMap(Map<String, dynamic>? map) {
|
||||
if (map == null) {
|
||||
return null;
|
||||
}
|
||||
return IOSWKWindowFeatures(
|
||||
allowsResizing: map["allowsResizing"],
|
||||
height: map["height"],
|
||||
menuBarVisibility: map["menuBarVisibility"],
|
||||
statusBarVisibility: map["statusBarVisibility"],
|
||||
toolbarsVisibility: map["toolbarsVisibility"],
|
||||
width: map["width"],
|
||||
x: map["x"],
|
||||
y: map["y"]);
|
||||
}
|
||||
|
||||
///Converts instance to a map.
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"allowsResizing": allowsResizing,
|
||||
"height": height,
|
||||
"menuBarVisibility": menuBarVisibility,
|
||||
"statusBarVisibility": statusBarVisibility,
|
||||
"toolbarsVisibility": toolbarsVisibility,
|
||||
"width": width,
|
||||
"x": x,
|
||||
"y": y,
|
||||
};
|
||||
}
|
||||
|
||||
///Converts instance to a map.
|
||||
Map<String, dynamic> toJson() {
|
||||
return this.toMap();
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toMap().toString();
|
||||
}
|
||||
}
|
163
lib/src/types/window_features.g.dart
Normal file
163
lib/src/types/window_features.g.dart
Normal file
@ -0,0 +1,163 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'window_features.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// ExchangeableObjectGenerator
|
||||
// **************************************************************************
|
||||
|
||||
///Class that specifies optional attributes for the containing window when a new web view is requested.
|
||||
class WindowFeatures {
|
||||
///A Boolean value indicating whether the containing window should be resizable, or `null` if resizability is not specified.
|
||||
bool? allowsResizing;
|
||||
|
||||
///A Double value specifying the height of the containing window, or `null` if the height is not specified.
|
||||
double? height;
|
||||
|
||||
///A Boolean value indicating whether the menu bar should be visible, or `null` if menu bar visibility is not specified.
|
||||
bool? menuBarVisibility;
|
||||
|
||||
///A Boolean value indicating whether the status bar should be visible, or `null` if status bar visibility is not specified.
|
||||
bool? statusBarVisibility;
|
||||
|
||||
///A Boolean value indicating whether toolbars should be visible, or `null` if toolbars visibility is not specified.
|
||||
bool? toolbarsVisibility;
|
||||
|
||||
///A Double value specifying the width of the containing window, or `null` if the width is not specified.
|
||||
double? width;
|
||||
|
||||
///A Double value specifying the x-coordinate of the containing window, or `null` if the x-coordinate is not specified.
|
||||
double? x;
|
||||
|
||||
///A Double value specifying the y-coordinate of the containing window, or `null` if the y-coordinate is not specified.
|
||||
double? y;
|
||||
WindowFeatures(
|
||||
{this.allowsResizing,
|
||||
this.height,
|
||||
this.menuBarVisibility,
|
||||
this.statusBarVisibility,
|
||||
this.toolbarsVisibility,
|
||||
this.width,
|
||||
this.x,
|
||||
this.y});
|
||||
|
||||
///Gets a possible [WindowFeatures] instance from a [Map] value.
|
||||
static WindowFeatures? fromMap(Map<String, dynamic>? map) {
|
||||
if (map == null) {
|
||||
return null;
|
||||
}
|
||||
final instance = WindowFeatures();
|
||||
instance.allowsResizing = map['allowsResizing'];
|
||||
instance.height = map['height'];
|
||||
instance.menuBarVisibility = map['menuBarVisibility'];
|
||||
instance.statusBarVisibility = map['statusBarVisibility'];
|
||||
instance.toolbarsVisibility = map['toolbarsVisibility'];
|
||||
instance.width = map['width'];
|
||||
instance.x = map['x'];
|
||||
instance.y = map['y'];
|
||||
return instance;
|
||||
}
|
||||
|
||||
///Converts instance to a map.
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"allowsResizing": allowsResizing,
|
||||
"height": height,
|
||||
"menuBarVisibility": menuBarVisibility,
|
||||
"statusBarVisibility": statusBarVisibility,
|
||||
"toolbarsVisibility": toolbarsVisibility,
|
||||
"width": width,
|
||||
"x": x,
|
||||
"y": y,
|
||||
};
|
||||
}
|
||||
|
||||
///Converts instance to a map.
|
||||
Map<String, dynamic> toJson() {
|
||||
return toMap();
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'WindowFeatures{allowsResizing: $allowsResizing, height: $height, menuBarVisibility: $menuBarVisibility, statusBarVisibility: $statusBarVisibility, toolbarsVisibility: $toolbarsVisibility, width: $width, x: $x, y: $y}';
|
||||
}
|
||||
}
|
||||
|
||||
///An iOS-specific class that specifies optional attributes for the containing window when a new web view is requested.
|
||||
///Use [WindowFeatures] instead.
|
||||
@Deprecated('Use WindowFeatures instead')
|
||||
class IOSWKWindowFeatures {
|
||||
///A Boolean value indicating whether the containing window should be resizable, or `null` if resizability is not specified.
|
||||
bool? allowsResizing;
|
||||
|
||||
///A Double value specifying the height of the containing window, or `null` if the height is not specified.
|
||||
double? height;
|
||||
|
||||
///A Boolean value indicating whether the menu bar should be visible, or `null` if menu bar visibility is not specified.
|
||||
bool? menuBarVisibility;
|
||||
|
||||
///A Boolean value indicating whether the status bar should be visible, or `null` if status bar visibility is not specified.
|
||||
bool? statusBarVisibility;
|
||||
|
||||
///A Boolean value indicating whether toolbars should be visible, or `null` if toolbars visibility is not specified.
|
||||
bool? toolbarsVisibility;
|
||||
|
||||
///A Double value specifying the width of the containing window, or `null` if the width is not specified.
|
||||
double? width;
|
||||
|
||||
///A Double value specifying the x-coordinate of the containing window, or `null` if the x-coordinate is not specified.
|
||||
double? x;
|
||||
|
||||
///A Double value specifying the y-coordinate of the containing window, or `null` if the y-coordinate is not specified.
|
||||
double? y;
|
||||
IOSWKWindowFeatures(
|
||||
{this.allowsResizing,
|
||||
this.height,
|
||||
this.menuBarVisibility,
|
||||
this.statusBarVisibility,
|
||||
this.toolbarsVisibility,
|
||||
this.width,
|
||||
this.x,
|
||||
this.y});
|
||||
|
||||
///Gets a possible [IOSWKWindowFeatures] instance from a [Map] value.
|
||||
static IOSWKWindowFeatures? fromMap(Map<String, dynamic>? map) {
|
||||
if (map == null) {
|
||||
return null;
|
||||
}
|
||||
final instance = IOSWKWindowFeatures();
|
||||
instance.allowsResizing = map['allowsResizing'];
|
||||
instance.height = map['height'];
|
||||
instance.menuBarVisibility = map['menuBarVisibility'];
|
||||
instance.statusBarVisibility = map['statusBarVisibility'];
|
||||
instance.toolbarsVisibility = map['toolbarsVisibility'];
|
||||
instance.width = map['width'];
|
||||
instance.x = map['x'];
|
||||
instance.y = map['y'];
|
||||
return instance;
|
||||
}
|
||||
|
||||
///Converts instance to a map.
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"allowsResizing": allowsResizing,
|
||||
"height": height,
|
||||
"menuBarVisibility": menuBarVisibility,
|
||||
"statusBarVisibility": statusBarVisibility,
|
||||
"toolbarsVisibility": toolbarsVisibility,
|
||||
"width": width,
|
||||
"x": x,
|
||||
"y": y,
|
||||
};
|
||||
}
|
||||
|
||||
///Converts instance to a map.
|
||||
Map<String, dynamic> toJson() {
|
||||
return toMap();
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'IOSWKWindowFeatures{allowsResizing: $allowsResizing, height: $height, menuBarVisibility: $menuBarVisibility, statusBarVisibility: $statusBarVisibility, toolbarsVisibility: $toolbarsVisibility, width: $width, x: $x, y: $y}';
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user