Skip to content

Instantly share code, notes, and snippets.

@felipecastrosales
Created January 10, 2022 18:49
Show Gist options
  • Save felipecastrosales/f642ecd6edf496f62c079adaa12e6362 to your computer and use it in GitHub Desktop.
Save felipecastrosales/f642ecd6edf496f62c079adaa12e6362 to your computer and use it in GitHub Desktop.
Variáveis | Inferência de Tipo
void main() {
// 1. Sem Inferência de Tipo:
String nome1 = 'Rocketseat';
bool escola1 = true;
int quantidade1 = 3;
print(nome1);
print(escola1);
print(quantidade1);
print(nome1.runtimeType);
print(escola1.runtimeType);
print(quantidade1.runtimeType);
///////////////////////////////////////////////////
// 2. Com Inferência de Tipo:
var nome2 = 'Rocketseat'; // String
var escola2 = true; // bool
var quantidade2 = 3; // int
print(nome2);
print(escola2);
print(quantidade2);
print(nome2.runtimeType);
print(escola2.runtimeType);
print(quantidade2.runtimeType);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment