Skip to content

Instantly share code, notes, and snippets.

@r3dm1ke
Created April 27, 2020 18:34
Show Gist options
  • Select an option

  • Save r3dm1ke/27c668dd2330d4460a849f5566c7ddf4 to your computer and use it in GitHub Desktop.

Select an option

Save r3dm1ke/27c668dd2330d4460a849f5566c7ddf4 to your computer and use it in GitHub Desktop.
class Car {
final String make;
final String model;
// Default constructor
Car(this.make, this.model);
Car.fromJson(Map<String, dynamic> json)
: make = json['make'],
model = json['model'];
Map<String, dynamic> toJson() =>
{
'make': make,
'model': model
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment