Created
November 29, 2016 07:38
-
-
Save lajunta/c8bf5367fb50b08a8bc5f22ff57b8719 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 AppConfig{ | |
bool is_login ; | |
String username; | |
AppConfig({this.is_login, this.username}); | |
} | |
class MyApp{ | |
static AppConfig appconfig = new AppConfig(is_login: false, username: "guest"); | |
static updateConfig(AppConfig aconfig){ | |
appconfig = aconfig; | |
} | |
} | |
void main(){ | |
AppConfig bconfig = new AppConfig(username: "张晓亚",is_login: true); | |
MyApp.updateConfig(bconfig); | |
print(MyApp.appconfig.is_login); | |
print(MyApp.appconfig.username); | |
print(true); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment