InternetWidget constructor

const InternetWidget({
  1. Key? key,
  2. double? height,
  3. double? width,
  4. required Widget? online,
  5. String? lookupUrl,
  6. Widget? loadingWidget,
  7. VoidCallback? whenOffline,
  8. VoidCallback? whenOnline,
  9. Connectivity? connectivity,
  10. OfflineWidgetType? offline,
})

Use InternetWidget to show online or offline widgets

InternetWidget(
  key: ValueKey('internet-widget'),
  loadingWidget: Center(
    child: CircularProgressIndicator(),
  ),
  lookupUrl: 'example.com',
  offline: const Text(
    'Offline',
  ),
  online: const Text(
    'Online',
  ),
),

In case you want to use the default settings, just provide the online widget

InternetWidget(
 online: Container(),
),

Implementation

const InternetWidget({
  super.key,
  this.height,
  this.width,
  required this.online,
  this.lookupUrl,
  this.loadingWidget,
  this.whenOffline,
  this.whenOnline,
  this.connectivity,
  this.offline,
});