Skip to content

Instantly share code, notes, and snippets.

@ulisseshen
Last active February 8, 2023 18:10
Show Gist options
  • Save ulisseshen/e8aa9fc117a1d1c64f04e949488012b4 to your computer and use it in GitHub Desktop.
Save ulisseshen/e8aa9fc117a1d1c64f04e949488012b4 to your computer and use it in GitHub Desktop.
[mobile_dev] Aula 2 - Dart listas, índices, concatenação e interpolação de String, for e for-in
void main() {
List<int> numeros = pegarNumerosNoBackEnd();
print(numeros[0]);
print(numeros[1]);
print(numeros[2]);
print(numeros[3]);
List<String> nomes = pegarNomesDePessoasNoBancoDeDados();
print(nomes.length);
for(int indice=0; indice < nomes.length; indice++){
print("$indice - ${nomes[indice]}");
//print(indice.toString() + " - " + nomes[indice].toString());
}
for (String nome in nomes) {
print(nome);
}
}
List<int> pegarNumerosNoBackEnd(){
return [0, 1, 2, 3];
}
List<String> pegarNomesDePessoasNoBancoDeDados(){
return [
"Ulisses",
"Gustavo",
"Natã",
"Criss",
"Ana Beatriz"
];
}
@ulisseshen
Copy link
Author

adicionei a linha 14 com a concatenação da string sem interpolação.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment