Created
November 10, 2021 02:43
-
-
Save felipecastrosales/6f08f1d0f44c6537deb59ef2788b86e6 to your computer and use it in GitHub Desktop.
Funções nas Listas
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() { | |
List<String> lista = ['Felipe', 'Paulo', 'Guilherme']; | |
print(lista.length); | |
print(lista.first); | |
print(lista.last); | |
lista.add('Isabela'); | |
print(lista); | |
lista.addAll(['Dalton', 'Joseph']); | |
print(lista); | |
lista.insert(0, 'Amanda'); | |
print(lista); | |
lista.contains('Paulo'); | |
print(lista); | |
lista.remove('Felipe'); | |
print(lista); | |
lista.removeAt(0); | |
print(lista); | |
lista.forEach((nome) { | |
print(nome.toUpperCase()); | |
}); | |
List<int> zeros = List.filled(4, 0); | |
print(zeros); | |
List<int> generate = List.generate(4, (i) => i + 1); | |
print(generate); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment