mirror of
https://github.com/qinglong-app/qinglong_app.git
synced 2025-10-09 16:48:19 +08:00
适配新版本api
This commit is contained in:
@@ -1,7 +1,40 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
import '../module/home/system_bean.dart';
|
||||
|
||||
class Utils {
|
||||
static final SystemBean systemBean = SystemBean();
|
||||
|
||||
static bool isUpperVersion() {
|
||||
try {
|
||||
List<String>? version = Utils.systemBean.version?.split("\.");
|
||||
|
||||
String f = version?[0] ?? "2";
|
||||
String s = version?[1] ?? "10";
|
||||
String t = version?[2] ?? "0";
|
||||
|
||||
int first = int.parse(f);
|
||||
int second = int.parse(s);
|
||||
int third = int.parse(t);
|
||||
|
||||
/// 2.10.13 及以下版本
|
||||
|
||||
if (first > 2) {
|
||||
return true;
|
||||
}
|
||||
if (second > 10) {
|
||||
return true;
|
||||
}
|
||||
if (third > 13) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static void hideKeyBoard(BuildContext context) {
|
||||
FocusScope.of(context).requestFocus(FocusNode());
|
||||
}
|
||||
@@ -71,7 +104,7 @@ class Utils {
|
||||
}
|
||||
|
||||
static String formatMessageTime(int time) {
|
||||
if(time == 0){
|
||||
if (time == 0) {
|
||||
return "-";
|
||||
}
|
||||
DateTime current = DateTime.now();
|
||||
|
||||
Reference in New Issue
Block a user