internet_state_manager 1.10.1+3
internet_state_manager: ^1.10.1+3 copied to clipboard
Seamless internet connection management for Flutter. Auto-detect, handle outages, and restore state with minimal code.
Changelog #
1.10.1+1 #
- FIX: Fixed code formatting issues in logger.dart to pass static analysis.
1.10.1 #
-
FIX: Fixed false "No Internet" detection on iOS simulators (especially in debug mode) and Android API 35+. The issue was caused by
connectivity_plusreturning unreliable results (noneeven when connected on iOS, or[wifi, none]on newer Android). -
ENHANCED: The package now properly checks for any real connection (wifi, mobile, etc.) instead of being blocked by the presence of
ConnectivityResult.nonein the results list. -
ENHANCED: Increased default
checkConnectionTimeoutfrom 3s to 5s to better handle slower network responses on simulators/emulators. -
ENHANCED: Added more reliable connectivity check URLs (Google, Apple) and enabled fallback to default endpoints.
-
FEAT: Added
enhancedIosConnectivityoption (default:true) to always perform actual internet checks on iOS, bypassing unreliableconnectivity_plusstatus.
1.10.0 #
-
FEAT: Added optional
InternetStateManagerInterceptorfor Dio users. Triggers a non-blocking connectivity check on every HTTP request to keep the internet state fresh. This is completely optional and the package works without it. -
FEAT: Added static
isConnectedgetter andcheckConnection()method toInternetStateManagerInitializerfor accessing connectivity state withoutBuildContext. -
ENHANCED: Replaced
debugPrintwith custom colored logger for better formatted and more informative log output in terminal. Logs are now colored based on context (green for connected ✅, red for disconnected ❌, yellow for checking 🔄) with emojis for quick visual identification, all in a compact single-line format.
1.9.0 #
-
ENHANCED: Introduced a new
initialize()method inInternetStateManagerInitializerthat performs a local network connectivity check before the app starts. This ensures that the internet state is correctly initialized and available from the first frame of the app. -
ENHANCED: Improved
NoInternetBottomWidgetUI by adding bottom padding as a Safe area, ensuring it displays correctly above system UI. -
FEAT: Added a ready-to-use
NoInternetScreenwidget that automatically checks internet connectivity at intervals defined bycheckConnectionPeriodicinInternetStateOptions(default:Duration(seconds: 12)). This periodic check runs only ifautoCheckConnectionis set totrue(default). -
DOCS: Updated initialization example:
void main() async { WidgetsFlutterBinding.ensureInitialized(); // ✅ Required: Initializes internet connection check before app runs await InternetStateManagerInitializer.initialize(); runApp( InternetStateManagerInitializer( child: MyApp(), ), ); } -
FEAT: Using
InternetStateManagerwithoutbuilderwill automatically display NoInternetBottomWidget at the bottom of the screen when the internet is disconnected. -
FEAT: For full-screen custom handling, use
InternetStateManager.builderto render your own widget, or provideNoInternetScreentoInternetStateManager:InternetStateManager( noInternetScreen: NoInternetScreen(), child: // Your screen here, );
1.7.1 #
-
FIX: Removed the
internet_connection_checkerpackage, as recent versions were removed from pub.dev due to licensing issues. -
FIX: Replaced
internet_connection_checkerwithinternet_connection_checker_pluspackage to ensure continued functionality and compliance.
1.7.0 #
- FEAT: Added
checkConnectionTimeoutoption to set the timeout duration when checking real internet connection.
1.6.1 #
- FEAT: Changed
checkConnectionreturn type toFuture<bool>to return if connection is available or not.
1.5.0 #
- ENHANCED: Recheck the connection if
autoCheckConnectionis TRUE or if connection lost.
1.4.2 #
- FIX: Fixed
internet_connection_checkerversion, set to any.
1.4.1 #
- FEAT: Added
internetCheck()context extension to allow to check internet from context extension.
1.3.1 #
-
FEAT: Added
internetStateStreamaccessed fromcontextto listen for internet connection changes only (without listening to loading states), i.e:context.internetStateStream.listen((status){}). -
FIX: Fixed iOS 12+ known issue with
ConnectivityPlusthat get none even if the local network is available, the bloc is now check the real internet connection oniOSeven if the local network is none.
1.2.0 #
-
ENHANCED: Optimized the emission of the loading state to occur only when disconnected and a local network (e.g., Wi-Fi) is available, reducing unnecessary state emissions.
-
ENHANCED: Improved overall efficiency by decreasing the emission of unnecessary states, avoiding the loading state in cases where it isn't required.
-
FEAT: Added
showLogsoption to enable or disable log prints, providing better control over console output. -
FEAT: Added
disconnectionCheckPeriodicoption to set theDurationfor periodic checks during a disconnection state, allowing more granular control over connectivity checks. -
DOCS: Updated example project to reflect the latest changes and improvements.
-
DOCS: Updated
README.mdfile with updated instructions and information.
1.1.0 #
-
FEAT: Implemented a
Streamthat checks internet connectivity every 10 seconds, emitting a new state if the connection status changes. -
FEAT: Introduced the
autoCheckoption to control whether internet connectivity should be checked automatically. Set tofalseto disable automatic checks. -
FEAT: Added an option to customize the check interval, controlling the time between connectivity checks.
-
FEAT: Created an
Objectfor translations, allowing easier addition or customization of translations, such as Arabic or specific texts to display when no internet connection is available. -
REFACTOR: Updated the
builderwidget to remove the direct ability to addnoInternetScreen. Customization of the no internet screen is now done via the builder function, providing greater flexibility in UI design.