showDebugDialog static method

Future<void> showDebugDialog()

Show a debug dialog with version check info.

This will check for updates and show detailed debug info in a dialog.

Implementation

static Future<void> showDebugDialog() async {
  if (_instance == null) {
    debugPrint('[AutoUpdater] Not initialized');
    return;
  }

  final context = _navigatorKey.currentState?.context;
  if (context == null) {
    debugPrint('[AutoUpdater] No context available');
    return;
  }

  final debugInfo = getDebugInfo();

  showDialog(
    context: context,
    builder: (ctx) => AlertDialog(
      title: const Text('AutoUpdater Debug'),
      content: SingleChildScrollView(
        child: SelectableText(
          debugInfo,
          style: const TextStyle(
            fontFamily: 'monospace',
            fontSize: 11,
          ),
        ),
      ),
      actions: [
        TextButton(
          onPressed: () => Navigator.pop(ctx),
          child: const Text('Close'),
        ),
        TextButton(
          onPressed: () {
            Navigator.pop(ctx);
            checkForUpdates();
          },
          child: const Text('Check Now'),
        ),
      ],
    ),
  );
}