Skip to content

Instantly share code, notes, and snippets.

@kmkkkp
Last active July 12, 2023 11:14
Show Gist options
  • Save kmkkkp/f052e7ce56f0375ebaef5a8e9fcfed13 to your computer and use it in GitHub Desktop.
Save kmkkkp/f052e7ce56f0375ebaef5a8e9fcfed13 to your computer and use it in GitHub Desktop.
CascadeNotation&Abstract

CascadeNotation&Abstract

Created with <3 with dartpad.dev.

abstract class Human{
void walk();
}
class Player extends Human{
String name;
int xp;
String team;
void walk(){
print("walking");
}
Player({
required this.name,
required this.xp,
required this.team,
});
void sayHello() {
print("Hi my name is $name");
}
}
class Coach extends Human{
void walk(){
print('the coach is wakling');
}
}
void main() {
var nico = Player(name: 'nico', xp: 200, team:'red')
..name = 'las'
..xp = 1200000
..team ='blue'
..sayHello();
var potato = nico
..name = 'dos'
..sayHello();
potato.sayHello();
nico.sayHello();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment