qs_dart
1.9.0, released 7 weeks ago by tusar.dev
A query string encoding and decoding library for Dart ported from JavaScript's qs.
What it does
Encodes Dart maps into query strings and decodes query strings into nested maps and lists. It supports advanced features like dot notation, custom delimiters, different list formats, character sets, and safety limits.
AI-written summary of version 1.9.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to encode complex, nested Dart maps into URL query strings.
- You need to parse complex query strings with nested brackets or dot notation into maps.
- You want parity with the JavaScript 'qs' library for API interoperability.
Skip it when
- You only need basic, flat query parameter manipulation covered by Dart's built-in Uri class.
Strengths
- Supports deeply nested maps and lists using bracket or dot notation.
- Highly configurable options for charset encoding, duplicate handling, and depth limits.
- Provides convenient Uri extensions for idiomatic Dart usage.
Weaknesses
- Adds an external dependency overhead for functionality partially handled by core libraries if query strings are completely flat.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 3
import 'package:qs_dart/qs_dart.dart';
import 'package:test/test.dart';
void main() {
test('Simple example', () {
expect(
QS.decode('a=c'),
equals({'a': 'c'}),
);
expect(
QS.encode({'a': 'c'}),
equals('a=c'),
);
});
}Alternatives
Packages that do the same job and could replace qs_dart.
- cbor
A Dart library for RFC8949‑compliant CBOR encoding and decoding.
89Compare - csv_plus
Fast, zero-dependency CSV parser, encoder, streamer, and query engine for Dart.
82Compare - standard_message_codec
Binary codec for efficient encoding/decoding of Dart objects without a schema.
80Compare - validators2
String validation and sanitization for Dart.
83Compare
Works with
Packages commonly used together with qs_dart: ones it builds on, ones built on it, and its own family.