This file contains 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
// 1. - Função do tipo void | |
// 2. - Função com tipo double, usando return | |
// 3. - Função com tipo double, usando Arrow-Function | |
void main() { | |
soma1(3, 4); | |
soma2(3, 4); | |
soma3(3, 4); | |
} |
This file contains 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
// 1. - `void`: é o tipo de retorno da função. → Pode ser qualquer `DataType`. | |
// 2. - `main`: o nome que a função receberá. | |
// 3. - `()`: passa os parâmetros - caso existam/necessários. | |
// 4. - `{}`: determina o corpo da função - a execução da função será feita aqui. | |
// 1. 2. 3. 4. | |
void main () { | |
soma(3, 4); | |
} |
This file contains 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
// 1. - `const`: variável inicializada em tempo de compilação; | |
// torna-se imutável - immutable -; | |
// seu valor não pode ser alterado. | |
// → Quando temos valores e componentes que não mudam: localização de imagens locais, estilizações de texto, componentes que não se alteram no layout e et cetera. | |
// | |
// 2. - `final`: variável inicializada em tempo de execução; | |
// seu valor deve ser inicializado e não pode ser alterado. | |
// → Leitura de arquivos, respostas vindas da internet, execuções feitas durante o uso da aplicação, et cetera. | |
// | |
// 3. - `late`: a variável é inicializada como Non-Nullable e deve ser inicializada após sua declaração; |
This file contains 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(){ | |
///////////////////////////////////////////////////////////// | |
// // | |
// +-------------------------------------------+ // | |
// | Tipo de Maps | Map Nulo | Item Nulo | // | |
// +--------------------+----------+-----------+ // | |
// 1. | Map<String, int> | Não | Não | // | |
// +--------------------+----------+-----------+ // | |
// 2. | Map<String, int>? | Sim | Não | // |
This file contains 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() { | |
Map<String, dynamic> mapa = { | |
'nome': 'Felipe', | |
'numero': 40028922, | |
}; | |
print(mapa); | |
print(mapa.length); |
This file contains 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() { | |
////////////////////////////////////// | |
// // | |
// +--------------------+ // | |
// | Maps | Tabela | // | |
// +--------------------+ // | |
// 1. | Nome | Felipe | // | |
// +--------------------+ // | |
// 2. | Numero | 40028922 | // |
This file contains 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); |
This file contains 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() { | |
/////////////////////////////////////////////////////////// | |
// // | |
// +-----------------------------------------+ // | |
// | Tipo de Listas | Lista Nula | Item Nulo | // | |
// +----------------+------------+-----------+ // | |
// 1. | List<String> | Não | Não | // | |
// +----------------+------------+-----------+ // | |
// 2. | List<String>? | Sim | Não | // |
This file contains 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() { | |
// 1. Apresentar | |
List lista1 = [7, 'Felipe', true]; | |
var lista2 = [7, 'Felipe', true]; | |
print(lista1); | |
print(lista2); |
This file contains 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() { | |
String superior = 'Superior 01'; | |
void funcaoInterna() { | |
superior = 'Superior 02'; | |
String interna = 'Interna'; | |
} | |
interna = 'Tentando consultar externamente'; | |
// Não executará devido seu escopo estar dentro de `funcaoInterna` |