mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-07-10 19:20:12 +08:00
@@ -1,6 +1,6 @@
|
||||
int? safeToInt(dynamic value) => switch (value) {
|
||||
int() => value,
|
||||
String() => int.tryParse(value),
|
||||
num() => value.toInt(),
|
||||
int _ => value,
|
||||
String _ => int.tryParse(value),
|
||||
num _ => value.toInt(),
|
||||
_ => null,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user