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 Herramientas { | |
| String nombre; | |
| String tipo; | |
| int pesoGramos; | |
| Herramientas(this.nombre, this.tipo, this.pesoGramos); | |
| void mostrarDatos() { | |
| print('--- Datos de la herramienta con herencia ---'); | |
| } |
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() { | |
| // --- Llamadas a Funciones Tradicionales --- | |
| print('--- Funciones Tradicionales ---'); | |
| int resultadoSuma = sumarTradicional(10, 5); | |
| int resultadoResta = restarTradicional(20, 8); | |
| misDatos(); | |
| print('Suma Tradicional: $resultadoSuma'); | |
| print('Resta Tradicional: $resultadoResta'); | |
| // --- Llamadas a Funciones Flecha --- |
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
| // Función con 3 parámetros nombrados requeridos y 1 opcional | |
| void misDatos({ | |
| required String nombre, | |
| required int edad, | |
| required String gpo, | |
| String milenguajeprogramacion = "Dart (valor por defecto)", | |
| }) { | |
| print("mi nombre es : $nombre"); | |
| print("mi edad es : $edad"); | |
| print("mi Gpo es : $gpo"); |
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() { | |
| int edad=17; | |
| double estatura=1.71; | |
| String nombre="Aaron Dominguez" ; | |
| bool asistio=false; | |
| String gpo='6I'; | |
| print("Desarrollador Aaron Dominguez"); | |
| print("+-+-+-+-+-+-+-+-+-+-+-+-+-+-+"); | |
| print("Mostrar datos"); | |
| print("Nombre : $nombre"); |