jh_services 0.2.1
jh_services: ^0.2.1 copied to clipboard
A lightweight service package for Flutter to handle network requests, local storage, and connectivity seamlessly with best practices.
Changelog #
0.2.1 - 2026-10-30 #
Fixed #
- Static Analysis & Pattern Matching: Added exhaustive
defaultfallback inhandleDioExceptionsto gracefully handleDioExceptionType.transformTimeoutand any futureDioExceptionTypeadditions. - Dependency Upgrades: Upgraded
file_pickerto^13.3.0,get_itto^9.3.0,internet_connection_checker_plusto^3.1.2, andflutter_lintsto^6.0.0for full pub.dev pana compatibility. - FilePickerService: Updated to modern
FilePickerstatic API (pickFile,pickFiles) across all platforms. - Platform Support: Eliminated transitive dependency conflicts, ensuring full support across Android, iOS, Web, macOS, Windows, and Linux.
0.2.0 - 2026-10-30 #
Changed #
- Dependencies: Converted all exact dependency pins to flexible semantic version caret constraints (
^...), preventing version-solving conflicts for consuming apps. - SDK Support: Updated SDK constraints to Dart
^3.0.0and Flutter>=3.10.0. - Linter & Code Quality: Upgraded to
flutter_lints: ^5.0.0and resolved all static analysis issues across the library and example. - Cross-Platform Compatibility:
convertImageToMultipartFile: Converted to byte-based multipart serialization withimage.name, providing full compatibility across Web, iOS, Android, macOS, Linux, and Windows.FilePickerService: Prevented null-path assertion errors on Flutter Web and introducedpickFileDetails/pickMultipleFileDetailsreturningPlatformFile.NetworkService: AddedputHTTP method and exposeddiogetter for custom interceptors and tokens.ConnectivityService: AddedonStatusChangestream for reactive connectivity listening.handleDioExceptions: Fixed null unwraps (e.message!) and added complete handling for 500+ server responses.ErrorModel: Made fields immutable and deserialization resilient to arbitrary/null error bodies.setupServiceLocator: Ensured service locator registration is idempotent and safe during hot reload/restart and testing.
Added #
- Comprehensive unit test suite with 15 automated test cases covering local storage, error handling, configuration, and service locator lifecycle.
- Metadata topics in
pubspec.yamlfor enhanced discovery on pub.dev.
0.1.0 - 2024-11-02 #
Added on SharedPrefsService #
- saveDateTime: Method to save a
DateTimevalue as a string. - getDateTime: Method to retrieve a
DateTimevalue. - updateOrAppendToStringList: Method to update or append to a string list.
- saveBulk: Method to save multiple key-value pairs in one go.
- getBulk: Method to retrieve multiple values for a list of keys.
- incrementOrInitInt: Method to increment or initialize an integer value.
- decrementInt: Method to decrement an integer value.
- toggleBool: Method to toggle a boolean value.
- addToStringList: Method to add a single item to a list of strings.
- removeFromStringList: Method to remove a single item from a list of strings.
- getAll: Method to retrieve all key-value pairs.
- saveJson: Method to save a JSON object by encoding it as a string.
- getJson: Method to retrieve a JSON object by decoding a stored string.
- resetToDefaults: Method to reset a list of keys to specified default values.
- getKeysByPrefix: Method to retrieve all keys that start with a specified prefix.
- getItemCount: Method to count the number of stored items.
- batchIncrementInts: Method for batch update to increment multiple integer keys by specified values.
- retrieveAndRemove: Method to retrieve and remove values for a list of keys.
- getValue: Method to retrieve a value by type.
- getKeys: Method to retrieve all keys.