offline_banner 1.0.4
offline_banner: ^1.0.4 copied to clipboard
A customizable Flutter widget that shows an animated banner when offline and an online popup when internet is restored, with retry support and configurable position.
📡 offline_banner #
A simple Flutter plugin to automatically show a banner when the internet is disconnected.
🚀 Features #
- 🔍 Monitors internet connectivity
- 📢 Displays a red banner when offline with animation
- 🔁 Retry button integration
- 🎨 Customizable banner support with animation
📷 Checking Internet Connection: #
![]() |
🚀 Getting Started #
1. Add Dependency #
Add the following to your pubspec.yaml:
dependencies:
offline_banner: ^1.0.2
- Install Package Run the following command:
flutter pub get
- Import the Package
import 'package:offline_banner/offline_banner.dart';
🔧 Usage #
OfflineBanner(
retryCallback: () => fetchData(),
customBanner: MyCustomBannerWidget(),
child: MaterialApp(),
);
⚙️ Permissions
🟢 Android Permissions
Add the following permissions in android/app/src/main/AndroidManifest.xml:
``` xml
<uses-permission android:name="android.permission.INTERNET"/>
Add the following permissions in android/app/build.gradle:
android {
compileSdkVersion 34 // Or latest
defaultConfig {
minSdkVersion 21
targetSdkVersion 34
}
}
🍎 iOS Permissions
Add the following keys to your ios/Runner/Info.plist file:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
📸 Developed by #
✅ VENU RENANGI
✅ SONAM GUPTA
✅ KAMNA JOSHI
🤝 Contributors ✅ Shrinath Gavadoji
