File tree Expand file tree Collapse file tree 3 files changed +29
-8
lines changed
Expand file tree Collapse file tree 3 files changed +29
-8
lines changed Original file line number Diff line number Diff line change 11# Changelog
22
3+ ## Unreleased
4+
5+ ### Fixes
6+
7+ - Fix ` SentryUserInteractionWidget ` throwing when Sentry is not enabled ([ #1363 ] ( https://github.com/getsentry/sentry-dart/pull/1363 ) )
8+
39## 7.3.0
410
511### Features
Original file line number Diff line number Diff line change @@ -251,7 +251,10 @@ class SentryUserInteractionWidget extends StatefulWidget {
251251
252252 SentryFlutterOptions ? get _options =>
253253 // ignore: invalid_use_of_internal_member
254- _hub.options as SentryFlutterOptions ? ;
254+ _hub.options is SentryFlutterOptions
255+ // ignore: invalid_use_of_internal_member
256+ ? _hub.options as SentryFlutterOptions
257+ : null ;
255258
256259 @override
257260 StatefulElement createElement () {
Original file line number Diff line number Diff line change 11@TestOn ('vm' )
2-
32// ignore_for_file: invalid_use_of_internal_member
43
54import 'dart:async' ;
@@ -14,13 +13,26 @@ import '../mocks.dart';
1413import '../mocks.mocks.dart' ;
1514
1615void main () {
17- group ('$SentryUserInteractionWidget crumbs' , () {
18- late Fixture fixture;
19- setUp (() async {
20- fixture = Fixture ();
21- TestWidgetsFlutterBinding .ensureInitialized ();
22- });
16+ late Fixture fixture;
17+ setUp (() async {
18+ fixture = Fixture ();
19+ TestWidgetsFlutterBinding .ensureInitialized ();
20+ });
21+
22+ testWidgets (
23+ '$SentryUserInteractionWidget does not throw cast exception when Sentry is disabled' ,
24+ (tester) async {
25+ await tester.runAsync (() async {
26+ await tester.pumpWidget (
27+ SentryUserInteractionWidget (
28+ child: MaterialApp (),
29+ ),
30+ );
31+ });
32+ },
33+ );
2334
35+ group ('$SentryUserInteractionWidget crumbs' , () {
2436 testWidgets ('Add crumb for MaterialButton' , (tester) async {
2537 await tester.runAsync (() async {
2638 final sut = fixture.getSut ();
You can’t perform that action at this time.
0 commit comments