Created
December 3, 2019 16:46
-
-
Save r3dm1ke/bab1a732f69985cc010c4fd2649a9884 to your computer and use it in GitHub Desktop.
A Task class for TODO application in Flutter
This file contains hidden or 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
class Task { | |
// Class properties | |
// Underscore makes them private | |
String _name; | |
bool _completed; | |
// Default constructor | |
// this syntax means that it will accept a value and set it to this.name | |
Task(this._name); | |
// Getter and setter for name | |
getName() => this._name; | |
setName(name) => this._name = name; | |
// Getter and setter for completed | |
isCompleted() => this._completed; | |
setCompleted(completed) => this._completed = completed; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment