Skip to content

Instantly share code, notes, and snippets.

@DevKhalyd
Created June 13, 2020 02:30
Show Gist options
  • Save DevKhalyd/33ac194b1389c0dd9e9a148459b9e1b7 to your computer and use it in GitHub Desktop.
Save DevKhalyd/33ac194b1389c0dd9e9a148459b9e1b7 to your computer and use it in GitHub Desktop.
An example of the copyWith method
//Return the same values and If you want to update any value you can put it
Task copyWith(
{String id,
String initDate,
String endDate,
String task,
bool isComplete}) =>
Task(
id: id ?? this.id,
initDate: initDate ?? this.initDate,
endDate: endDate ?? this.endDate,
task: task ?? this.task,
isComplete: isComplete ?? this.isComplete,
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment