We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 993939b commit 927c689Copy full SHA for 927c689
lib/utils/utils.dart
@@ -356,6 +356,8 @@ class Utils {
356
return '${difference.inHours}小时前';
357
} else if (difference.inMinutes > 0) {
358
return '${difference.inMinutes}分钟前';
359
+ } else if (difference.inSeconds > 0) {
360
+ return '${difference.inSeconds}秒前';
361
} else {
362
return '刚刚';
363
}
@@ -383,8 +385,10 @@ class Utils {
383
385
formatType: formatType);
384
386
387
debugPrint('distance: $distance');
- if (distance <= 60) {
388
+ if (distance == 0) {
389
390
+ } else if (distance < 60) {
391
+ return '$distance秒前';
392
} else if (distance <= 3600) {
393
return '${(distance / 60).floor()}分钟前';
394
} else if (distance <= 43200) {
0 commit comments