2023-08-18 21:55:18 +08:00

22 lines
547 B
Dart

class UserInfo {
static String uid = '';
static String token = '';
}
class ChatChannel {
String channelID;
int channelType;
ChatChannel(this.channelID, this.channelType);
}
class CommonUtils {
static String getAvatar(String channelID) {
return channelID.substring(0, 1);
}
static String formatDateTime(int timestamp) {
DateTime dateTime = DateTime.fromMillisecondsSinceEpoch(timestamp * 1000);
return "${dateTime.year}-${dateTime.month}-${dateTime.day} ${dateTime.hour}:${dateTime.minute}:${dateTime.second}";
}
}