Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http 1.2.1 reasonPhrase null-safety issue #1190

Closed
LynoDesu opened this issue May 2, 2024 · 2 comments
Closed

http 1.2.1 reasonPhrase null-safety issue #1190

LynoDesu opened this issue May 2, 2024 · 2 comments
Labels
needs-info Additional information needed from the issue author package:http type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@LynoDesu
Copy link

LynoDesu commented May 2, 2024

After upgrading to http 1.2.1, I get the following errors when trying to build my Flutter app:

../../.pub-cache/hosted/pub.dev/http-1.2.1/lib/src/streamed_response.dart:26:13: Error: The parameter 'reasonPhrase' can't have a value of 'null' because of its type 'String', but the implicit default value is 'null'.
Try adding either an explicit non-'null' default value or the 'required' modifier.
super.reasonPhrase})
^^^^^^^^^^^^
../../.pub-cache/hosted/pub.dev/http-1.2.1/lib/src/streamed_response.dart:44:13: Error: The parameter 'reasonPhrase' can't have a value of 'null' because of its type 'String', but the implicit default value is 'null'.
Try adding either an explicit non-'null' default value or the 'required' modifier.
super.reasonPhrase});
^^^^^^^^^^^^
../../.pub-cache/hosted/pub.dev/http-1.2.1/lib/src/streamed_response.dart:26:13: Error: Type 'String' of the optional super-initializer parameter 'reasonPhrase' doesn't allow 'null', but the parameter doesn't have a default value, and the default value can't be copied from the corresponding parameter of the super constructor.
super.reasonPhrase})
^^^^^^^^^^^^
../../.pub-cache/hosted/pub.dev/http-1.2.1/lib/src/streamed_response.dart:44:13: Error: Type 'String' of the optional super-initializer parameter 'reasonPhrase' doesn't allow 'null', but the parameter doesn't have a default value, and the default value can't be copied from the corresponding parameter of the super constructor.
super.reasonPhrase});
^^^^^^^^^^^^
Target kernel_snapshot failed: Exception

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:compileFlutterBuildDebug'.

Downgrading to http 1.2.0 fixed my issue, but I have packages such as Firebase that use http 1.2.1.

@LynoDesu LynoDesu added package:http type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels May 2, 2024
@brianquinlan
Copy link
Collaborator

This error doesn't make sense to me - reasonPhrase is nullable in the BaseResponse super class. Could you try pub cache clean?

@brianquinlan brianquinlan added the needs-info Additional information needed from the issue author label May 2, 2024
Copy link

Without additional information we're not able to resolve this issue. Feel free to add more info or respond to any questions above and we can reopen the case. Thanks for your contribution!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-info Additional information needed from the issue author package:http type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

2 participants