From 7d35ade7f7609e057f0c83800772d3cb26173553 Mon Sep 17 00:00:00 2001 From: xiaodong <450468291@qq.com> Date: Sun, 15 Mar 2020 01:31:41 +0800 Subject: [PATCH] =?UTF-8?q?[plcs#8888]=20=E5=8F=96=E6=95=B4=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=8C=E6=89=93=E6=97=A5=E5=BF=97=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/utils/LogUtil.dart | 8 ++++---- lib/utils/solar_term_util.dart | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/utils/LogUtil.dart b/lib/utils/LogUtil.dart index 3bab744..87e2660 100644 --- a/lib/utils/LogUtil.dart +++ b/lib/utils/LogUtil.dart @@ -1,4 +1,5 @@ import 'package:flutter/cupertino.dart'; +import 'package:flutter/foundation.dart'; /** * 打印日志,外部可以控制日历信息的打印显示,方便调试查错 @@ -14,10 +15,9 @@ class LogUtil { * TAG:类名 * message:一般就方法名+自定义信息吧 */ - static void log( - {@required dynamic TAG , String message = ""}) { - if (_enableLog) { - print("flutter_custom_calendar------$TAG------>$message"); + static void log({@required dynamic TAG, String message = ""}) { + if (_enableLog && kDebugMode) { + debugPrint("flutter_custom_calendar------$TAG------>$message"); } } } diff --git a/lib/utils/solar_term_util.dart b/lib/utils/solar_term_util.dart index 4ddb53c..613566a 100644 --- a/lib/utils/solar_term_util.dart +++ b/lib/utils/solar_term_util.dart @@ -212,8 +212,8 @@ class SolarTermUtil { * @return 取整数部分 */ static double doubleFloor(double v) { + v = v.floor().toDouble(); if (v < 0) return v + 1; - return v; }