mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-04 17:17:48 +08:00
6
lib/utils/parse_int.dart
Normal file
6
lib/utils/parse_int.dart
Normal file
@@ -0,0 +1,6 @@
|
||||
int? safeToInt(dynamic value) => switch (value) {
|
||||
int() => value,
|
||||
String() => int.tryParse(value),
|
||||
num() => value.toInt(),
|
||||
_ => null,
|
||||
};
|
||||
Reference in New Issue
Block a user