Created
April 27, 2020 18:46
-
-
Save r3dm1ke/61a68921e6b1d2a22793067b4808b5bd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:json_annotation/json_annotation.dart'; | |
| part 'car.d.dart'; | |
| @JsonSerializable() | |
| class Car { | |
| String make; | |
| String model; | |
| // Default constructor | |
| Car(this.make, this.model); | |
| factory Car.fromJson(Map<String, dinamic> json) => _$CarFromJson(json); | |
| Map<String, dynamic> toJson() => _$CarToJson(this); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment