Skip to content

Instantly share code, notes, and snippets.

@Sameerkash
Last active July 8, 2020 12:12
Show Gist options
  • Save Sameerkash/717cf9a4df457c57005e214bd77fcc2c to your computer and use it in GitHub Desktop.
Save Sameerkash/717cf9a4df457c57005e214bd77fcc2c to your computer and use it in GitHub Desktop.
part 'Todo.freezed.dart';
part 'Todo.g.dart';

@freezed
abstract class Todo with _$Todo {
  const factory Todo(
      {@required String id,
      String title,
      String subtitle,
      @Default(false) bool isDone}) = _Todo;

  factory Todo.fromJson(Map<String, dynamic> json) => _$TodoFromJson(json);

  Map<String, dynamic> toJson() => _$_$_TodoToJson(this);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment