getDebugInfo method

Map<String, dynamic> getDebugInfo()

Get comprehensive debugging information about groups

Implementation

Map<String, dynamic> getDebugInfo() {
  final now = DateTime.now();
  return {
    'totalGroups': _groupNotifiers.length,
    'maxConcurrentGroups': config.maxConcurrentGroups,
    'hasCleanupTimer': _cleanupTimer?.isActive ?? false,
    'config': {
      'autoResetDelay': config.autoResetDelay.inMilliseconds,
      'enableAutoReset': config.enableAutoReset,
      'resetOnAppResume': config.resetOnAppResume,
      'maxGroupLifetime': config.maxGroupLifetime.inMinutes,
    },
    'groups': _groupNotifiers.keys.map((id) => {
      'id': id,
      'disabled': isGroupDisabled(id),
      'widgetCount': _groupWidgets[id]?.length ?? 0,
      'tapCount': _groupTapCounts[id] ?? 0,
      'hasResetTimer': _groupResetTimers[id] != null,
      'ageMinutes': _groupCreationTimes[id] != null
        ? now.difference(_groupCreationTimes[id]!).inMinutes
        : null,
    }).toList(),
  };
}