diff options
| author | mirror <mirror@localhost> | 2026-11-22 08:41:00 +0900 |
|---|---|---|
| committer | mirror <mirror@localhost> | 2026-11-22 08:41:00 +0900 |
| commit | 449d8b74bd6d9dae98a07254cdfad677b920e7b0 (patch) | |
| tree | c131c3528c4d517f56e19b854a7453fedb097d40 /lib/widgets/debug/report.dart | |
| download | aves-src-master.tar.gz aves-src-master.zip | |
Diffstat (limited to 'lib/widgets/debug/report.dart')
| -rw-r--r-- | lib/widgets/debug/report.dart | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/lib/widgets/debug/report.dart b/lib/widgets/debug/report.dart new file mode 100644 index 0000000..4a7e72d --- /dev/null +++ b/lib/widgets/debug/report.dart @@ -0,0 +1,69 @@ +import 'package:aves/services/android_debug_service.dart'; +import 'package:aves/services/common/services.dart'; +import 'package:aves/widgets/common/identity/aves_expansion_tile.dart'; +import 'package:aves/widgets/viewer/info/common.dart'; +import 'package:flutter/material.dart'; + +class DebugErrorReportingSection extends StatefulWidget { + const DebugErrorReportingSection({super.key}); + + @override + State<DebugErrorReportingSection> createState() => _DebugErrorReportingSectionState(); +} + +class _DebugErrorReportingSectionState extends State<DebugErrorReportingSection> with AutomaticKeepAliveClientMixin { + @override + Widget build(BuildContext context) { + super.build(context); + + return AvesExpansionTile( + title: 'Reporting', + children: [ + const Padding( + padding: EdgeInsets.symmetric(horizontal: 8), + child: ElevatedButton( + onPressed: AndroidDebugService.crash, + child: Text('Crash'), + ), + ), + const Padding( + padding: EdgeInsets.symmetric(horizontal: 8), + child: ElevatedButton( + onPressed: AndroidDebugService.exception, + child: Text('Throw exception'), + ), + ), + const Padding( + padding: EdgeInsets.symmetric(horizontal: 8), + child: ElevatedButton( + onPressed: AndroidDebugService.safeException, + child: Text('Throw exception (safe)'), + ), + ), + const Padding( + padding: EdgeInsets.symmetric(horizontal: 8), + child: ElevatedButton( + onPressed: AndroidDebugService.exceptionInCoroutine, + child: Text('Throw exception in coroutine'), + ), + ), + const Padding( + padding: EdgeInsets.symmetric(horizontal: 8), + child: ElevatedButton( + onPressed: AndroidDebugService.safeExceptionInCoroutine, + child: Text('Throw exception in coroutine (safe)'), + ), + ), + Padding( + padding: const EdgeInsets.only(left: 8, right: 8, bottom: 8), + child: InfoRowGroup( + info: reportService.state, + ), + ) + ], + ); + } + + @override + bool get wantKeepAlive => true; +} |
