flutter_connectivity_manager 1.0.4
flutter_connectivity_manager: ^1.0.4 copied to clipboard
A comprehensive Flutter connectivity manager package with authentication, interceptors, and error handling support.
1.0.4 #
- Fix linter problems
- Add additional public API documentations
1.0.3 #
π Major Enhancements #
π Factory-Based Initialization (Breaking Change)
- New Factory Pattern: Introduced
ConnectivityManagerFactory
for proper async initializationConnectivityManagerFactory.create()
- Custom configurationConnectivityManagerFactory.createForDevelopment()
- Development presetConnectivityManagerFactory.createForProduction()
- Production presetConnectivityManagerFactory.createMinimal()
- Minimal presetConnectivityManagerFactory.createAggressive()
- Aggressive preset
- Breaking Change: Direct instantiation of
ConnectivityManagerImpl
is no longer allowed - Improved Reliability: Factory methods ensure proper async initialization before use
- Better Error Prevention: Eliminates initialization-related runtime errors
β‘ Enhanced Connection Speed Classification
- New Speed Levels: Added
fast
(10-50 Mbps) andunknown
speed classifications - Complete Speed Range:
none
: No connectionpoor
: < 50 Kbpsslow
: 50 Kbps - 500 Kbpsmoderate
: 500 Kbps - 2 Mbpsgood
: 2-10 Mbpsfast
: 10-50 Mbps (new)excellent
: > 50 Mbpsunknown
: Speed not tested/determinable (new)
- Enhanced Helper Methods:
isUsable
- Checks if connection is suitable for basic operationsisGoodForMultimedia
- Checks if suitable for high-quality multimediaisModerateForMultimedia
- Checks if suitable for moderate multimediadescription
- Human-readable speed descriptions
π‘οΈ Improved Error Handling
- Stack Trace Support: Error states now include stack traces for better debugging
- Enhanced Error Context: More detailed error information in connectivity states
- Better Error Recovery: Improved error handling throughout the connectivity checking process
π§ Technical Improvements
- Async Initialization: All factory methods perform initial connectivity checks
- Better Resource Management: Improved lifecycle management with proper initialization
- Enhanced Documentation: Updated code documentation with new factory patterns
- Stricter Type Safety: Better type safety with factory-based initialization
π Migration Guide #
Before (v1.0.2):
final manager = ConnectivityManagerImpl();
await manager.startMonitoring();
After (v1.0.3):
final manager = await ConnectivityManagerFactory.createForProduction();
await manager.startMonitoring();
π Updated Example App #
- Factory Usage: Example app now demonstrates proper factory-based initialization
- Better Error Handling: Improved error handling and user feedback
- Enhanced UI: Better visual feedback for connection states
1.0.2 #
π Enhancements #
π Connection Speed Classification
- Added Moderate Speed Classification: Enhanced connection speed detection with a new
moderate
speed categoryslow
: 50 Kbps - 500 Kbps (adjusted from 50 Kbps - 1 Mbps)moderate
: 500 Kbps - 2 Mbps (new category)good
: 2-10 Mbps (adjusted from 1-10 Mbps)
- Improved Speed Testing Algorithm: Refined response time thresholds for more accurate speed classification
- Enhanced Quality Scoring: Updated connection quality scoring to account for the new moderate speed category
- Better User Experience: More granular speed feedback for users in the moderate connection range
π§ Technical Improvements
- Updated
ConnectionSpeed
enum with newmoderate
classification - Enhanced
testConnectionSpeed()
method with refined timing thresholds - Improved
getConnectionQualityScore()
to include moderate speed scoring - Added
isModerateForMultimedia
helper method for multimedia capability assessment
1.0.1 #
π§ Improvements #
π Code Organization
- Improved Project Structure: Refactored codebase for better organization and maintainability
- File Reorganization: Moved connectivity result extensions to dedicated utils folder
- Implementation Consolidation: Streamlined implementation files structure
- Enhanced Separation of Concerns: Better separation between interfaces, implementations, models, and utilities
π οΈ Technical Changes
- Reorganized
connectivity_result_extensions.dart
location for better project structure - Consolidated implementation files for improved maintainability
- Updated imports and exports to reflect new file structure
- Enhanced code organization following clean architecture principles
π¦ Dependencies
- Maintained compatibility with existing dependency versions
- No breaking changes to public API
1.0.0 #
π Initial Release #
β¨ Features
- Comprehensive Connectivity Management: Complete connectivity monitoring with real-time updates
- Internet Access Verification: Not just network connection - actual internet accessibility testing
- Connection Speed Detection: Automatic connection speed/quality assessment (None, Poor, Slow, Moderate, Good, Excellent)
- Multiple Connection Type Support: WiFi, Mobile, Ethernet, Bluetooth, VPN detection
- Flexible Configuration: Customizable timeouts, retry attempts, test URLs, and monitoring intervals
- Background Monitoring: Optional background connectivity checks with configurable intervals
- Connection State Caching: Performance optimization with configurable cache duration
- Advanced Testing Capabilities: Ping tests, URL reachability checks, bandwidth assessment
- Connection Waiting: Wait for specific connection types or internet availability with timeout
- Stream-based Architecture: Reactive programming support with multiple event streams
- Error Handling: Comprehensive error handling with detailed error information
- Resource Management: Proper lifecycle management with pause/resume/dispose methods
π± Streams & Events
onConnectivityChanged
: Complete connectivity state changesonInternetAvailabilityChanged
: Internet availability status updatesonNetworkTypeChanged
: Network type changes (WiFi, Mobile, etc.)
βοΈ Configuration Presets
- Production: Balanced configuration for production apps
- Development: Faster checks and more detailed logging for development
- Minimal: Resource-efficient configuration for battery-sensitive apps
- Aggressive: Frequent monitoring for real-time applications
π οΈ Advanced Methods
- Connection speed testing with customizable test URLs
- Network quality scoring (0.0 to 1.0)
- Bandwidth-intensive operation capability checks
- Host ping functionality with configurable timeouts
- Detailed network information retrieval
- Manual connectivity testing with custom options
ποΈ Architecture
- Clean architecture with interface-based design (
IConnectivityManager
) - Factory pattern for easy instance creation
- Thread-safe implementation with proper resource management
- Extensible design for custom implementations
π¦ Dependencies
connectivity_plus: ^6.1.4
- Core connectivity detectioninternet_connection_checker_plus: ^2.7.2
- Internet accessibility verificationflutter_shared_utilities: ^1.0.3
- Shared utility functions
π Documentation
- Comprehensive API documentation
- Example app demonstrating all features
- Configuration guides and best practices