-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
327 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
/// 消息类型 | ||
enum MsgType { | ||
heartbeat(0, '心跳检测'), | ||
loginMsg(1, '登录消息'), | ||
txtMsg(2, '文本'), | ||
picMsg(3, '图片'), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import 'package:easy_refresh/easy_refresh.dart'; | ||
|
||
class RefreshConstants { | ||
static ClassicHeader buildZhHeaders() { | ||
return const ClassicHeader( | ||
dragText: '下拉开始刷新', | ||
armedText: '松开开始刷新', | ||
readyText: '准备开始刷新', | ||
processedText: '刷新完成', | ||
processingText: '拼命加载中...', | ||
failedText: 'GG,刷新失败', | ||
messageText: '上次更新时间%T', | ||
noMoreText: '已经没有更多数据啦!', | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class TxtStyle { | ||
static TextStyle? titleS({ | ||
double size = 17, | ||
FontWeight fWeight = FontWeight.w600, | ||
}) { | ||
return TextStyle(fontSize: size, fontWeight: fWeight); | ||
} | ||
|
||
static TextStyle? contentS({ | ||
double size = 13, | ||
FontWeight fWeight = FontWeight.w400, | ||
Color? color, | ||
}) { | ||
return TextStyle(fontSize: size, fontWeight: fWeight, color: color); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
class TimeUtil { | ||
static String formatTimeAgo(int timestamp) { | ||
DateTime now = DateTime.now(); | ||
DateTime targetTime = DateTime.fromMillisecondsSinceEpoch(timestamp); | ||
|
||
Duration difference = now.difference(targetTime); | ||
|
||
if (difference.inDays > 0) { | ||
return '${difference.inDays} 天前'; | ||
} else if (difference.inHours > 0) { | ||
return '${difference.inHours} 小时前'; | ||
} else if (difference.inMinutes > 0) { | ||
return '${difference.inMinutes} 分钟前'; | ||
} else { | ||
return '刚刚'; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.