Skip to content

Latest commit

 

History

History
46 lines (32 loc) · 1.45 KB

README.md

File metadata and controls

46 lines (32 loc) · 1.45 KB

Dart QuickType

version: 2.5.1

A custom implemenation of JSON to Dart model class from QuickType.

Netlify Status

Site variation

This project is configure to fit my use case only so the default behavior will be:

  • All fields are final
  • All fields are required
  • Has an option to generate toJSON,copyWith and toString
  • support Equatable and JsonSerialize
  • No freezed or hive

Type setting

When Dart class is generated from json, nullable or non-nullable field are define below.

Type Nullable default value
String setting ""
bool setting false
int setting 0
double setting 0
Array never []
Object always null
DateTime always null
  • Array can never be null
  • Object and DateTime always nullable
  • Other types can configure with checkbox setting

Customize for your use case

  • edit Dart's quicktype config in custom_dart_renderer.ts
  • run npm run build to build from ts to vanilla js
  • test your change in index.html