mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 03:06:59 +08:00
fix parse dyn
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -25,6 +25,13 @@ abstract class Utils {
|
||||
static final bool isDesktop =
|
||||
Platform.isWindows || Platform.isMacOS || Platform.isLinux;
|
||||
|
||||
static int? safeToInt(dynamic value) => switch (value) {
|
||||
int e => e,
|
||||
String e => int.tryParse(e),
|
||||
num e => e.toInt(),
|
||||
_ => null,
|
||||
};
|
||||
|
||||
static Future<bool> get isWiFi async {
|
||||
try {
|
||||
return Utils.isMobile &&
|
||||
|
||||
Reference in New Issue
Block a user