mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-08-16 08:00:23 +02:00
chore: housekeeping cleanup and code deduplication
- 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)
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
/// 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;
|
||||
}
|
||||
Reference in New Issue
Block a user