DebugOverlay constructor

DebugOverlay({
  1. Key? key,
  2. bool visible = false,
  3. bool? maintainState,
  4. int initialTabIndex = 0,
  5. double opacity = 0.9,
  6. DetectorBuilder? detectorBuilder,
  7. List<String> hiddenFields = const [],
  8. LogBucket? logBucket,
  9. HttpBucket? httpBucket,
  10. List<Widget> debugEntries = const [],
  11. List<Widget> infoEntries = const [MediaQueryInfoEntry(), PackageInfoEntry(), DeviceInfoEntry(), if (!kIsWeb) PlatformInfoEntry()],
  12. required Widget child,
})

Creates a DebugOverlay widget.

maintainState controls whether the overlay should maintain its state while being invisible to the user, this allows for a quick resume when toggling the overlay while inspecting something.

detectorBuilder allows the injection of a custom detector instead of the default DebugDetector.

hiddenFields specifies a list of fields whose values are hidden throughout the overlay.

Implementation

DebugOverlay({
  super.key,
  this.visible = false,
  bool? maintainState,
  this.initialTabIndex = 0,
  this.opacity = 0.9,
  DetectorBuilder? detectorBuilder,
  List<String> hiddenFields = const [],
  this.logBucket,
  this.httpBucket,
  this.debugEntries = const [],
  this.infoEntries = const [
    MediaQueryInfoEntry(),
    PackageInfoEntry(),
    DeviceInfoEntry(),
    if (!kIsWeb) PlatformInfoEntry(),
  ],
  required this.child,
})  : maintainState = maintainState ?? true,
      detectorBuilder = detectorBuilder ?? _buildDetector,
      hiddenFields = hiddenFields.map((e) => e.toLowerCase()).toList();