UUID v7 Generator
Generate time-ordered UUID v7 identifiers that index cleanly.
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 time-ordered UUID v7 identifiers that index cleanly.
Encode and decode Base32, including the Crockford and hex variants.
Convert JSON into XML, with control over attributes, arrays and the root element.
Compute a CRC-32 checksum in hex, decimal and signed form.
Re-indent JavaScript, with strings and regular expressions left alone.
Parse Set-Cookie and Cookie headers, and check the security flags.
Turn an array of JSON records into INSERT statements, with an optional CREATE TABLE.
Build a Content-Security-Policy header directive by directive.