-
-
Save nerdpepe/2d551d26bfb6191eaeb06829ad8668ef to your computer and use it in GitHub Desktop.
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 MyService { | |
static final MyService _instance = MyService._internal(); | |
factory MyService() => _instance; | |
int _myVariable = 0; | |
MyService._internal() { | |
_myVariable = 0; | |
} | |
int get myVariable => _myVariable; | |
set myVariable(int value) => myVariable = value; | |
void incrementMyVariable() => _myVariable++; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment