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模式,具体自行看源代码。

posted @ 2020-11-04 14:34  yongfengnice  阅读(4767)  评论(1编辑  收藏  举报