Created
February 4, 2020 19:49
-
-
Save bobjackman/3d0b7f2f3cd48338cc985ecac5297bb0 to your computer and use it in GitHub Desktop.
Dart Read-Only Properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SomeClass { | |
String _foobar; | |
String get foobar => _foobar; | |
// note: no setter defined = can't write new values | |
SomeClass(this._foobar); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment