Skip to content
pubscout

flutter_offline

6.0.0, released a year ago by jogboms.xyz

Widget to detect and display online/offline status in Flutter apps.

$ flutter pub add flutter_offline
Source repository

What it does

Provides a widget that listens to connectivity changes and shows a UI banner indicating online or offline state. It wraps your content so you can react to network availability without writing boilerplate code.

AI-written summary of version 6.0.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need a quick visual indicator of network connectivity
  • You want to show different UI when the app is offline
  • You prefer a widget‑based solution over manual stream handling

Skip it when

  • You need fine‑grained network request retry logic
  • You require custom connectivity handling beyond a simple banner
  • You want a full‑featured networking stack

Strengths

  • Very easy to drop into existing UI
  • Works on all major Flutter platforms
  • Handles permission and platform differences internally

Weaknesses

  • Only provides UI feedback, not request queuing or caching
  • Limited customization of the offline widget
  • Relies on connectivity_plus which may have its own limitations

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
2

Add <uses-permission android:name="android.permission.INTERNET"/> to AndroidManifest if not present

OfflineBuilder(
  connectivityBuilder: (context, connectivity, child) {
    final connected = !connectivity.contains(ConnectivityResult.none);
    return Stack(
      children: [
        Positioned(
          height: 24,
          left: 0,
          right: 0,
          child: Container(
            color: connected ? Color(0xFF00EE44) : Color(0xFFEE4400),
            child: Center(child: Text(connected ? 'ONLINE' : 'OFFLINE')),
          ),
        ),
        child,
      ],
    );
  },
  child: Center(child: Text('Content')),
);

Alternatives

Packages that do the same job and could replace flutter_offline.

Works with

Packages commonly used together with flutter_offline: ones it builds on, ones built on it, and its own family.