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() { | |
var spacecraft = Spacecraft("Roket 101", type: SpacecraftType.lander, launched: DateTime.tryParse("2022-01-02")); | |
spacecraft.launchDate = "2021-01-02"; | |
spacecraft.describe(); | |
} | |
enum SpacecraftType { | |
flyby, | |
orbitter, | |
lander, |
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() { | |
double kuadrat(double n) { | |
return n * n; | |
} | |
print(kuadrat(20)); | |
var spacecraft = Spacecraft("Roket 101", launched: DateTime.tryParse("2022-01-02")); | |
spacecraft.launchDate = "2021-01-02"; | |
spacecraft.describe(); |
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() { | |
String? nama = "Taufik"; | |
const umur = 20; | |
double? tinggi = 175.436537; | |
bool? isMarried; | |
bool isHasJob = true; | |
final jobs = <String>["Programmer", "Web Developer", "Software Engineer"]; | |
final bio = { | |
"Nama": nama ?? "Anonim", | |
"Umur": "$umur tahun", |
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() { | |
var nama = "Taufik"; | |
const umur = 20; | |
final double? tinggi; | |
bool? isMarried; | |
bool isHasJob = true; | |
final jobs = <String>["Programmer", "Web Developer", "Software Engineer"]; | |
// tidak bisa karena constant | |
// umur = 25; |
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() { | |
String nama = "Taufik"; | |
int umur = 20; | |
double tinggi = 175.35464; | |
bool isMarried = false; | |
bool isHasJob = true; | |
String bio = """ | |
Hello, I'm Taufik | |
I am Software Engineer | |
"""; |