Created
February 10, 2019 22:46
-
-
Save VB10/6a98de482ae135bba3d16bc41900c394 to your computer and use it in GitHub Desktop.
Dart 101 Class use
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
class HardwareAndro { | |
String videoTitle; | |
var author; | |
int number; | |
int _channel; | |
var _data; | |
/** | |
* Encapsulation | |
*/ | |
void set channel(int value) { | |
this._channel = value; | |
} | |
int get channel { | |
return this._channel; | |
} | |
/** | |
* Arrow function Encapsulation | |
*/ | |
set data(var value) => this._data = value; | |
get data => this._data; | |
// HardwareAndro(String videoTitle, var author, int number) { | |
// this.videoTitle = videoTitle; | |
// this.author = author; | |
// this.number = number; | |
// } | |
HardwareAndro(this.videoTitle, this.author, this.number) {} | |
/** | |
* Custom constructor | |
*/ | |
HardwareAndro.MyCustructor(String videoTitle) { | |
this.videoTitle = videoTitle.length.toString(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment