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
| class Animal { | |
| String nombre; | |
| int edad; | |
| Animal({required this.nombre, required this.edad}); | |
| void mostrarInformacion() { | |
| print('--- Información de Animal (desde Animal) ---'); | |
| print('Nombre: $nombre'); | |
| print('Edad: $edad años'); |
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, String> empleado ={ | |
| 'Nombre': 'Carlos Canedo', | |
| 'Lenguaje': 'Dart', | |
| 'Framework':'Flutter' | |
| }; | |
| print(empleado); | |
| } |
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() { | |
| saludar(); | |
| print("Función pasando parametros"); | |
| suma(5,3); | |
| crearusuario(nombre:'Carlos', edad:33, ciudad:'Chihuahua'); | |
| int resultado=resta(9,3); | |
| print("La resta es $resultado"); | |
| print("Funcion flecha"); | |
| int m=multiplica(3,3); | |
| print ("La multiplicación es $m"); |
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() { | |
| for (int i = 1; i <= 5; i++) { | |
| print(i); | |
| } | |
| print("Segundo ejemplo"); | |
| List<String> arcoiris=['Azul','Amarillo','verde','Violeta']; | |
| for(String color in arcoiris){ | |
| print(color); |
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() { | |
| var edad=20; | |
| if (edad>=18) { | |
| print("Puede entrar a bailar"); //Si la condición es verdadera | |
| } | |
| else { | |
| print("No puedes entrar a bailar, eres menor."); | |
| } //Fin del if | |
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
| //Carlos Eduardo Cañedo Figueroa | |
| void main() { | |
| int edad=12; | |
| double peso=45; | |
| String nombre="Carlos"; | |
| print(edad); | |
| print (peso); | |
| print(nombre); | |
| var ciudad ="Chihuahua"; |