Prepare release v4.1.0 (#100)
* Also make private _State class an enum
* minor bump with new features
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5be8452..3670ab8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,10 +1,8 @@
-## 4.0.3-wip
+## 4.1.0
* `CaseInsensitiveMap`: added constructor `fromEntries`.
-
-* Require Dart 3.4
-
-* collection: ^1.19.0
+* Require `package:collection` `^1.19.0`
+* Require Dart `^3.4.0`
## 4.0.2
diff --git a/analysis_options.yaml b/analysis_options.yaml
index d16ad82..c0bcfca 100644
--- a/analysis_options.yaml
+++ b/analysis_options.yaml
@@ -1,4 +1,4 @@
-# https://dart.dev/guides/language/analysis-options
+# https://dart.dev/tools/analysis#the-analysis-options-file
include: package:dart_flutter_team_lints/analysis_options.yaml
analyzer:
diff --git a/lib/src/chunked_coding/decoder.dart b/lib/src/chunked_coding/decoder.dart
index 5388ae1..9eb8e93 100644
--- a/lib/src/chunked_coding/decoder.dart
+++ b/lib/src/chunked_coding/decoder.dart
@@ -173,63 +173,63 @@
/// An enumeration of states that [_Sink] can exist in when decoded a chunked
/// message.
-class _State {
+enum _State {
/// The parser has fully parsed one chunk and is expecting the header for the
/// next chunk.
///
/// Transitions to [size].
- static const boundary = _State._('boundary');
+ boundary('boundary'),
/// The parser has parsed at least one digit of the chunk size header, but has
/// not yet parsed the `CR LF` sequence that indicates the end of that header.
///
/// Transitions to [sizeBeforeLF].
- static const size = _State._('size');
+ size('size'),
/// The parser has parsed the chunk size header and the CR character after it,
/// but not the LF.
///
/// Transitions to [body] or [bodyBeforeCR].
- static const sizeBeforeLF = _State._('size before LF');
+ sizeBeforeLF('size before LF'),
/// The parser has parsed a chunk header and possibly some of the body, but
/// still needs to consume more bytes.
///
/// Transitions to [bodyBeforeCR].
- static const body = _State._('body');
+ body('body'),
// The parser has parsed all the bytes in a chunk body but not the CR LF
// sequence that follows it.
//
// Transitions to [bodyBeforeLF].
- static const bodyBeforeCR = _State._('body before CR');
+ bodyBeforeCR('body before CR'),
// The parser has parsed all the bytes in a chunk body and the CR that follows
// it, but not the LF after that.
//
- // Transitions to [bounday].
- static const bodyBeforeLF = _State._('body before LF');
+ // Transitions to [boundary].
+ bodyBeforeLF('body before LF'),
/// The parser has parsed the final empty chunk but not the CR LF sequence
/// that follows it.
///
/// Transitions to [endBeforeLF].
- static const endBeforeCR = _State._('end before CR');
+ endBeforeCR('end before CR'),
/// The parser has parsed the final empty chunk and the CR that follows it,
/// but not the LF after that.
///
/// Transitions to [end].
- static const endBeforeLF = _State._('end before LF');
+ endBeforeLF('end before LF'),
/// The parser has parsed the final empty chunk as well as the CR LF that
/// follows, and expects no more data.
- static const end = _State._('end');
+ end('end');
- final String _name;
+ const _State(this.name);
- const _State._(this._name);
+ final String name;
@override
- String toString() => _name;
+ String toString() => name;
}
diff --git a/pubspec.yaml b/pubspec.yaml
index ef5baea..7bf5b8b 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,5 +1,5 @@
name: http_parser
-version: 4.0.3-wip
+version: 4.1.0
description: >-
A platform-independent package for parsing and serializing HTTP formats.
repository: https://github.com/dart-lang/http_parser