Skip to content

Instantly share code, notes, and snippets.

@bobjackman
Created February 4, 2020 19:49
Show Gist options
  • Save bobjackman/3d0b7f2f3cd48338cc985ecac5297bb0 to your computer and use it in GitHub Desktop.
Save bobjackman/3d0b7f2f3cd48338cc985ecac5297bb0 to your computer and use it in GitHub Desktop.
Dart Read-Only Properties
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