0
是建議在DART getter和setter用來定義諸如屬性:使用getter和setter
class Car {
Engine engine;
bool get isEngineRunning => engine.isRunning;
void set isEngineRunning(bool isRunning) {
engine.isRunning = isRunning;
}
}
什麼是它的優勢?
的可能的複製[如何getter和setter改變達特屬性?](http://stackoverflow.com/questions/27683924/how-do-吸氣劑和制定者變化的屬性功能於鏢) – rinukkusu