Python has the possibility to have a method be accessed like a property with the decorator @property. Does Dart have anything like this?
class Test():
@property
def example():
return "This isn't really a property"
a = new Test()
print a.example
The notion of getters looks similar :
class Test {
String get example {
return "This isn't really a property";
}
}
main() {
var a = new Test();
print(a.example);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With