smart_offline_guard 1.1.0
smart_offline_guard: ^1.1.0 copied to clipboard
A smart and professional Flutter utility that automatically monitors network connectivity and provides 10+ modern UI templates for offline states.
Smart Offline Guard 🛡️ #
Smart Offline Guard is a professional Flutter utility that automatically monitors network connectivity and overlays modern, high-quality UI templates when the device goes offline. Zero configuration required—just wrap your app and keep your UX seamless.
🚀 Features #
- Zero Logic Implementation: No need to manage streams or states. It handles everything automatically.
- 15+ Modern Templates: Choose from Minimalist, Glassmorphism, Neon, Brutalist, and more.
- Auto-Recovery: The overlay disappears instantly as soon as the internet connection is restored.
- Universal Support: Works flawlessly on Android, iOS, Web, Windows, macOS, and Linux.
- Lightweight & Fast: Built using
connectivity_plus7.1.0+ for high-performance network tracking.
📦 Installation #
Add the following to your pubspec.yaml file:
dependencies:
smart_offline_guard: ^1.1.0
Then run: #
flutter pub get
🛠️ Usage #
The easiest way to use Smart Offline Guard is by wrapping your MaterialApp using the builder property. This ensures the guard works globally across all screens.
import 'package:flutter/material.dart';
import 'package:smart_offline_guard/smart_offline_guard.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
// Wrap your app here
builder: (context, child) {
return SmartOfflineGuard(
template: OfflineTemplate.glassmorphism, // Select any of the 10 templates
child: child!,
);
},
home: const MyHomePage(),
);
}
}
🎨 Available Templates #
| Template | Description |
|---|---|
minimalist |
Clean white background with a simple icon. (Signature Style) |
glassmorphism |
Modern frosted glass effect with background blur. |
darkModePro |
Deep black theme optimized for OLED displays. |
gradientWave |
Beautiful premium purple-to-blue gradient. |
bottomSheet |
A subtle red alert at the bottom of the screen. |
neonGlow |
Tech-inspired cyan glow with neon typography. |
softPastel |
Aesthetic soft colors for a friendly user experience. |
brutalist |
Bold borders and high-contrast yellow design. |
classicAlert |
Traditional professional dialog layout. |
cleanWait |
Simple status text with a sleek loading indicator. |
cyberpunk |
High-contrast yellow/black theme with tech-glitch vibes. |
neumorphic |
Modern Soft UI with 3D shadow and light effects. |
skeletonWave |
Animated placeholder style for a smooth syncing feel. |
retro |
Old-school terminal look with green matrix-style text. |
miniDot |
Ultra-minimalist design with a single status dot. |
🤝 Contributing #
Found a bug or want to add a new template?
-
Fork the Project.
-
Create your Feature Branch (git checkout -b feature/add).
-
Commit your Changes (git commit -m 'Add Update').
-
Push to the Branch (git push origin feature/add).
-
Open a Pull Request.
📧 Contact & Support #
If you have any questions, feedback, or run into issues while using smart_offline_guard, feel free to reach out:
- Email: loomixdev@gmail.com
- GitHub: https://github.com/oxfaysal
- Facebook: https://facebook.com/0xfaysal
I'm happy to help you with any improvements or fixes!
Maintained by Faysal (LoomixDev)