flutter判断app是否为debug或者release模式

flutter判断app是否为debug或者release模式

  • debug模式:
import 'package:flutter/foundation.dart';
static bool _debug = kDebugMode;	//constant下的一个常量
  • release模式:
import 'package:flutter/foundation.dart';
static bool _release = kReleaseMode;	//constant下的一个常量

还有一种是profile模式,具体自行看源代码。

原文地址:https://www.cnblogs.com/yongfengnice/p/13925825.html