Add a bug reporting link on flutter dashboard build page. (#1852)
diff --git a/dashboard/lib/build_dashboard_page.dart b/dashboard/lib/build_dashboard_page.dart
index 542c1dd..9a0ffbf 100644
--- a/dashboard/lib/build_dashboard_page.dart
+++ b/dashboard/lib/build_dashboard_page.dart
@@ -5,6 +5,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_dashboard/model/branch.pb.dart';
import 'package:provider/provider.dart';
+import 'package:url_launcher/url_launcher.dart';
import 'logic/task_grid_filter.dart';
import 'navigation_drawer.dart';
@@ -338,6 +339,8 @@
true: isDark ? Colors.green[800] : Colors.green,
};
+ const flutterIssueUrl =
+ 'https://github.com/flutter/flutter/issues/new?assignees=&labels=team%3A+infra&template=6_infrastructure.md';
final BuildState _buildState = Provider.of<BuildState>(context);
_buildState.updateCurrentRepoBranch(repo!, branch!);
return AnimatedBuilder(
@@ -348,6 +351,18 @@
backgroundColor: colorTable[_buildState.isTreeBuilding],
actions: <Widget>[
if (!_smallScreen) ..._slugSelection(context, _buildState),
+ IconButton(
+ tooltip: 'Report Issue',
+ icon: const Icon(Icons.bug_report),
+ onPressed: () async {
+ const url = 'https://blog.logrocket.com';
+ if (await canLaunch(flutterIssueUrl)) {
+ await launch(flutterIssueUrl);
+ } else {
+ throw 'Could not launch $url';
+ }
+ },
+ ),
PopupMenuButton<String>(
tooltip: 'Task Status Key',
child: const Icon(Icons.info_outline),
diff --git a/dashboard/test/build_dashboard_page_test.dart b/dashboard/test/build_dashboard_page_test.dart
index d6c765c..8a91fec 100644
--- a/dashboard/test/build_dashboard_page_test.dart
+++ b/dashboard/test/build_dashboard_page_test.dart
@@ -102,6 +102,24 @@
expect(find.byIcon(Icons.settings), findsOneWidget);
});
+ testWidgets('shows file a bug button', (WidgetTester tester) async {
+ final BuildState fakeBuildState = FakeBuildState()..authService = fakeAuthService;
+
+ await tester.pumpWidget(
+ MaterialApp(
+ home: ValueProvider<BuildState>(
+ value: fakeBuildState,
+ child: ValueProvider<GoogleSignInService>(
+ value: fakeBuildState.authService,
+ child: const BuildDashboardPage(),
+ ),
+ ),
+ ),
+ );
+
+ expect(find.byIcon(Icons.bug_report), findsOneWidget);
+ });
+
testWidgets('shows key button & legend', (WidgetTester tester) async {
final BuildState fakeBuildState = FakeBuildState()..authService = fakeAuthService;