Skip to content

Instantly share code, notes, and snippets.

@RedBrogdon
Created August 1, 2018 18:26
Show Gist options
  • Save RedBrogdon/fd57f588baa0668cef3e130271c7f558 to your computer and use it in GitHub Desktop.
Save RedBrogdon/fd57f588baa0668cef3e130271c7f558 to your computer and use it in GitHub Desktop.
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