Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Non-nullable isRedirect
  • Loading branch information
stuartmorgan-g committed Sep 9, 2025
commit f564e80c211764aae0157e60a00a4c930ef4daec
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,7 @@ abstract class PigeonApiWebResourceRequest(
abstract fun isForMainFrame(pigeon_instance: android.webkit.WebResourceRequest): Boolean

/** Whether the request was a result of a server-side redirect. */
abstract fun isRedirect(pigeon_instance: android.webkit.WebResourceRequest): Boolean?
abstract fun isRedirect(pigeon_instance: android.webkit.WebResourceRequest): Boolean

/** Whether a gesture (such as a click) was associated with the request. */
abstract fun hasGesture(pigeon_instance: android.webkit.WebResourceRequest): Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ public boolean isForMainFrame(@NonNull WebResourceRequest pigeon_instance) {
return pigeon_instance.isForMainFrame();
}

@Nullable
@NonNull
@Override
public Boolean isRedirect(@NonNull WebResourceRequest pigeon_instance) {
public boolean isRedirect(@NonNull WebResourceRequest pigeon_instance) {
return pigeon_instance.isRedirect();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: The pigeon file can change this method to return a nonnull value now: https://developer.android.com/reference/android/webkit/WebResourceRequest#isRedirect()

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch! Done.

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ class WebResourceRequest extends PigeonInternalProxyApiBaseClass {
super.pigeon_instanceManager,
required this.url,
required this.isForMainFrame,
this.isRedirect,
required this.isRedirect,
required this.hasGesture,
required this.method,
this.requestHeaders,
Expand All @@ -720,7 +720,7 @@ class WebResourceRequest extends PigeonInternalProxyApiBaseClass {
final bool isForMainFrame;

/// Whether the request was a result of a server-side redirect.
final bool? isRedirect;
final bool isRedirect;

/// Whether a gesture (such as a click) was associated with the request.
final bool hasGesture;
Expand All @@ -738,7 +738,7 @@ class WebResourceRequest extends PigeonInternalProxyApiBaseClass {
WebResourceRequest Function(
String url,
bool isForMainFrame,
bool? isRedirect,
bool isRedirect,
bool hasGesture,
String method,
Map<String, String>? requestHeaders,
Expand Down Expand Up @@ -782,6 +782,10 @@ class WebResourceRequest extends PigeonInternalProxyApiBaseClass {
'Argument for dev.flutter.pigeon.webview_flutter_android.WebResourceRequest.pigeon_newInstance was null, expected non-null bool.',
);
final bool? arg_isRedirect = (args[3] as bool?);
assert(
arg_isRedirect != null,
'Argument for dev.flutter.pigeon.webview_flutter_android.WebResourceRequest.pigeon_newInstance was null, expected non-null bool.',
);
final bool? arg_hasGesture = (args[4] as bool?);
assert(
arg_hasGesture != null,
Expand All @@ -800,7 +804,7 @@ class WebResourceRequest extends PigeonInternalProxyApiBaseClass {
pigeon_newInstance?.call(
arg_url!,
arg_isForMainFrame!,
arg_isRedirect,
arg_isRedirect!,
arg_hasGesture!,
arg_method!,
arg_requestHeaders,
Expand All @@ -810,7 +814,7 @@ class WebResourceRequest extends PigeonInternalProxyApiBaseClass {
pigeon_instanceManager: pigeon_instanceManager,
url: arg_url!,
isForMainFrame: arg_isForMainFrame!,
isRedirect: arg_isRedirect,
isRedirect: arg_isRedirect!,
hasGesture: arg_hasGesture!,
method: arg_method!,
requestHeaders: arg_requestHeaders,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ abstract class WebResourceRequest {
late bool isForMainFrame;

/// Whether the request was a result of a server-side redirect.
late bool? isRedirect;
late bool isRedirect;

/// Whether a gesture (such as a click) was associated with the request.
late bool hasGesture;
Expand Down