Add test crash button in debug mode

- Add button in Profile > About section to trigger test crash
- Only visible in debug builds for testing crash reporting flow

Closes #268

Signed-off-by: alltheseas <alltheseas@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
alltheseas
2026-01-15 22:56:11 -06:00
co-authored by Claude Opus 4.5
parent 73a6763c4d
commit cffe5e5922
+16
View File
@@ -3,6 +3,7 @@ import 'dart:convert';
import 'package:async_button_builder/async_button_builder.dart';
import 'package:collection/collection.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
@@ -1732,6 +1733,21 @@ class _AboutSection extends ConsumerWidget {
launchUrl(Uri.parse('https://github.com/zapstore/zapstore'));
},
),
if (kDebugMode) ...[
const Divider(),
ListTile(
leading: Icon(Icons.bug_report, color: Colors.red),
title: const Text('Test Crash'),
subtitle: const Text('Trigger a test crash for debugging'),
contentPadding: EdgeInsets.zero,
onTap: () {
// Use Future.delayed to escape Flutter's widget error handling
Future.delayed(Duration.zero, () {
throw StateError('Test crash triggered from Profile screen');
});
},
),
],
],
),
),