The “Intenet connection notification” feature alerts users when their mobile device loses internet connectivity. This notification appears prominently on the screen, informing users that they are currently offline and unable to access online services.
Requirement
- Cirilla
v4.1.4
or above
Features
- Displayed dialog ( preview )
- The message will be displayed as a dialog.
- Show banner ( preview )
- The message will be displayed as a mini banner at top of screen.
- The message will automatically hide after successful internet connection.
Configure source code
Step 1:
Open file: cirilla/pubspec.yaml
.Here you need to uncomment code
Change
# connectivity_plus_package:
# path: ./packages/connectivity_plus_package
To
connectivity_plus_package:
path: ./packages/connectivity_plus_package
Then save the file and run the command “flutter pub get” in the cirilla folder
Note: for ios you need to run the additional command “pod install” in the cirilla/ios folder
Step 2:
Open file: cirilla/lib/register_service/register_service.dart
Replace
export 'connectivity/placeholder_connectivity_service.dart';
To
export 'connectivity/connectivity_plus_service.dart';
Display notification
If you want to change the display notification to another type please see the following instructions.
Open file: cirilla/lib/register_service/connectivity/connectivity_plus_service.dart
Add snip code:
internetNotificationType: service.InternetNotificationType.banner,