Skip to content

Commit

Permalink
feat(guide-view): add bug app icon button to open feedback form (#212)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasz-trela authored Sep 17, 2024
1 parent 2a5d587 commit 5fdfd58
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions lib/features/guide_view/guide_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ import "package:auto_route/auto_route.dart";
import "package:fast_immutable_collections/fast_immutable_collections.dart";
import "package:flutter/material.dart";
import "package:flutter_riverpod/flutter_riverpod.dart";
import "package:wiredash/wiredash.dart";

import "../../../../widgets/my_error_widget.dart";
import "../../config/ui_config.dart";
import "../../config/wiredash.dart";
import "../../theme/app_theme.dart";
import "../../utils/context_extensions.dart";
import "../../widgets/search_box_app_bar.dart";
import "../analytics/show_feedback_tile.dart";
Expand All @@ -27,6 +30,7 @@ class GuideView extends ConsumerWidget {
title: context.localize.guide,
onQueryChanged:
ref.watch(searchGuideControllerProvider.notifier).onTextChanged,
actions: const [_AppBarBugReportIconButton()],
),
body: const _GuideViewContent(),
);
Expand Down Expand Up @@ -57,3 +61,24 @@ class _GuideViewContent extends ConsumerWidget {
};
}
}

class _AppBarBugReportIconButton extends StatelessWidget {
const _AppBarBugReportIconButton();

@override
Widget build(BuildContext context) {
return IconButton(
onPressed: () {
Wiredash.of(context).show(
options: WiredashFeedbackOptions(
labels: context.labels,
),
);
},
icon: Icon(
Icons.bug_report,
color: context.colorTheme.blackMirage,
),
);
}
}

0 comments on commit 5fdfd58

Please # to comment.