Skip to content

Instantly share code, notes, and snippets.

View Aaron-0330's full-sized avatar
💭
I may be slow to respond.

Aaron-0330

💭
I may be slow to respond.
View GitHub Profile
@Aaron-0330
Aaron-0330 / claseherencia.dart
Created February 9, 2026 15:41
clase herramienta(padre) herencia martillo mostrando mis datos
class Herramientas {
String nombre;
String tipo;
int pesoGramos;
Herramientas(this.nombre, this.tipo, this.pesoGramos);
void mostrarDatos() {
print('--- Datos de la herramienta con herencia ---');
}
@Aaron-0330
Aaron-0330 / funcionesyflechas.dart
Created February 9, 2026 15:10
funcion normal y funcion flecha
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 ---
@Aaron-0330
Aaron-0330 / funcionparametros.dart
Created February 9, 2026 14:54
funcion con parametros nombrados y opcional
// 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");
@Aaron-0330
Aaron-0330 / variables_if.dart
Created February 4, 2026 19:46
Las variables + if else
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");