Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix analyze problems
  • Loading branch information
fzyzcjy committed Mar 6, 2021
commit fb2913a8ae15b5bcfd857f8946a59d5c3a2e78ca
8 changes: 1 addition & 7 deletions flutter/lib/src/default_integrations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,7 @@ class LoadAndroidImageListIntegration
options.addEventProcessor(
(event, {hint}) async {
try {
if (event.exception != null &&
event.exception!.stackTrace != null &&
event.exception!.stackTrace!.frames != null) {
if (event.exception != null && event.exception!.stackTrace != null) {
final needsSymbolication = event.exception!.stackTrace!.frames
.any((element) => 'native' == element.platform);

Expand Down Expand Up @@ -326,10 +324,6 @@ class LoadReleaseIntegration extends Integration<SentryFlutterOptions> {
FutureOr<void> call(Hub hub, SentryFlutterOptions options) async {
try {
if (!kIsWeb) {
if (_packageLoader == null) {
options.logger(SentryLevel.debug, 'Package loader is null.');
return;
}
final packageInfo = await _packageLoader();
final release =
'${packageInfo.packageName}@${packageInfo.version}+${packageInfo.buildNumber}';
Expand Down
5 changes: 2 additions & 3 deletions flutter/lib/src/navigation/sentry_navigator_observer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,12 @@ class RouteObserverBreadcrumb extends Breadcrumb {
String? to,
dynamic toArgs,
SentryLevel? level,
}) : assert(navigationType != null),
super(
}) : super(
category: _navigationKey,
type: _navigationKey,
level: level,
data: <String, dynamic>{
if (navigationType != null) 'state': navigationType,
'state': navigationType,
if (from != null) 'from': from,
if (fromArgs != null) 'from_arguments': fromArgs,
if (to != null) 'to': to,
Expand Down
4 changes: 0 additions & 4 deletions flutter/lib/src/sentry_flutter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ mixin SentryFlutter {
AndroidPlatformChecker isAndroidChecker = isAndroid,
MethodChannel channel = _channel,
}) async {
if (optionsConfiguration == null) {
throw ArgumentError('OptionsConfiguration is required.');
}

final flutterOptions = SentryFlutterOptions();

// first step is to install the native integration and set default values,
Expand Down
15 changes: 4 additions & 11 deletions flutter/lib/src/sentry_flutter_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@ class SentryFlutterOptions extends SentryOptions {
_autoSessionTrackingIntervalMillis;

set autoSessionTrackingIntervalMillis(int value) {
assert(value != null);
_autoSessionTrackingIntervalMillis = (value != null && value >= 0)
? value
: _autoSessionTrackingIntervalMillis;
_autoSessionTrackingIntervalMillis =
value >= 0 ? value : _autoSessionTrackingIntervalMillis;
}

/// Enable or disable ANR (Application Not Responding) Default is enabled Used by AnrIntegration.
Expand All @@ -51,9 +49,7 @@ class SentryFlutterOptions extends SentryOptions {
int get anrTimeoutIntervalMillis => _anrTimeoutIntervalMillis;

set anrTimeoutIntervalMillis(int value) {
assert(value != null);
_anrTimeoutIntervalMillis =
(value != null && value >= 0) ? value : _anrTimeoutIntervalMillis;
_anrTimeoutIntervalMillis = value >= 0 ? value : _anrTimeoutIntervalMillis;
}

/// Enable or disable the Automatic breadcrumbs on the Native platforms (Android/iOS)
Expand All @@ -70,8 +66,7 @@ class SentryFlutterOptions extends SentryOptions {
int get cacheDirSize => _cacheDirSize;

set cacheDirSize(int value) {
assert(value != null);
_cacheDirSize = (value != null && value >= 0) ? value : _cacheDirSize;
_cacheDirSize = value >= 0 ? value : _cacheDirSize;
}

@Deprecated(
Expand Down Expand Up @@ -188,8 +183,6 @@ class SentryFlutterOptions extends SentryOptions {
@foundation.visibleForTesting
void configureBreadcrumbTrackingForPlatform(
foundation.TargetPlatform platform) {
assert(platform != null);

// Bacause platform reports the Operating System and not if it is running
// in a browser. So we have to check if this is Flutter for web.
// See https://github.com/flutter/flutter/blob/c5a69b9b8ad186e9fce017fd4bfb8ce63f9f4d13/packages/flutter/lib/src/foundation/_platform_web.dart
Expand Down
1 change: 0 additions & 1 deletion flutter/lib/src/widgets_binding_observer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ class SentryWidgetsBindingObserver with WidgetsBindingObserver {
case AppLifecycleState.detached:
return 'detached';
}
return '';
}

/*
Expand Down
2 changes: 0 additions & 2 deletions flutter/test/load_android_image_list_test.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'dart:async';

import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:sentry/sentry.dart';
Expand Down