Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

+ 0022 [判断] 运行时如何判断当前是不是release模式 #54

Open
toly1994328 opened this issue Aug 28, 2020 · 3 comments
Open
Labels
point The point of Flutter

Comments

@toly1994328
Copy link
Owner

const isPro = bool.fromEnvironment('dart.vm.product'); //是否release模式

@toly1994328 toly1994328 added the point The point of Flutter label Aug 28, 2020
@choykarl
Copy link

这个是判断flutter打出来的包是release包还是运行起来的环境是release环境。

@toly1994328
Copy link
Owner Author

运行时的环境, 是不是release

@toly1994328 toly1994328 changed the title + 0022 运行时如何判断当前是不是release模式 + 0022 [判断] 运行时如何判断当前是不是release模式 Sep 23, 2020
@JGNS
Copy link

JGNS commented Apr 25, 2023

高版本 已经有 const bool kReleaseMode = bool.fromEnvironment('dart.vm.product');直接调用这个属性即可。同理还有kDebugMode。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
point The point of Flutter
Projects
None yet
Development

No branches or pull requests

3 participants