fix: 搜索结果类型为课堂时渲染异常
This commit is contained in:
@ -50,6 +50,9 @@ class Utils {
|
||||
return time;
|
||||
}
|
||||
if (time < 3600) {
|
||||
if (time == 0) {
|
||||
return time;
|
||||
}
|
||||
final int minute = time ~/ 60;
|
||||
final double res = time / 60;
|
||||
if (minute != res) {
|
||||
@ -87,6 +90,9 @@ class Utils {
|
||||
|
||||
// 时间显示,刚刚,x分钟前
|
||||
static String dateFormat(timeStamp, {formatType = 'list'}) {
|
||||
if (timeStamp == 0 || timeStamp == null || timeStamp == '') {
|
||||
return '';
|
||||
}
|
||||
// 当前时间
|
||||
int time = (DateTime.now().millisecondsSinceEpoch / 1000).round();
|
||||
// 对比
|
||||
@ -103,6 +109,7 @@ class Utils {
|
||||
toInt: false,
|
||||
formatType: formatType);
|
||||
}
|
||||
print('distance: $distance');
|
||||
if (distance <= 60) {
|
||||
return '刚刚';
|
||||
} else if (distance <= 3600) {
|
||||
@ -344,9 +351,8 @@ class Utils {
|
||||
}
|
||||
|
||||
static List<int> generateRandomBytes(int minLength, int maxLength) {
|
||||
return List<int>.generate(
|
||||
random.nextInt(maxLength-minLength+1), (_) => random.nextInt(0x60) + 0x20
|
||||
);
|
||||
return List<int>.generate(random.nextInt(maxLength - minLength + 1),
|
||||
(_) => random.nextInt(0x60) + 0x20);
|
||||
}
|
||||
|
||||
static String base64EncodeRandomString(int minLength, int maxLength) {
|
||||
|
||||
Reference in New Issue
Block a user