Skip to content

Instantly share code, notes, and snippets.

@VB10
Created February 10, 2019 22:46
Show Gist options
  • Save VB10/6a98de482ae135bba3d16bc41900c394 to your computer and use it in GitHub Desktop.
Save VB10/6a98de482ae135bba3d16bc41900c394 to your computer and use it in GitHub Desktop.
Dart 101 Class use
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