zeba_academy_connectivity 1.0.0
zeba_academy_connectivity: ^1.0.0 copied to clipboard
A Flutter network toolkit for online offline detection and connection monitoring.
Zeba Academy Connectivity #
A powerful and lightweight Flutter network toolkit for monitoring internet connectivity, detecting connection types, and handling offline states.
About Me #
⨠Iām Sufyan bin Uzayr, an open-source developer passionate about building and sharing meaningful projects.
You can learn more about me and my work at:
š sufyanism.com
Connect with me on:
š¼ LinkedIn
Your all-in-one learning hub! #
š Explore courses and resources in coding, tech, and development at:
š zeba.academy
š» code.zeba.academy
Empower yourself with practical skills through curated tutorials, real-world projects, and hands-on experience.
Level up your tech journey today! š»āØ
About Zeba Academy Connectivity #
Zeba Academy Connectivity is a Flutter network toolkit designed to simplify connectivity handling in mobile applications.
It provides:
- Online/offline detection
- Connection type monitoring
- Real-time network watcher
- Offline UI banners
- Stream-based connectivity updates
Built for developers who need reliable network awareness in Flutter apps.
Features #
ā
Internet connectivity detection
ā
Real-time network monitoring
ā
WiFi detection
ā
Mobile data detection
ā
Ethernet detection
ā
Offline mode detection
ā
Reactive Stream API
ā
Offline banner widget
ā
Lightweight architecture
ā
Easy integration
ā
Null-safe Flutter package
Installation #
Add this package to your pubspec.yaml:
dependencies:
zeba_academy_connectivity: ^1.0.0
Then run:
flutter pub get
Usage #
Import the package:
import 'package:zeba_academy_connectivity/zeba_academy_connectivity.dart';
Check Internet Status #
final connectivity =
ZebaAcademyConnectivity();
final online =
await connectivity.isOnline;
print(
online
);
Output:
true
Listen For Network Changes #
final connectivity =
ZebaAcademyConnectivity();
connectivity.statusStream.listen(
(status) {
print(
status.isOnline
);
print(
status.type
);
});
Example output:
Online: true
Type: ConnectionType.wifi
Connection Types #
Supported connection types:
ConnectionType.wifi
ConnectionType.mobile
ConnectionType.ethernet
ConnectionType.bluetooth
ConnectionType.none
ConnectionType.unknown
Offline Banner #
Automatically show an offline banner:
ZebaOfflineBanner(
child:
Scaffold(
body:
Center(
child:
Text(
"Home Screen"
),
),
),
);
When the internet disconnects:
No Internet Connection
will appear automatically.
Example #
import 'package:flutter/material.dart';
import 'package:zeba_academy_connectivity/
zeba_academy_connectivity.dart';
class HomePage extends StatelessWidget {
const HomePage({super.key});
@override
Widget build(BuildContext context){
return ZebaOfflineBanner(
child:
Scaffold(
appBar:
AppBar(
title:
Text(
"Connectivity Demo"
),
),
body:
Center(
child:
Text(
"Zeba Academy"
),
),
),
);
}
}
API #
ZebaAcademyConnectivity #
Main connectivity manager.
Properties #
| Property | Description |
|---|---|
| statusStream | Network change stream |
| currentStatus | Current connection state |
| isOnline | Checks internet availability |
ConnectivityStatus #
Contains network information.
ConnectivityStatus(
isOnline: true,
type: ConnectionType.wifi
)
ConnectionType #
Available values:
- wifi
- mobile
- ethernet
- bluetooth
- none
- unknown
Requirements #
Flutter:
>=3.10.0
Dart:
>=3.0.0
Contributing #
Contributions are welcome!
Steps:
- Fork the repository
- Create your feature branch
git checkout -b feature/new-feature
- Commit changes
git commit -m "Add new feature"
- Push branch
git push origin feature/new-feature
- Create Pull Request
Issues #
If you find a bug or have suggestions, please open an issue in the repository.
License #
This project is licensed under the GNU General Public License v3.0 (GPL-3.0).
You are free to use, modify, and distribute this package under the terms of the GPL license.
Zeba Academy #
Zeba Academy is a learning platform dedicated to:
- Coding
- Technology
- Development
- Practical programming skills
Visit:
ā” Main website:
https://zeba.academy
ā” Courses and resources:
https://code.zeba.academy
ā” YouTube tutorials:
https://www.youtube.com/@zeba.academy
ā” Instagram:
https://www.instagram.com/zeba.academy/
Thank You #
Thank you for using Zeba Academy Connectivity š
Happy Coding š