
flutter-implement-json-serialization
Create model classes with `fromJson` and `toJson` methods using `dart:convert`
by flutterFree
Description
flutter-implement-json-serialization is an agent skill for writing JSON serialization by hand in Flutter, using the built-in dart:convert library. It is meant for simple data models where you map JSON keys to class properties yourself, rather than generating code. The skill's guidelines say to call jsonEncode and jsonDecode from dart:convert, to cast the result of jsonDecode to Map<String, dynamic> for objects or List<dynamic> for arrays, and to put each model in a plain class with a fromJson factory constructor and a toJson method. For large documents that take more than about 16 milliseconds to parse, it advises running the parsing in an isolate with compute() so the UI does not stall. When an HTTP response has an unsuccessful status code, the skill says to throw an exception rather than return null. A workflow walks the agent through implementing a serializable model and then through fetching and parsing JSON from a network call. Examples are included. The skill is part of Flutter's agent-plugins repository, and it is installed with the skills command in a compatible agent such as Claude Code. It is useful for Flutter developers who prefer hand-written models to generated ones.…
Highlights
- Hand-written models with fromJson and toJson
- Uses dart:convert encode and decode
- Parses large JSON in an isolate with compute()
- Throws on failed HTTP responses
Ratings & Reviews
No ratings yet
Be the first to rate flutter-implement-json-serialization.
People also visit

dart-flutter-patterns
Production-ready Dart and Flutter patterns covering null safety

flutter-dart-code-review
Library-agnostic Flutter/Dart code review checklist covering widget best

flutter-add-widget-preview
Adds interactive widget previews to the project using the previews.dart system
flutter-implement-json-serialization FAQ
What does this skill do?
It guides an agent to write JSON serialization for Flutter models by hand, using dart:convert, instead of generating the code.
When should I use it?
For simple data models where you map JSON keys to properties yourself. The skill describes its own use case as manual mapping of JSON keys to class properties.
How are large JSON documents handled?
When parsing takes more than about 16 milliseconds, the skill advises moving the parsing into an isolate with compute() to keep the UI responsive.
What happens on a failed HTTP response?
The skill says to throw an exception when the status code is not successful, and not to return null.
How do I install it?
Run: npx skills add https://github.com/flutter/agent-plugins --skill flutter-implement-json-serialization
What security audits has it passed?
Gen Agent Trust Hub and Socket passed. Snyk shows a warning.
What are the best flutter-implement-json-serialization alternatives?
Popular alternatives to flutter-implement-json-serialization include dart-flutter-patterns, flutter-dart-code-review and flutter-setup-localization. See all flutter-implement-json-serialization alternatives






