Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lawreyios/47bcddfb6518459891ff7f335e5167b6 to your computer and use it in GitHub Desktop.
Save lawreyios/47bcddfb6518459891ff7f335e5167b6 to your computer and use it in GitHub Desktop.
import 'package:scoped_model/scoped_model.dart';
class MainModel extends Model {
String _name = "";
int _count = 0;
String get name {
return _name;
}
int get count {
return _count;
}
void updateName(String name) {
_name = name;
}
void incrementCount() {
_count += 1;
notifyListeners();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment