Skip to content

Instantly share code, notes, and snippets.

@leonus96
Last active October 17, 2023 03:00
Show Gist options
  • Save leonus96/e5b04fd2101a0510fca1dfb1dfc63d0d to your computer and use it in GitHub Desktop.
Save leonus96/e5b04fd2101a0510fca1dfb1dfc63d0d to your computer and use it in GitHub Desktop.
variables

variables

Peusdkjansdaslkndlaskndalskn

void main() {
/// VARIABLES EN DART
/// Sintaxis1: tipo nombre = valor;
/// Sintaxis2: tipo nombre;
///
/// FASE DE UNA VARIABLE
///
/// 1. Declaración:
/// var peso;
/// 2. Inicialización:
/// peso = 70.6;
/// 2. Destrucción:
/// esto es automático :)
/// Ejemplo:
/// var peso;
/// peso = 50.8;
/// print(peso);
/// Ejemplo 2:
/// var peso = 50.8;
/// print(peso);
/// TIPOS DE DATOS
/// Numbers (int: 8, double:4.5)
/// Ejemplo:
/// int edad = 8;
/// double peso = 70.5;
/// Strings (String: 'Mi Texto')
/// String nombre = 'Joseph';
/// print(nombre);
/// Booleans (bool: true / false)
/// bool esProfesor = true;
/// print(esProfesor);
/// Lists (List)
/// Sets (Set)
/// Maps (Map)
/// dinámico (dynamic)
/// dynamic valor = 22;
/// valor = 'veintidos';
/// print(valor);
/// The value null (Null)
/// var valor;
/// valor = 'Algo';
/// valor = null;
/// print(valor);
/// CONCATENACION/INTERPOLACION DE CADENAS:
/// String nombre = 'Joseph';
/// int edad = 27;
/// print('La edad de $nombre es $edad');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment