Skip to content

Commit f89c02a

Browse files
committed
fix(Response): fix optional argument warning
1 parent 0b48918 commit f89c02a

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

lib/src/response/response.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,16 @@ class Response {
2121
/// Creates a new [Response] object.
2222
external factory Response([dynamic body, ResponseOptions? options]);
2323

24+
/// Creates a new response with a different URL.
25+
factory Response.redirect(String url, [int status = 302]) =>
26+
_redirect(url, status);
27+
2428
/// Returns a new [Response] object associated with a network error.
2529
external static Response error();
2630

2731
/// Creates a new response with a different URL.
28-
external static Response redirect(String url, [int status = 302]);
32+
@JS('redirect')
33+
external static Response _redirect(String url, int status);
2934
}
3035

3136
extension ResponseInstanceMembers on Response {

0 commit comments

Comments
 (0)