ComTools class

Constructors

ComTools()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

createRedpackNoticeForReturn({required dynamic relationId, required dynamic sendUserId}) List
创建退回红包通知消息的通知id数组
createRedpackNoticeForSnatch({required dynamic relationId, required dynamic sendUserId, required dynamic luckUserId}) List
创建抢到红包通知消息的通知id数组
formatCNcharacters(String str, {int len = 16, String etc = '…'}) String
截取字符串,中文算两个字符,英文算一个字符
formatDateTime(int mills, {bool mmDDhhMM = false, bool yyMMdd = false, bool hhmmss = false}) String
格式化显示时间
formatDenyDateTime(int deny, {String y = '年', String M = '月', String d = '日', String h = '时', String m = '分', String s = '秒'}) String
格式化封号时间
formatDurationTime(int millis) String
格式化时间长度
formatLocationShowArea(Location location) String
格式化定位显示地址
formatTeamNick(Team team) String
格式化群组显示名称
formatTeamUserNick(TeamShip ship, User user) String
格式化群组成员昵称
formatUserNick(User user) String
格式化用户显示昵称
formatUserNo(User user, {required String empty}) String
格式化用户显示账号
formatUserShipNick(UserShip ship, User user) String
格式化用户好友昵称
formatUserShowArea(User who) String
格式化用户显示地址
formatWaitShipApply(UserShip ship, {required String empty}) String
格式化好友申请内容
generateUserEnterSign(String secret, String token, String uid, int mill) String
生成userEnter路由的签名
getDayEndMillisByDateOffset(DateTime dateTime, {int offsetDay = 0}) int
获取以dateTime为参考日期,偏移offsetDay天的毫秒结束时间戳
getDayStartMillisByDateOffset(DateTime dateTime, {int offsetDay = 0}) int
获取以dateTime为参考日期,偏移offsetDay天的毫秒开始时间戳
getLuckUserIdFromRedpackNotice(List redpackNotice) → dynamic
从通知id数组读取原始红包消息的id
getRelationIdFromRedpackNotice(List redpackNotice) → dynamic
从通知id数组读取原始红包消息的id
getSendUserIdFromRedpackNotice(List redpackNotice) → dynamic
从通知id数组读取原始红包消息的id
isRedpackReturnNotice(List redpackNotice) bool
是否为退回红包通知消息的通知id数组
isRedpackSnatchNotice(List redpackNotice) bool
是否抢到红包通知消息的通知id数组
isTeamAdmin(Team team, dynamic uid) bool
拥有群组超级管理权限或普通管理权限
isTeamNormalAdmin(Team team, dynamic uid) bool
拥有群组普通管理权限,且无超级管理权限
isTeamShipFromSystem(TeamShip ship, {required Team team, required dynamic self}) bool
是否为来源于系统级的群组关系
isTeamSuperAdmin(Team team, dynamic uid) bool
拥有群组超级管理权限
isUserShipFromSystem(UserShip ship, {required List staffIds, required dynamic self}) bool
是否为来源于系统级的用户关系
validateUserEnterSign(String secret, String token, String uid, int mill, String sign) bool
验证userEnter路由的签名