offline_banner 1.0.2 copy "offline_banner: ^1.0.2" to clipboard
offline_banner: ^1.0.2 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.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:offline_banner/offline_banner.dart';

void main() {
  runApp(const MyApp());
}

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

  @override
  Widget build(BuildContext context) {
    return OfflineBanner(
      retryCallback: () {
        // Any action after reconnection
        debugPrint("Retry successful — now online!");
      },
      child: MaterialApp(
        debugShowCheckedModeBanner: false,
        home: const HomeScreen(),
      ),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Offline Banner'),
        backgroundColor: Colors.blue,
      ),
      body: Center(child: Text('Internet Connection Checking')),
    );
  }
}
1
likes
0
points
4
downloads

Publisher

unverified uploader

Weekly Downloads

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.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on offline_banner

Packages that implement offline_banner