Created
June 13, 2020 02:30
-
-
Save DevKhalyd/33ac194b1389c0dd9e9a148459b9e1b7 to your computer and use it in GitHub Desktop.
An example of the copyWith method
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
//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