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
void main(){ | |
var cookie = CookieCutter(); | |
print('$cookie'); | |
} | |
class CookieCutter { | |
} |
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
void main(){ | |
var cookie = CookieCutter(Shape.STAR); | |
print('Name: ${cookie.eat()}'); | |
print('Is $cookie eaten already? : ${cookie.isEaten()}'); | |
print('Name: ${cookie.eat()}'); | |
// This won't work because CookieCutter._shape is private | |
// and can only be accessed from the inside of cookie object | |
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
void main(){ | |
var name = Character('Dash','Blue'); | |
print('Name: ${name.printName()}'); | |
} | |
class Character { | |
String _firstName; | |
String _lastName; |
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
void main(){ | |
var name = 'Dash Blue'; | |
print('Name: $name'); | |
} |
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
void main(){ | |
var name = giveFullName('Dash','Blue'); | |
print('Name: $name'); | |
} | |
String giveFullName(String firstName, String lastName) { | |
return '$firstName $lastName'; |
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
void main(){ | |
var name = 'Dash'; | |
print('Name: $name'); | |
} |
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
void main(){ | |
var name = 'Dash'; | |
print('Name: $name'); | |
} |
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
void main(){ | |
var name = 'Dash'; | |
giveLastName(name); | |
print('Name: $name'); | |
} | |
void giveLastName(String name) { |
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
void main(){ | |
var a = 10; | |
var b = 5; | |
var sum = a + b; | |
var sub = a - b; | |
var div = a / b; | |
var mul = a * b; | |
var mod = a % b; |
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
void main() { | |
print ('Hello World'); | |
var a = 10; | |
print ('I like number $a'); | |
for (var i = 0; i < 1000; i++) { | |
if(i % 7 != 0) { | |
continue; |