Page 12 - Dart Language
P. 12
bool get isHungry => _isHungry;
bool set isHungry(bool hungry) => this._isHungry = hungry;
}
Dart class getters and setters allow APIs to encapsulate object state changes.
See dartpad example here: https://dartpad.dartlang.org/c25af60ca18a192b84af6990f3313233
Read Getting started with dart online: https://riptutorial.com/dart/topic/843/getting-started-with-dart
https://riptutorial.com/ 7

