Created
August 1, 2018 18:26
-
-
Save RedBrogdon/fd57f588baa0668cef3e130271c7f558 to your computer and use it in GitHub Desktop.
This file contains 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 'simple_object.g.dart'; | |
@JsonSerializable() | |
class SimpleObject extends Object with _$SimpleObjectSerializerMixin { | |
SimpleObject({ | |
this.aString, | |
this.anInt, | |
this.aDouble, | |
this.aListOfStrings, | |
this.aListOfInts, | |
this.aListOfDoubles, | |
}); | |
final String aString; | |
final int anInt; | |
final double aDouble; | |
final List<String> aListOfStrings; | |
final List<int> aListOfInts; | |
final List<double> aListOfDoubles; | |
factory SimpleObject.fromJson(Map<String, dynamic> json) => | |
_$SimpleObjectFromJson(json); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment