Advertisement
Guest User

Untitled

a guest
Mar 24th, 2019
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. abstract class BuildMode {
  2. static final BuildModeType buildMode = () {
  3. if (const bool.fromEnvironment('dart.vm.product')) {
  4. return BuildModeType.release;
  5. }
  6. var result = BuildModeType.profile;
  7. assert(() {
  8. result = BuildModeType.debug;
  9. return true;
  10. }());
  11. return result;
  12. }();
  13.  
  14. static final bool isDebug = buildMode == BuildModeType.debug;
  15. static final bool isNotDebug = !isDebug;
  16. static final bool isProfile = buildMode == BuildModeType.profile;
  17. static final bool isNotProfile = !isProfile;
  18. static final bool isRelease = buildMode == BuildModeType.release;
  19. static final bool isNotRelease = !isRelease;
  20. }
  21.  
  22. enum BuildModeType {
  23. debug,
  24. profile,
  25. release,
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement