Created
September 2, 2021 17:51
-
-
Save kururu-abdo/b0e85552a9d51f9a73bf2b82fe63b44a 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
void main() { | |
var state = AppState.instance; | |
print(state.appName); | |
} | |
class AppState { | |
String appName; | |
AppState._internal(){ | |
appName="FaceBook"; | |
} | |
static AppState _instance; | |
static AppState get instance { | |
if(_instance == null) { | |
_instance= AppState._internal(); | |
; | |
} | |
return _instance; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment