You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
716 B
19 lines
716 B
//各种封装的小函数
|
|
|
|
import 'package:bruno/bruno.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
void toast(String msg, BuildContext context){
|
|
BrnToast.show(msg, context);
|
|
}
|
|
|
|
String formattedTime(int timestamp){
|
|
|
|
|
|
// 使用DateTime.fromMillisecondsSinceEpoch来创建DateTime对象
|
|
DateTime dateTime = DateTime.fromMillisecondsSinceEpoch(timestamp, isUtc: false);
|
|
|
|
// 手动格式化日期和时间
|
|
String formattedDateTime = '${dateTime.year}-${dateTime.month.toString().padLeft(2, '0')}-${dateTime.day.toString().padLeft(2, '0')} ${dateTime.hour.toString().padLeft(2, '0')}:${dateTime.minute.toString().padLeft(2, '0')}:${dateTime.second.toString().padLeft(2, '0')}';
|
|
return formattedDateTime;
|
|
}
|