smart_offline_guard 1.1.0 copy "smart_offline_guard: ^1.1.0" to clipboard
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.

example/lib/main.dart

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,
      title: 'Smart Offline Guard Demo',
      theme: ThemeData(primarySwatch: Colors.blue, useMaterial3: true),
      // ১ লাইনে পুরো অ্যাপে স্মার্ট অফলাইন গার্ড ইমপ্লিমেন্ট
      builder: (context, child) {
        return SmartOfflineGuard(
          template: OfflineTemplate.glassmorphism, 
          child: child!,
        );
      },
      home: const HomeScreen(),
    );
  }
}

class HomeScreen extends StatelessWidget {
  const HomeScreen({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('LoomixDev Offline Guard')),
      body: Center(
        child: Padding(
          padding: const EdgeInsets.all(20.0),
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              const Icon(Icons.Language, size: 100, color: Colors.blue),
              const SizedBox(height: 20),
              const Text(
                'Turn off your Internet (WiFi/Data) to see the magic! ✨',
                textAlign: TextAlign.center,
                style: TextStyle(fontSize: 18, fontWeight: FontWeight.w500),
              ),
              const SizedBox(height: 40),
              ElevatedButton(
                onPressed: () {
                  ScaffoldMessenger.of(context).showSnackBar(
                    const SnackBar(content: Text('App is working perfectly!')),
                  );
                },
                child: const Text('Test App Interaction'),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
0
likes
150
points
7
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A smart and professional Flutter utility that automatically monitors network connectivity and provides 10+ modern UI templates for offline states.

Repository (GitHub)
View/report issues

Topics

#connectivity #network-monitor #offline-ui #flutter-web #utility

License

MIT (license)

Dependencies

connectivity_plus, flutter

More

Packages that depend on smart_offline_guard