Skip to content

alaincruz06/dart-quicktype

 
 

Repository files navigation

Dart QuickType

version: 2.1.6

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

Netlify Status

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

URL

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

About

Custom Dart quicktype for personal use case

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 73.9%
  • HTML 10.3%
  • JavaScript 8.4%
  • Dart 6.0%
  • CSS 1.4%