Skip to content

Instantly share code, notes, and snippets.

@KickedDroid
Last active January 8, 2019 00:48
Show Gist options
  • Save KickedDroid/d2ae20ebd55dace9fd2f4bebe9a9ce19 to your computer and use it in GitHub Desktop.
Save KickedDroid/d2ae20ebd55dace9fd2f4bebe9a9ce19 to your computer and use it in GitHub Desktop.
class UserModel extends Model {
String _userName = "";
String get userName => _userName;
// The changeName method has a String parameter to pass the value
void changeName(String newValue) {
// We set the users name to the updated value
_userName = newValue;
// Then notify all the listeners.
notifyListeners();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment