Skip to content
Prev Previous commit
Next Next commit
update
  • Loading branch information
buenaflor committed Jan 29, 2024
commit 99001a735d045cacb040d7c1b13c50d9d05f7171
2 changes: 1 addition & 1 deletion flutter/lib/src/screenshot/sentry_screenshot_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ final sentryScreenshotWidgetGlobalKey =
/// information see https://flutter.dev/docs/development/tools/web-renderers
/// - You can only have one [SentryScreenshotWidget] widget in your widget tree at all
/// times.
@Deprecated('Use [SentryWidget] instead')
class SentryScreenshotWidget extends StatefulWidget {
final Widget child;
late final Hub _hub;
Expand All @@ -50,6 +49,7 @@ class _SentryScreenshotWidgetState extends State<SentryScreenshotWidget> {

@override
Widget build(BuildContext context) {
print('got it ${_options?.attachScreenshot}');
if (_options?.attachScreenshot ?? false) {
return RepaintBoundary(
key: sentryScreenshotWidgetGlobalKey,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ Element? _clickTrackerElement;
///
/// If you are using the [SentryScreenshotWidget] as well, make sure to add
/// [SentryUserInteractionWidget] as a child of [SentryScreenshotWidget].
@Deprecated('Use [SentryWidget] instead')
class SentryUserInteractionWidget extends StatefulWidget {
SentryUserInteractionWidget({
super.key,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ void main() {
final sut = fixture.getSut(renderer, isWeb);

await tester.pumpWidget(SentryScreenshotWidget(
hub: fixture.hub,
child: Text('Catching Pokémon is a snap!',
textDirection: TextDirection.ltr)));

Expand Down Expand Up @@ -178,8 +179,14 @@ void main() {
}

class Fixture {
late Hub hub;
SentryFlutterOptions options = SentryFlutterOptions(dsn: fakeDsn);

Fixture() {
options.attachScreenshot = true;
hub = Hub(options);
}

ScreenshotEventProcessor getSut(
FlutterRenderer? flutterRenderer, bool isWeb) {
options.rendererWrapper = MockRendererWrapper(flutterRenderer);
Expand Down