mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-05-15 21:28:20 +02:00
904b45e8f6
- Remove stray tracked files (root AndroidManifest.xml, build.gradle.bak, temp_project template) - Move README-only images out of app asset bundle to reduce APK/IPA size (~1.68MB) - Fix logo filename typo (transparant -> transparent) - Deduplicate _readPositiveInt into shared int_utils.dart - Deduplicate _themeModeFromString (reuse from theme_settings.dart) - Remove deprecated LocalLibraryState.items getter - Remove unused sqflite_common_ffi dependency - Update apps.json version to 4.5.1 - Fix Flutter version in CONTRIBUTING.md (3.38.1 -> 3.41.5) - Improve .gitignore patterns (NUL, *.bak, root AndroidManifest.xml)
14 lines
412 B
Dart
14 lines
412 B
Dart
/// Parses a dynamic value to a positive integer (> 0), or returns null.
|
|
///
|
|
/// Accepts [num] and parseable [String] values.
|
|
int? readPositiveInt(dynamic value) {
|
|
if (value == null) return null;
|
|
if (value is num) {
|
|
final asInt = value.toInt();
|
|
return asInt > 0 ? asInt : null;
|
|
}
|
|
final parsed = int.tryParse(value.toString());
|
|
if (parsed == null || parsed <= 0) return null;
|
|
return parsed;
|
|
}
|