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

阅读 82

2022-05-16

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




相关推荐

精彩评论(0)

0 0 举报