I have a simple question to ask.
Consider the two code examples,
// 1
class A {
final a = 23;
}
// 2
class A {
get a => 23;
}
in [2], the final field is converted into a getter.
question: Under which circumstances should either type of codes be used? Which one is the dart's preferred way?
Aucun commentaire:
Enregistrer un commentaire