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
// ignore_for_file: prefer_function_declarations_over_variables | |
void main() { | |
String message = 'Interessante'; | |
print('Antes: $message'); | |
Function showMessage = () { | |
message = 'Boto fé'; | |
print('Depois: $message'); |
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() { | |
double media = 9.7; // teste com valores menores que 6, e entre 6 e 8.9 | |
var feedback = media > 6 ? 'Você foi aprovado' : 'Você foi reprovado'; | |
print(feedback); | |
} |
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() { | |
double media = 9.7; | |
if (media < 6) { | |
print('Você foi reprovado'); | |
} else { | |
print('Você foi aprovado'); | |
} | |
} |
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() { | |
var firstCondition = true; | |
var secondCondition = (true && true); | |
if (firstCondition) { | |
// Primeira condição cumprida | |
print('caiu no if'); | |
} else if (secondCondition) { | |
// Segunda condição cumprida e primeira 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. Sem Inferência de Tipo: | |
String nome1 = 'Rocketseat'; | |
bool escola1 = true; | |
int quantidade1 = 3; | |
print(nome1); | |
print(escola1); | |
print(quantidade1); |
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(){ | |
int algarismo = 7; | |
switch(algarismo) { | |
case -3: | |
case -2: | |
case -1: | |
print('Você escolheu negativo'); | |
break; | |
case 1: |
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(){ | |
// Isso não é mais possível | |
// Animal animal = Animal(); | |
// animal.comunicacao(); | |
Cachorro doge = Cachorro(); | |
doge.comunicacao(); | |
Gato gato = Gato(); | |
gato.comunicacao(); |
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(){ | |
// Isso não é mais possível | |
// Animal animal = Animal(); | |
// animal.comunicacao(); | |
Cachorro doge = Cachorro(); | |
doge.comunicacao(); | |
Gato gato = Gato(); | |
gato.comunicacao(); |
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(){ | |
Animal animal = Animal(); | |
animal.comunicacao(); | |
Cachorro doge = Cachorro(); | |
doge.comunicacao(); | |
Gato gato = Gato(); | |
gato.comunicacao(); |
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(){ | |
Cachorro doge = Cachorro(); | |
doge.comunicacao(); | |
Gato gato = Gato(); | |
gato.comunicacao(); | |
} |