Random String Generator
Generate cryptographically random strings over any alphabet you choose.
Generate Dart model classes with fromJson and toJson from a sample payload.
With the methods included there is no build_runner step — the serialisation is written out in full.
The JSON to Dart Class converter writes Flutter-ready models: final fields, a const constructor with named parameters, and fromJson and toJson methods, all null safe without any build_runner step.
Flutter has no reflection, so every model needs its serialisation written out by hand — which is exactly the boilerplate this generates. Each class gets final fields, a const constructor with named parameters, a fromJson factory and a toJson method.
Null safety is handled properly rather than by making everything nullable. A field present in every record is non-nullable and marked required in the constructor; one that is sometimes missing gets a question mark and is optional. Nested objects call their own fromJson, and lists of objects map over the elements with the right cast, so the generated code compiles against a null-safe SDK without edits.
fromJson and toJson are generated in full, so there is no code-generation step and no build_runner to keep in sync.
Fields present in every record are non-nullable and required; the rest are nullable and optional. It compiles against Dart 2.12 and later unchanged.
Final fields and a const constructor, which is what lets Flutter skip rebuilding widgets whose inputs have not changed.
A list of objects maps over its elements with the right cast and the element type's fromJson — the pattern the Dart team documents.
Skip the methods entirely if you do use a code generator and only want the field declarations.
A real API response is ideal; an array detects optional fields.
Nested classes are named from the keys that hold them.
Keep fromJson and toJson, or generate plain data classes if you use a code generator instead.
Paste into a .dart file under lib/models.
No. The point of this output is that the serialisation is already written, so there is no build_runner step. Use json_serializable instead when you have dozens of models and want them regenerated on every schema change.
Yes. Fields that are always present are non-nullable and required; the rest are nullable and optional. It compiles against Dart 2.12 and later without changes.
Immutable models are the Flutter convention: they work correctly with const constructors and let the framework skip rebuilding widgets whose inputs have not changed.
A list of objects is mapped with the element type's fromJson and a cast to Map<String, dynamic>, which is the pattern the Dart team documents.
What people who use the JSON to Dart Class think of it. Reviews come from visitors and are posted as written.
No ratings yet
Yours would be the first.
0 reviews
Newest first
No reviews yet
Be the first to rate the JSON to Dart Class. It takes half a minute and no account.
Write the first reviewGenerate cryptographically random strings over any alphabet you choose.
Generate a CI workflow with caching, a version matrix and the right permissions.
Build a Content-Security-Policy header directive by directive.
Convert between signed and unsigned, with the negation steps shown.
Generate the border trick that makes triangles and tooltip arrows.
Every regex token, searchable, with an example of what it matches.
Convert internationalised domain names to punycode and back.
Build a cron schedule from controls and see the next times it runs.