aves/lib/widgets/debug/report.dart
2022-05-12 21:48:46 +09:00

59 lines
1.9 KiB
Dart

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 StatelessWidget {
const DebugErrorReportingSection({super.key});
@override
Widget build(BuildContext 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,
),
)
],
);
}
}