This file contains hidden or 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
abstract class Animal { } | |
abstract class Mamifero extends Animal { } | |
abstract class Ave extends Animal { } | |
abstract class Pez extends Animal { } | |
abstract class Volador { | |
void volar() => print('estoy volando'); | |
} |
This file contains hidden or 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(){ | |
final motorcycle = new Motorcycle('Kawasaki Ern 600'); | |
print(motorcycle); | |
} | |
abstract class Vehicle { | |
String model; | |
Vehicle(this.model); | |
This file contains hidden or 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(){ | |
final motorcycle = new Motorcycle(); | |
motorcycle.startEngine(); | |
print('engine started: ${motorcycle.isEngineStarted}'); | |
motorcycle.stopEngine(); | |
print('engine started: ${motorcycle.isEngineStarted}'); | |
} |
This file contains hidden or 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
import 'dart:math' as math; | |
void main(){ | |
final square = new Square(side: 7); | |
print('lado: ${square.side}'); | |
print('area: ${square.area}'); | |
square.area = 25; | |
print('lado: ${square.side}'); | |
print('area: ${square.area}'); |
This file contains hidden or 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(){ | |
final Map<String, String> map = { | |
'name': 'Erik Lehnsherr' | |
}; | |
final batman = new Hero.fromJson(map); | |
print(batman); | |
} |
This file contains hidden or 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(){ | |
final magneto = new Hero( | |
name: 'Erik Lehnsherr', | |
power: 'magnetism' | |
); | |
print(magneto); | |
final unknow = new Hero( | |
power: 'super speed' |
This file contains hidden or 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() { | |
String name = 'Roberto'; | |
String lastName = 'Gonzalez'; | |
hello(name: name); | |
hello(name: name, lastName: lastName); | |
hello(lastName: lastName, name: name);} | |
void hello({ | |
required String name, |
This file contains hidden or 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() { | |
hello(); | |
} | |
void hello({String name = 'no name'}) { | |
print( 'Hello $name' ); | |
} |
This file contains hidden or 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() { | |
const name = 'Leonardo'; | |
hello( name ); | |
print(sum(3,5)); | |
} | |
void hello(String name) { | |
print( 'Hello $name' ); | |
} |
This file contains hidden or 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() { | |
Map<String, dynamic> persona = { | |
'nombre': 'leonardo', | |
'apellido': 'salas', | |
'edad': 40, | |
'true': false | |
}; | |
print (persona); | |
persona.addAll({'casado': true}); |
NewerOlder