Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ChamseddineH/6c55cb294b14bafa8e3cbdc78bb97d1c to your computer and use it in GitHub Desktop.
Save ChamseddineH/6c55cb294b14bafa8e3cbdc78bb97d1c to your computer and use it in GitHub Desktop.
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