Skip to content

Instantly share code, notes, and snippets.

@lukaszciastko
Created June 2, 2019 15:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukaszciastko/81eb65e836a498f391b400a49f45ec20 to your computer and use it in GitHub Desktop.
Save lukaszciastko/81eb65e836a498f391b400a49f45ec20 to your computer and use it in GitHub Desktop.
import 'package:meta/meta.dart';
class Task {
const Task({this.id, @required this.name, this.isComplete = false});
final int id;
final String name;
final bool isComplete;
Task copyWith({int id, String name, bool isComplete}) {
return Task(
id: id ?? this.id,
name: name ?? this.name,
isComplete: isComplete ?? this.isComplete,
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment