Created
June 25, 2022 17:41
-
-
Save ChamseddineH/6c55cb294b14bafa8e3cbdc78bb97d1c to your computer and use it in GitHub Desktop.
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() | |
{ | |
//data.type data.address = value; | |
//class.name object.name = class.name(); | |
Cars Caddy = Cars( | |
brand: "VW", | |
model: "Caddy", | |
color: 'black', | |
); | |
Cars Jetta = Cars( | |
brand: 'VW', | |
model: 'jetta', | |
color: 'grey', | |
); | |
//Jetta.printColor(); | |
//Jetta.printBrand(); | |
//Caddy.printBrand(); | |
//Caddy.printColor(); | |
//print(Caddy.color); | |
//print(Caddy.model); | |
//print(Caddy.brand); | |
zino( | |
data: 'dino', | |
color: 'red', | |
cars: Cars( | |
brand: '', | |
model: '', | |
color: '', | |
), | |
); | |
} | |
class zino | |
{ | |
late final String? data; | |
late final String? color; | |
late final Cars cars; | |
} | |
zino({ | |
this.data, | |
this.color, | |
}) | |
class Cars { | |
final String? brand; | |
final String? model; | |
final String? color; | |
// constuctor | |
Cars({ | |
this.brand, | |
this.model, | |
this.color, | |
}); | |
void printBrand(){ | |
print(brand); | |
} | |
void printColor(){ | |
print(color); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment