core_utils_kit 0.2.0
core_utils_kit: ^0.2.0 copied to clipboard
Small Flutter utilities: secure key-value storage, date and time formatting, color generation, URL opening, and app lifecycle watching without extra state-management dependencies.
0.2.0 - 2026-10-22 #
- Add
formatRelativeTime. It truncates the difference to a whole unit and reads5 minutes ago,just now, orin 2 hours. - Add
formatLongDate,formatShortDate, andformatShortDateTime. English and Czech use built-in patterns and need no locale data initialization. Other locales delegate tointl. - Add
formatDurationHumanfor compact durations such as1 h 05 min,45 min, and12 s. - Add
Debouncer,Throttler, and thedebouncedandthrottledextensions for repeated callbacks. - Add
retryandRetryPolicywith attempts, growing waits, jitter, and aretryOnfilter;delayForkeeps tests instant. - Add
formatBytes,formatCompactNumber, andformatPercent. - Add
isValidEmail,isValidUrl,isValidIban(MOD-97), andisValidE164Phone. - Add
initialsOf,slugify, andtruncateAtWord.
0.1.2 #
- Documentation and internal cleanup.
0.1.1 #
- Rewrite the README. The install section now uses
flutter pub add core_utils_kit.
0.1.0 #
- Initial release.
- Extracted shared utilities from the Rocketbot app:
KeyValueStore,InMemoryKeyValueStore,SecureStorageService,DateFormats,DurationFormatting,LifecycleWatcher,generateMaterialColor,openLink,generateRandomString, andBuildContextX.afterBuild. DateFormats.convertDatenow converts withtoLocal, handling daylight-saving transitions and explicit or fractional UTC offsets correctly.LifecycleWatcherfixes the inactive/paused mapping:inactivenow callsonAppInactiveandpausedcallsonAppPaused. ApplyingWidgetsBindingObserverbefore the mixin is enforced by the compiler.generateRandomStringrejects negative lengths with anArgumentError.SecureStorageServiceaccepts injectableAppleOptionsandAndroidOptionsand defaults toAndroidOptions(resetOnError: false)so undecryptable Android data is preserved.- Storage migration:
flutter_secure_storage11 cannot read version 9EncryptedSharedPreferencesdata on Android, so existing installs reset their stored tokens, PIN and preferences once. iOSfirst_unlockdata remains readable. - The one-time Android reset is guarded by a
storage_reset_donemarker so it runs at most once; later launches with unreadable storage proceed logged out instead of wiping again.