Skip to content

Instantly share code, notes, and snippets.

@SOS77777
Created January 26, 2020 00:36
Show Gist options
  • Save SOS77777/4d6297e3b0a52e262e1987bb1568170e to your computer and use it in GitHub Desktop.
Save SOS77777/4d6297e3b0a52e262e1987bb1568170e to your computer and use it in GitHub Desktop.
class Human{
String _name ;
String _address;
int _age;
//الاخصار الصحيح في الويندوز Alt+Insert to build getter and setter
Human(this._address , this._name , this._age);
// int get age => _age;
// String get address => _address;
//String get name => _name;
//يمكن انشاءها ايضا بهذه الطريقة
void setname (String name){
this._name = name;
}
String getname (){
return this._name;
}
void setage (int age ){
this._age = age ;
}
int getage (){
return this._age;
}
void setaddress (String address){
this._address = address;
}
String getaddress (){
return this._address;
}
}
import 'package:Education1/episode twelve.dart';
main() {
Human human = Human('sadsad', 'asd', 33);
human.setname('abo roomy');
print(human.getname());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment