Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
60fba54
dont call apprunner in runzonedguarded if onError is supported
denrase Oct 3, 2022
df7b25d
Merge branch 'main' into fix/platform-dispatcher-onerror
denrase Oct 3, 2022
a18c5ac
format
denrase Oct 3, 2022
9360251
update changelog
denrase Oct 3, 2022
1a43cf1
fix analyze issues
denrase Oct 3, 2022
34a2d4f
use BindingUtils.getWidgetsBindingInstance() to access platform dispa…
denrase Oct 3, 2022
412aa83
dont check if error is supported again
denrase Oct 3, 2022
7d6f830
mark callAppRunnerInRunZonedGuarded as internal
denrase Oct 3, 2022
9b69409
Merge branch 'main' into fix/platform-dispatcher-onerror
denrase Oct 10, 2022
f3e8676
use PlatformDispatcher.instance
denrase Oct 10, 2022
628880b
move changelog entry to features
denrase Oct 10, 2022
3e52249
use type inference
denrase Oct 11, 2022
1c792b6
ignore warning
denrase Oct 11, 2022
315be14
remove unused import
denrase Oct 11, 2022
8189aaf
recreate mock.mocks.dart
denrase Oct 11, 2022
7b9e707
Merge branch 'main' into fix/platform-dispatcher-onerror
denrase Oct 11, 2022
281547a
Merge branch 'main' into fix/platform-dispatcher-onerror
marandaneto Oct 11, 2022
609026b
fix incorrect changelog
denrase Oct 11, 2022
f27e3c2
Merge branch 'main' into fix/platform-dispatcher-onerror
marandaneto Oct 11, 2022
a4d6e42
add WidgetsFlutterBindingIntegration before OnErrorIntegration
denrase Oct 11, 2022
6fdd196
Merge branch 'main' into fix/platform-dispatcher-onerror
denrase Oct 11, 2022
4ea91c6
add newline
denrase Oct 11, 2022
001e443
test that WidgetsFlutterBindingIntegration is before OnErrorIntegration
denrase Oct 11, 2022
33ad3ec
Merge branch 'main' into fix/platform-dispatcher-onerror
marandaneto Oct 13, 2022
485b071
fix
marandaneto Oct 13, 2022
1c94f1e
Merge branch 'main' into fix/platform-dispatcher-onerror
marandaneto Oct 13, 2022
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
  • Loading branch information
marandaneto committed Oct 13, 2022
commit 485b071dea8cbb15fff33a5f9cda6f2cf56426ff
7 changes: 5 additions & 2 deletions dart/lib/src/sentry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,11 @@ class Sentry {
}

/// Initializes the SDK
static Future<void> _init(SentryOptions options, AppRunner? appRunner,
bool callAppRunnerInRunZonedGuarded) async {
static Future<void> _init(
SentryOptions options,
AppRunner? appRunner,
bool callAppRunnerInRunZonedGuarded,
) async {
if (isEnabled) {
options.logger(
SentryLevel.warning,
Expand Down
14 changes: 0 additions & 14 deletions flutter/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -187,20 +187,6 @@ class MainScaffold extends StatelessWidget {
},
child: const Text('Capture from FlutterError.onError'),
),
ElevatedButton(
onPressed: () {
// Only usable on Flutter >= 3.3
// and needs the following additional setup:
// options.addIntegration(OnErrorIntegration());
(WidgetsBinding.instance.platformDispatcher as dynamic)
.onError
?.call(
Exception('PlatformDispatcher.onError'),
StackTrace.current,
);
},
child: const Text('Capture from PlatformDispatcher.onError'),
),
ElevatedButton(
onPressed: () => makeWebRequest(context),
child: const Text('Dart: Web request'),
Expand Down
2 changes: 1 addition & 1 deletion flutter/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies:

dev_dependencies:
pedantic: ^1.11.1
sentry_dart_plugin: ^1.0.0-alpha.4
sentry_dart_plugin: ^1.0.0-beta.1

dependency_overrides:
sentry:
Expand Down
24 changes: 15 additions & 9 deletions flutter/lib/src/sentry_flutter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,27 @@ mixin SentryFlutter {
// first step is to install the native integration and set default values,
// so we are able to capture future errors.
final defaultIntegrations = _createDefaultIntegrations(
packageLoader, channel, flutterOptions, isOnErrorSupported);
packageLoader,
channel,
flutterOptions,
isOnErrorSupported,
);
for (final defaultIntegration in defaultIntegrations) {
flutterOptions.addIntegration(defaultIntegration);
}

await _initDefaultValues(flutterOptions, channel);

await Sentry.init((options) async {
await optionsConfiguration(options as SentryFlutterOptions);
},
appRunner: appRunner,
// ignore: invalid_use_of_internal_member
options: flutterOptions,
// ignore: invalid_use_of_internal_member
callAppRunnerInRunZonedGuarded: !isOnErrorSupported);
await Sentry.init(
(options) async {
await optionsConfiguration(options as SentryFlutterOptions);
},
appRunner: appRunner,
// ignore: invalid_use_of_internal_member
options: flutterOptions,
// ignore: invalid_use_of_internal_member
callAppRunnerInRunZonedGuarded: !isOnErrorSupported,
);
}

static Future<void> _initDefaultValues(
Expand Down