http icon indicating copy to clipboard operation
http copied to clipboard

Error in http_parser with dart 3.4

Open dannnnthemannnn opened this issue 1 year ago • 2 comments

Running flutter pub run build_runner build --output=build

yields

[WARNING] ../../../../.pub-cache/hosted/pub.dev/http_parser-4.0.2/lib/src/case_insensitive_map.dart:10:37: Error: The class 'CanonicalizedMap' can't be extended outside of its library because it's a final class.
class CaseInsensitiveMap<V> extends CanonicalizedMap<String, String, V> {

dannnnthemannnn avatar May 20 '24 22:05 dannnnthemannnn

Does this reproduce with http_parser 4.1.0 ?

Neither CanonicalizedMap https://github.com/dart-lang/collection/blob/0c1f829c29da1d63488be774f430b2035a565d6f/lib/src/canonicalized_map.dart#L13

nor CaseInsensitiveMap https://github.com/dart-lang/http_parser/blob/master/lib/src/case_insensitive_map.dart are marked with final it seems?

navaronbracke avatar Jul 03 '24 08:07 navaronbracke

You need to upgrade to latest version of collection (which flutter does not 'like', so you can use overrides to accomplish this)

NicolaVerbeeck avatar Jul 03 '24 08:07 NicolaVerbeeck