diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index e5f7f676db..c007b1d4ee 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -32,13 +32,6 @@ jobs: matrix: os: [ubuntu] sdk: - - '2.18' - - '2.19' - - '3.0' - - '3.1' - - '3.2' - - '3.3' - - '3.4' - '3.5' - stable - beta diff --git a/.github/workflows/min_version_test.yml b/.github/workflows/min_version_test.yml index 97a8645546..b4a3ea5da3 100644 --- a/.github/workflows/min_version_test.yml +++ b/.github/workflows/min_version_test.yml @@ -32,11 +32,11 @@ jobs: - uses: actions/setup-java@v4 with: distribution: "adopt" - java-version: "11" + java-version: "17" - uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff # pin@v2.18.0 with: - flutter-version: "3.0.0" + flutter-version: "3.24.0" - name: Build Android run: | @@ -53,7 +53,7 @@ jobs: - uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff # pin@v2.18.0 with: - flutter-version: "3.0.0" + flutter-version: "3.24.0" - name: Build iOS run: | @@ -70,7 +70,7 @@ jobs: - uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff # pin@v2.18.0 with: - flutter-version: "3.0.0" + flutter-version: "3.24.0" - name: Build web run: | diff --git a/CHANGELOG.md b/CHANGELOG.md index 5483446c2c..7c30989ca6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -393,6 +393,10 @@ - [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#7181) - [diff](https://github.com/getsentry/sentry-java/compare/7.18.0...7.18.1) +## 9.0.0 + +- Bump Dart and Flutter version, Dart to 3.5.0, Flutter to 3.24.0 ([#2643](https://github.com/getsentry/sentry-dart/pull/2643)) + ## 8.11.0-beta.1 ### Features diff --git a/dart/example/pubspec.yaml b/dart/example/pubspec.yaml index e344bbe25a..4851622d44 100644 --- a/dart/example/pubspec.yaml +++ b/dart/example/pubspec.yaml @@ -5,7 +5,7 @@ version: 1.0.0 publish_to: none environment: - sdk: '>=2.17.0 <4.0.0' + sdk: '>=3.5.0 <4.0.0' dependencies: sentry: diff --git a/dart/example_web/pubspec.yaml b/dart/example_web/pubspec.yaml index 141e5120ac..8f0d0a8739 100644 --- a/dart/example_web/pubspec.yaml +++ b/dart/example_web/pubspec.yaml @@ -4,7 +4,7 @@ description: An absolute bare-bones web app. publish_to: 'none' environment: - sdk: '>=2.17.0 <4.0.0' + sdk: '>=3.5.0 <4.0.0' dependencies: sentry: diff --git a/dart/example_web_legacy/.gitignore b/dart/example_web_legacy/.gitignore deleted file mode 100644 index 3d64647b50..0000000000 --- a/dart/example_web_legacy/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -# Files and directories created by pub -.dart_tool/ -.packages - -# Conventional directory for build outputs -build/ - -# Directory created by dartdoc -doc/api/ diff --git a/dart/example_web_legacy/README.md b/dart/example_web_legacy/README.md deleted file mode 100644 index 98202566f6..0000000000 --- a/dart/example_web_legacy/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# Sentry Dart : web example - -```sh -dart pub get - -# run the project ( see https://dart.dev/tools/webdev#serve ) -dart run webdev serve --release -``` diff --git a/dart/example_web_legacy/analysis_options.yaml b/dart/example_web_legacy/analysis_options.yaml deleted file mode 100644 index be16ace7d1..0000000000 --- a/dart/example_web_legacy/analysis_options.yaml +++ /dev/null @@ -1,5 +0,0 @@ -include: package:lints/recommended.yaml - -analyzer: - errors: - path_does_not_exist: ignore diff --git a/dart/example_web_legacy/pubspec.yaml b/dart/example_web_legacy/pubspec.yaml deleted file mode 100644 index 49b7807084..0000000000 --- a/dart/example_web_legacy/pubspec.yaml +++ /dev/null @@ -1,17 +0,0 @@ -name: sentry_dart_web_example -description: An absolute bare-bones web app. - -publish_to: 'none' - -environment: - sdk: '>=2.17.0 <4.0.0' - -dependencies: - sentry: - path: ../../dart/ - -dev_dependencies: - build_runner: ^2.3.0 - build_web_compilers: ^3.2.3 - lints: ^2.0.0 - webdev: ^2.7.0 diff --git a/dart/example_web_legacy/web/event.dart b/dart/example_web_legacy/web/event.dart deleted file mode 100644 index 6e3e8b3e0b..0000000000 --- a/dart/example_web_legacy/web/event.dart +++ /dev/null @@ -1,76 +0,0 @@ -import 'package:sentry/src/protocol.dart'; - -final event = SentryEvent( - logger: 'main', - serverName: 'server.dart', - release: '1.4.0-preview.1', - environment: 'Test', - message: SentryMessage('This is an example Dart event.'), - tags: const {'project-id': '7371'}, - // ignore: deprecated_member_use, deprecated_member_use_from_same_package - extra: const {'section': '1'}, - // fingerprint: const ['example-dart'], - user: SentryUser( - id: '800', - username: 'first-user', - email: 'first@user.lan', - // ipAddress: '127.0.0.1', - data: {'first-sign-in': '2020-01-01'}, - ), - breadcrumbs: [ - Breadcrumb( - message: 'UI Lifecycle', - timestamp: DateTime.now().toUtc(), - category: 'ui.lifecycle', - type: 'navigation', - data: {'screen': 'MainActivity', 'state': 'created'}, - level: SentryLevel.info, - ) - ], - contexts: Contexts( - operatingSystem: const SentryOperatingSystem( - name: 'Android', - version: '5.0.2', - build: 'LRX22G.P900XXS0BPL2', - kernelVersion: - 'Linux version 3.4.39-5726670 (dpi@SWHC3807) (gcc version 4.8 (GCC) ) #1 SMP PREEMPT Thu Dec 1 19:42:39 KST 2016', - rooted: false, - ), - runtimes: [const SentryRuntime(name: 'ART', version: '5')], - app: SentryApp( - name: 'Example Dart App', - version: '1.42.0', - identifier: 'HGT-App-13', - build: '93785', - buildType: 'release', - deviceAppHash: '5afd3a6', - startTime: DateTime.now().toUtc(), - ), - browser: const SentryBrowser(name: 'Firefox', version: '42.0.1'), - device: SentryDevice( - name: 'SM-P900', - family: 'SM-P900', - model: 'SM-P900 (LRX22G)', - modelId: 'LRX22G', - arch: 'armeabi-v7a', - batteryLevel: 99, - orientation: SentryOrientation.landscape, - manufacturer: 'samsung', - brand: 'samsung', - screenDensity: 2.1, - screenDpi: 320, - online: true, - charging: true, - lowMemory: true, - simulator: false, - memorySize: 1500, - freeMemory: 200, - usableMemory: 4294967296, - storageSize: 4294967296, - freeStorage: 2147483648, - externalStorageSize: 8589934592, - externalFreeStorage: 2863311530, - bootTime: DateTime.now().toUtc(), - ), - ), -); diff --git a/dart/example_web_legacy/web/favicon.ico b/dart/example_web_legacy/web/favicon.ico deleted file mode 100644 index 7ba349b3e6..0000000000 Binary files a/dart/example_web_legacy/web/favicon.ico and /dev/null differ diff --git a/dart/example_web_legacy/web/index.html b/dart/example_web_legacy/web/index.html deleted file mode 100644 index 68cce903f0..0000000000 --- a/dart/example_web_legacy/web/index.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - dart_web - - - - - - - - - - -
- -
- -
Captured
-
- -
- -
Captured
-
- -
- -
Captured
-
- -
- -
Captured
-
- - - diff --git a/dart/example_web_legacy/web/main.dart b/dart/example_web_legacy/web/main.dart deleted file mode 100644 index 506bedf159..0000000000 --- a/dart/example_web_legacy/web/main.dart +++ /dev/null @@ -1,136 +0,0 @@ -import 'dart:async'; -import 'dart:html'; - -import 'package:sentry/sentry.dart'; -import 'package:sentry/src/version.dart'; - -import 'event.dart'; - -// ATTENTION: Change the DSN below with your own to see the events in Sentry. Get one at sentry.io -const dsn = - 'https://e85b375ffb9f43cf8bdf9787768149e0@o447951.ingest.sentry.io/5428562'; - -Future main() async { - await Sentry.init( - (options) => options - ..dsn = dsn - ..debug = true - ..sendDefaultPii = true - ..addEventProcessor(TagEventProcessor()), - appRunner: runApp, - ); -} - -Future runApp() async { - print('runApp'); - - querySelector('#output')?.text = 'Your Dart app is running.'; - - await Sentry.addBreadcrumb( - Breadcrumb( - message: 'Authenticated user', - category: 'auth', - type: 'debug', - data: { - 'admin': true, - 'permissions': [1, 2, 3] - }, - ), - ); - - await Sentry.configureScope((scope) async { - scope - // ..fingerprint = ['example-dart'] - ..transaction = '/example/app' - ..level = SentryLevel.warning; - await scope.setTag('build', '579'); - // ignore: deprecated_member_use - await scope.setExtra('company-name', 'Dart Inc'); - - await scope.setUser( - SentryUser( - id: '800', - username: 'first-user', - email: 'first@user.lan', - // ipAddress: '127.0.0.1', - data: {'first-sign-in': '2020-01-01'}, - ), - ); - }); - - querySelector('#btEvent') - ?.onClick - .listen((event) => captureCompleteExampleEvent()); - querySelector('#btMessage')?.onClick.listen((event) => captureMessage()); - querySelector('#btException')?.onClick.listen((event) => captureException()); - querySelector('#btUnhandledException') - ?.onClick - .listen((event) => captureUnhandledException()); -} - -Future captureMessage() async { - print('Capturing Message : '); - final sentryId = await Sentry.captureMessage( - 'Message 2', - template: 'Message %s', - params: ['2'], - ); - print('capture message result : $sentryId'); - if (sentryId != SentryId.empty()) { - querySelector('#messageResult')?.style.display = 'block'; - } -} - -Future captureException() async { - try { - await buildCard(); - } catch (error, stackTrace) { - print('\nReporting the following stack trace: '); - final sentryId = await Sentry.captureException( - error, - stackTrace: stackTrace, - ); - - print('Capture exception : SentryId: $sentryId'); - - if (sentryId != SentryId.empty()) { - querySelector('#exceptionResult')?.style.display = 'block'; - } - } -} - -Future captureUnhandledException() async { - querySelector('#unhandledResult')?.style.display = 'block'; - - await buildCard(); -} - -Future captureCompleteExampleEvent() async { - print('\nReporting a complete event example: $sdkName'); - final sentryId = await Sentry.captureEvent(event); - - print('Response SentryId: $sentryId'); - - if (sentryId != SentryId.empty()) { - querySelector('#eventResult')?.style.display = 'block'; - } -} - -Future buildCard() async { - await loadData(); -} - -Future loadData() async { - await parseData(); -} - -Future parseData() async { - throw StateError('This is a test error'); -} - -class TagEventProcessor implements EventProcessor { - @override - SentryEvent? apply(SentryEvent event, Hint hint) { - return event..tags?.addAll({'page-locale': 'en-us'}); - } -} diff --git a/dart/example_web_legacy/web/styles.css b/dart/example_web_legacy/web/styles.css deleted file mode 100644 index cc035c95c9..0000000000 --- a/dart/example_web_legacy/web/styles.css +++ /dev/null @@ -1,14 +0,0 @@ -@import url(https://fonts.googleapis.com/css?family=Roboto); - -html, body { - width: 100%; - height: 100%; - margin: 0; - padding: 0; - font-family: 'Roboto', sans-serif; -} - -#output { - padding: 20px; - text-align: center; -} diff --git a/dart/lib/sentry.dart b/dart/lib/sentry.dart index cbfa514b36..f9ce19842b 100644 --- a/dart/lib/sentry.dart +++ b/dart/lib/sentry.dart @@ -3,7 +3,7 @@ // found in the LICENSE file. /// A pure Dart client for Sentry.io crash reporting. -library sentry_dart; +library; export 'src/run_zoned_guarded_integration.dart'; export 'src/hub.dart'; diff --git a/dart/lib/src/protocol/sentry_event.dart b/dart/lib/src/protocol/sentry_event.dart index f741097e08..b1bda25804 100644 --- a/dart/lib/src/protocol/sentry_event.dart +++ b/dart/lib/src/protocol/sentry_event.dart @@ -99,9 +99,8 @@ class SentryEvent with SentryEventLike { /// If it's an Error, with a stackTrace, the stackTrace is logged. /// If this behavior is undesirable, consider using a custom formatted /// [message] instead. - dynamic get throwable => (_throwable is ThrowableMechanism) - ? (_throwable as ThrowableMechanism).throwable - : _throwable; + dynamic get throwable => + (_throwable is ThrowableMechanism) ? _throwable.throwable : _throwable; /// A throwable decorator that holds a [Mechanism] related to the decorated /// [throwable] diff --git a/dart/lib/src/sentry_client.dart b/dart/lib/src/sentry_client.dart index dc59eea643..ce0e48bac7 100644 --- a/dart/lib/src/sentry_client.dart +++ b/dart/lib/src/sentry_client.dart @@ -555,7 +555,7 @@ class SentryClient { bool _sampleRate() { if (_options.sampleRate != null && _random != null) { - return (_options.sampleRate! < _random!.nextDouble()); + return (_options.sampleRate! < _random.nextDouble()); } return false; } diff --git a/dart/lib/src/version.dart b/dart/lib/src/version.dart index 0356b3f806..3cfe70c430 100644 --- a/dart/lib/src/version.dart +++ b/dart/lib/src/version.dart @@ -6,7 +6,7 @@ /// tool used to submit events to Sentry.io. /// /// This library contains Sentry.io SDK constants used by this package. -library version; +library; /// The SDK version reported to Sentry.io in the submitted events. const String sdkVersion = '8.13.0-beta.3'; diff --git a/dart/pubspec.yaml b/dart/pubspec.yaml index 79cfcf240b..d55e506d8d 100644 --- a/dart/pubspec.yaml +++ b/dart/pubspec.yaml @@ -9,7 +9,7 @@ issue_tracker: https://github.com/getsentry/sentry-dart/issues documentation: https://docs.sentry.io/platforms/dart/ environment: - sdk: '>=2.17.0 <4.0.0' + sdk: '>=3.5.0 <4.0.0' platforms: android: diff --git a/dart/test/event_processor/enricher/io_enricher_test.dart b/dart/test/event_processor/enricher/io_enricher_test.dart index 4b9618f41c..0e195b89ff 100644 --- a/dart/test/event_processor/enricher/io_enricher_test.dart +++ b/dart/test/event_processor/enricher/io_enricher_test.dart @@ -1,5 +1,5 @@ @TestOn('vm') -library dart_test; +library; import 'dart:io'; diff --git a/dart/test/event_processor/enricher/io_platform_memory_test.dart b/dart/test/event_processor/enricher/io_platform_memory_test.dart index ce2c8474f4..4ba623db99 100644 --- a/dart/test/event_processor/enricher/io_platform_memory_test.dart +++ b/dart/test/event_processor/enricher/io_platform_memory_test.dart @@ -1,5 +1,5 @@ @TestOn('vm') -library dart_test; +library; import 'dart:io'; diff --git a/dart/test/event_processor/enricher/web_enricher_test.dart b/dart/test/event_processor/enricher/web_enricher_test.dart index 39502fc134..dbf2457452 100644 --- a/dart/test/event_processor/enricher/web_enricher_test.dart +++ b/dart/test/event_processor/enricher/web_enricher_test.dart @@ -1,5 +1,5 @@ @TestOn('browser') -library dart_test; +library; import 'package:sentry/sentry.dart'; import 'package:sentry/src/event_processor/enricher/html_enricher_event_processor.dart' diff --git a/dart/test/event_processor/exception/io_exception_event_processor_test.dart b/dart/test/event_processor/exception/io_exception_event_processor_test.dart index 9523038638..335f45ab2b 100644 --- a/dart/test/event_processor/exception/io_exception_event_processor_test.dart +++ b/dart/test/event_processor/exception/io_exception_event_processor_test.dart @@ -1,5 +1,5 @@ @TestOn('vm') -library dart_test; +library; import 'dart:io'; diff --git a/dart/test/example_web_compile_test.dart b/dart/test/example_web_compile_test.dart index 1a2a0cf13f..20e2509b6f 100644 --- a/dart/test/example_web_compile_test.dart +++ b/dart/test/example_web_compile_test.dart @@ -1,19 +1,16 @@ @TestOn('vm') -library dart_test; +library; import 'dart:async'; import 'dart:convert'; import 'dart:io'; -import 'package:version/version.dart'; import 'package:test/test.dart'; // Tests for the following issue // https://github.com/getsentry/sentry-dart/issues/1893 void main() { - final dartVersion = Version.parse(Platform.version.split(' ')[0]); - final isLegacy = dartVersion < Version.parse('3.3.0'); - final exampleAppDir = isLegacy ? 'example_web_legacy' : 'example_web'; + final exampleAppDir = 'example_web'; final exampleAppWorkingDir = '${Directory.current.path}${Platform.pathSeparator}$exampleAppDir'; group('Compile $exampleAppDir', () { @@ -41,10 +38,9 @@ void main() { reason: 'Could not compile main.dart, likely because of dart:io import.'); expect( - compileResult.stdout, - contains(isLegacy - ? 'Succeeded after ' - : 'build_web_compilers:entrypoint on web/main.dart:Compiled')); + compileResult.stdout, + contains('build_web_compilers:entrypoint on web/main.dart:Compiled'), + ); }, timeout: Timeout(const Duration(minutes: 1)), // double of detault timeout ); diff --git a/dart/test/http_client/io_client_provider_test.dart b/dart/test/http_client/io_client_provider_test.dart index 81d05c1540..211c3e3900 100644 --- a/dart/test/http_client/io_client_provider_test.dart +++ b/dart/test/http_client/io_client_provider_test.dart @@ -1,5 +1,5 @@ @TestOn('vm') -library dart_test; +library; import 'dart:io'; diff --git a/dart/test/initialization_test.dart b/dart/test/initialization_test.dart index 42766ac93d..46c0cd35c6 100644 --- a/dart/test/initialization_test.dart +++ b/dart/test/initialization_test.dart @@ -1,5 +1,5 @@ @TestOn('vm') -library dart_test; +library; import 'package:sentry/sentry.dart'; import 'package:test/test.dart'; diff --git a/dart/test/load_dart_debug_images_integration_test.dart b/dart/test/load_dart_debug_images_integration_test.dart index 84d478ab08..4b1309607d 100644 --- a/dart/test/load_dart_debug_images_integration_test.dart +++ b/dart/test/load_dart_debug_images_integration_test.dart @@ -1,5 +1,5 @@ @TestOn('vm') -library dart_test; +library; import 'dart:async'; diff --git a/dart/test/sentry_attachment_io_test.dart b/dart/test/sentry_attachment_io_test.dart index 29a0076bfe..1dd1850f41 100644 --- a/dart/test/sentry_attachment_io_test.dart +++ b/dart/test/sentry_attachment_io_test.dart @@ -1,5 +1,5 @@ @TestOn('vm') -library dart_test; +library; import 'dart:io'; diff --git a/dart/test/sentry_browser_test.dart b/dart/test/sentry_browser_test.dart index eaccfa1d03..cb83f510c9 100644 --- a/dart/test/sentry_browser_test.dart +++ b/dart/test/sentry_browser_test.dart @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @TestOn('browser') -library dart_test; +library; import 'package:test/test.dart'; diff --git a/dart/test/sentry_envelope_vm_test.dart b/dart/test/sentry_envelope_vm_test.dart index f4a22881cc..96da255234 100644 --- a/dart/test/sentry_envelope_vm_test.dart +++ b/dart/test/sentry_envelope_vm_test.dart @@ -1,5 +1,5 @@ @TestOn('vm') -library dart_test; +library; import 'dart:convert'; import 'dart:io'; diff --git a/dart/test/sentry_exception_factory_test.dart b/dart/test/sentry_exception_factory_test.dart index 643414ab67..ad6df2a724 100644 --- a/dart/test/sentry_exception_factory_test.dart +++ b/dart/test/sentry_exception_factory_test.dart @@ -279,7 +279,7 @@ ${StackTraceErrorStackTrace()}'''; } } -class StackTraceErrorStackTrace extends StackTrace { +class StackTraceErrorStackTrace implements StackTrace { @override String toString() { return ''' @@ -318,7 +318,7 @@ ${SentryStackTrace()}'''; } } -class SentryStackTrace extends StackTrace { +class SentryStackTrace implements StackTrace { @override String toString() { return ''' diff --git a/dart/test/sentry_io_client_test.dart b/dart/test/sentry_io_client_test.dart index 9ffe1f319c..a775073b7c 100644 --- a/dart/test/sentry_io_client_test.dart +++ b/dart/test/sentry_io_client_test.dart @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @TestOn('vm') -library dart_test; +library; import 'dart:io'; diff --git a/dart/test/sentry_isolate_extension_test.dart b/dart/test/sentry_isolate_extension_test.dart index 89c6a0fe4b..8cffea9c1c 100644 --- a/dart/test/sentry_isolate_extension_test.dart +++ b/dart/test/sentry_isolate_extension_test.dart @@ -1,5 +1,5 @@ @TestOn('vm') -library dart_test; +library; import 'dart:isolate'; diff --git a/dart/test/sentry_isolate_test.dart b/dart/test/sentry_isolate_test.dart index 07347d5585..597c1de795 100644 --- a/dart/test/sentry_isolate_test.dart +++ b/dart/test/sentry_isolate_test.dart @@ -1,5 +1,5 @@ @TestOn('vm') -library dart_test; +library; import 'package:sentry/src/hub.dart'; import 'package:sentry/src/protocol/sentry_level.dart'; diff --git a/dart/test/sentry_run_zoned_guarded_test.dart b/dart/test/sentry_run_zoned_guarded_test.dart index 86bc6741c1..1fd06310dd 100644 --- a/dart/test/sentry_run_zoned_guarded_test.dart +++ b/dart/test/sentry_run_zoned_guarded_test.dart @@ -1,5 +1,5 @@ @TestOn('vm') -library dart_test; +library; import 'dart:async'; diff --git a/dart/test/version_test.dart b/dart/test/version_test.dart index f2022bbba2..ada7310338 100644 --- a/dart/test/version_test.dart +++ b/dart/test/version_test.dart @@ -3,7 +3,7 @@ // found in the LICENSE file. @TestOn('vm') -library dart_test; +library; import 'dart:io'; diff --git a/dio/lib/sentry_dio.dart b/dio/lib/sentry_dio.dart index 5c1ce5d084..d0238e4c10 100644 --- a/dio/lib/sentry_dio.dart +++ b/dio/lib/sentry_dio.dart @@ -1,4 +1,4 @@ -library sentry_dio; +library; export 'src/sentry_dio_extension.dart'; diff --git a/dio/pubspec.yaml b/dio/pubspec.yaml index 59cb66b4b7..9df475f995 100644 --- a/dio/pubspec.yaml +++ b/dio/pubspec.yaml @@ -7,7 +7,7 @@ issue_tracker: https://github.com/getsentry/sentry-dart/issues documentation: https://docs.sentry.io/platforms/dart/integrations/dio/ environment: - sdk: '>=2.17.0 <4.0.0' + sdk: '>=3.5.0 <4.0.0' platforms: android: diff --git a/dio/test/version_test.dart b/dio/test/version_test.dart index 2e0c6a8b14..ebfddbcf10 100644 --- a/dio/test/version_test.dart +++ b/dio/test/version_test.dart @@ -1,5 +1,5 @@ @TestOn('vm') -library dio_test; +library; import 'dart:io'; diff --git a/drift/lib/sentry_drift.dart b/drift/lib/sentry_drift.dart index ba84220b42..d2df194d04 100644 --- a/drift/lib/sentry_drift.dart +++ b/drift/lib/sentry_drift.dart @@ -1,3 +1,3 @@ -library sentry_drift; +library; export 'src/sentry_query_executor.dart'; diff --git a/drift/pubspec.yaml b/drift/pubspec.yaml index 5a19f2844f..e6dc4f6f94 100644 --- a/drift/pubspec.yaml +++ b/drift/pubspec.yaml @@ -6,7 +6,7 @@ repository: https://github.com/getsentry/sentry-dart issue_tracker: https://github.com/getsentry/sentry-dart/issues environment: - sdk: '>=2.17.0 <4.0.0' + sdk: '>=3.5.0 <4.0.0' platforms: android: diff --git a/e2e_test/pubspec.yaml b/e2e_test/pubspec.yaml index 0f53c54ca5..d0ec1b711c 100644 --- a/e2e_test/pubspec.yaml +++ b/e2e_test/pubspec.yaml @@ -5,7 +5,7 @@ version: 1.0.0 publish_to: none environment: - sdk: '>=2.17.0 <4.0.0' + sdk: '>=3.5.0 <4.0.0' dependencies: sentry: diff --git a/file/pubspec.yaml b/file/pubspec.yaml index a61f3603c1..bfc9a4aa9b 100644 --- a/file/pubspec.yaml +++ b/file/pubspec.yaml @@ -7,7 +7,7 @@ issue_tracker: https://github.com/getsentry/sentry-dart/issues documentation: https://docs.sentry.io/platforms/dart/configuration/integrations/file/ environment: - sdk: '>=2.19.0 <4.0.0' + sdk: '>=3.5.0 <4.0.0' platforms: android: diff --git a/flutter/android/build.gradle b/flutter/android/build.gradle index e91208507f..7cdfa6d40e 100644 --- a/flutter/android/build.gradle +++ b/flutter/android/build.gradle @@ -35,7 +35,7 @@ android { defaultConfig { minSdkVersion 19 - targetSdkVersion 33 + targetSdkVersion 34 ndk { // Flutter does not currently support building for x86 Android (See Issue 9253). diff --git a/flutter/example/lib/main.dart b/flutter/example/lib/main.dart index d67aec2adc..b2c5c8e626 100644 --- a/flutter/example/lib/main.dart +++ b/flutter/example/lib/main.dart @@ -346,18 +346,13 @@ class MainScaffold extends StatelessWidget { ), TooltipButton( 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, - ); + WidgetsBinding.instance.platformDispatcher.onError?.call( + Exception('PlatformDispatcher.onError'), + StackTrace.current, + ); }, text: - 'This is only usable on Flutter >= 3.3 and requires additional setup: options.addIntegration(OnErrorIntegration());', + 'This requires additional setup: options.addIntegration(OnErrorIntegration());', buttonTitle: 'Capture from PlatformDispatcher.onError', ), TooltipButton( @@ -682,17 +677,6 @@ class MainScaffold extends StatelessWidget { } } -extension BuildContextExtension on BuildContext { - bool get isMounted { - try { - return (this as dynamic).mounted; - } on NoSuchMethodError catch (_) { - // ignore, only available in newer Flutter versions - } - return true; - } -} - class AndroidExample extends StatelessWidget { const AndroidExample({super.key}); diff --git a/flutter/example/pubspec.yaml b/flutter/example/pubspec.yaml index 371775ad3c..3c40bb5583 100644 --- a/flutter/example/pubspec.yaml +++ b/flutter/example/pubspec.yaml @@ -5,8 +5,8 @@ version: 8.13.0-beta.3 publish_to: 'none' # Remove this line if you wish to publish to pub.dev environment: - sdk: '>=2.17.0 <4.0.0' - flutter: '>=3.0.0' + sdk: '>=3.5.0 <4.0.0' + flutter: '>=3.24.0' dependencies: flutter: diff --git a/flutter/lib/sentry_flutter.dart b/flutter/lib/sentry_flutter.dart index e531fc9fb8..8e3e80afe9 100644 --- a/flutter/lib/sentry_flutter.dart +++ b/flutter/lib/sentry_flutter.dart @@ -1,5 +1,5 @@ /// A Flutter client for Sentry.io crash reporting. -library sentry_flutter; +library; // ignore: invalid_export_of_internal_element export 'package:sentry/sentry.dart'; diff --git a/flutter/lib/src/feedback/sentry_feedback_widget.dart b/flutter/lib/src/feedback/sentry_feedback_widget.dart index 297c9318ce..12f3df4383 100644 --- a/flutter/lib/src/feedback/sentry_feedback_widget.dart +++ b/flutter/lib/src/feedback/sentry_feedback_widget.dart @@ -206,13 +206,6 @@ class _SentryFeedbackWidgetState extends State { hint = Hint.withScreenshot(screenshot); } await _captureFeedback(feedback, hint); - - bool mounted; - try { - mounted = (this as dynamic).mounted as bool; - } on NoSuchMethodError catch (_) { - mounted = false; - } if (mounted) { // ignore: use_build_context_synchronously await Navigator.maybePop(context); diff --git a/flutter/lib/src/integrations/on_error_integration.dart b/flutter/lib/src/integrations/on_error_integration.dart index f01d1a03ee..e78cab6cc7 100644 --- a/flutter/lib/src/integrations/on_error_integration.dart +++ b/flutter/lib/src/integrations/on_error_integration.dart @@ -14,7 +14,6 @@ typedef ErrorCallback = bool Function(Object exception, StackTrace stackTrace); /// - https://api.flutter.dev/flutter/dart-ui/PlatformDispatcher/onError.html /// /// Remarks: -/// - Only usable on Flutter >= 3.3.0. /// - Does not work on Flutter Web /// /// This is used instead of [RunZonedGuardedIntegration]. Not using the @@ -97,11 +96,6 @@ class OnErrorIntegration implements Integration { @override void close() { - if (!(dispatchWrapper?.isOnErrorSupported(_options!) == true)) { - // bail out - return; - } - /// Restore default if the integration error is still set. if (dispatchWrapper?.onError == _integrationOnError) { dispatchWrapper?.onError = _defaultOnError; @@ -111,44 +105,16 @@ class OnErrorIntegration implements Integration { } } -/// This class wraps the `this as dynamic` hack in a type-safe manner. -/// It helps to introduce code, which uses newer features from Flutter -/// without breaking Sentry on older versions of Flutter. -// Should not become part of public API. +/// Wrapper to make this testable. Should not become public API. @visibleForTesting class PlatformDispatcherWrapper { PlatformDispatcherWrapper(this._dispatcher); final PlatformDispatcher? _dispatcher; - /// Should not be accessed if [isOnErrorSupported] == false - ErrorCallback? get onError => - (_dispatcher as dynamic)?.onError as ErrorCallback?; + ErrorCallback? get onError => _dispatcher?.onError; - /// Should not be accessed if [isOnErrorSupported] == false set onError(ErrorCallback? callback) { - (_dispatcher as dynamic)?.onError = callback; - } - - bool isOnErrorSupported(SentryFlutterOptions options) { - try { - onError; - } on NoSuchMethodError { - // This error is expected on pre 3.1 Flutter version - return false; - } catch (exception, stacktrace) { - // This error is neither expected on pre 3.1 nor on >= 3.1 Flutter versions - options.logger( - SentryLevel.debug, - 'An unexpected exception was thrown, please create an issue at https://github.com/getsentry/sentry-dart/issues', - exception: exception, - stackTrace: stacktrace, - ); - if (options.automatedTestMode) { - rethrow; - } - return false; - } - return true; + _dispatcher?.onError = callback; } } diff --git a/flutter/lib/src/native/c/binding.dart b/flutter/lib/src/native/c/binding.dart index 5d944edf0b..aed9e202ce 100644 --- a/flutter/lib/src/native/c/binding.dart +++ b/flutter/lib/src/native/c/binding.dart @@ -869,7 +869,7 @@ class SentryNative { /// frozen but lists and dicts are not and can be frozen on demand. This /// automatically happens for some shared values in the event payload like /// the module list. -class sentry_value_u extends ffi.Union { +base class sentry_value_u extends ffi.Union { @ffi.Uint64() external int _bits; @@ -891,4 +891,4 @@ abstract class sentry_value_type_t { /// The Sentry Client Options. /// /// See https://docs.sentry.io/platforms/native/configuration/ -class sentry_options_s extends ffi.Opaque {} +base class sentry_options_s extends ffi.Opaque {} diff --git a/flutter/lib/src/native/cocoa/binding.dart b/flutter/lib/src/native/cocoa/binding.dart index 13b33db60c..9a2e9eef63 100644 --- a/flutter/lib/src/native/cocoa/binding.dart +++ b/flutter/lib/src/native/cocoa/binding.dart @@ -31229,13 +31229,13 @@ class NSObject extends _ObjCWrapper { } } -class ObjCSel extends ffi.Opaque {} +base class ObjCSel extends ffi.Opaque {} -class ObjCObject extends ffi.Opaque {} +base class ObjCObject extends ffi.Opaque {} typedef instancetype = ffi.Pointer; -class _NSZone extends ffi.Opaque {} +base class _NSZone extends ffi.Opaque {} class Protocol extends _ObjCWrapper { Protocol._(ffi.Pointer id, SentryCocoa lib, @@ -34397,7 +34397,7 @@ class NSData extends NSObject { } } -class _NSRange extends ffi.Struct { +base class _NSRange extends ffi.Struct { @ffi.UnsignedLong() external int location; @@ -35851,7 +35851,7 @@ class NSValue extends NSObject { } } -class CGPoint extends ffi.Struct { +base class CGPoint extends ffi.Struct { @ffi.Double() external double x; @@ -35859,7 +35859,7 @@ class CGPoint extends ffi.Struct { external double y; } -class CGSize extends ffi.Struct { +base class CGSize extends ffi.Struct { @ffi.Double() external double width; @@ -35867,13 +35867,13 @@ class CGSize extends ffi.Struct { external double height; } -class CGRect extends ffi.Struct { +base class CGRect extends ffi.Struct { external CGPoint origin; external CGSize size; } -class NSEdgeInsets extends ffi.Struct { +base class NSEdgeInsets extends ffi.Struct { @ffi.Double() external double top; @@ -36894,7 +36894,7 @@ class ObjCBlock_ObjCObject_NSError_NSString extends _ObjCBlockBase { } } -class _ObjCBlockDesc extends ffi.Struct { +base class _ObjCBlockDesc extends ffi.Struct { @ffi.UnsignedLong() external int reserved; @@ -36908,7 +36908,7 @@ class _ObjCBlockDesc extends ffi.Struct { external ffi.Pointer signature; } -class _ObjCBlock extends ffi.Struct { +base class _ObjCBlock extends ffi.Struct { external ffi.Pointer isa; @ffi.Int() @@ -38108,7 +38108,7 @@ class NSPredicate extends NSObject { } } -class __va_list_tag extends ffi.Struct { +base class __va_list_tag extends ffi.Struct { @ffi.UnsignedInt() external int gp_offset; @@ -38950,7 +38950,7 @@ class ObjCBlock_bool_ObjCObject_ObjCObject_bool extends _ObjCBlockBase { } } -class NSFastEnumerationState extends ffi.Struct { +base class NSFastEnumerationState extends ffi.Struct { @ffi.UnsignedLong() external int state; @@ -46911,7 +46911,7 @@ class NSRunLoop extends NSObject { } } -class __CFRunLoop extends ffi.Opaque {} +base class __CFRunLoop extends ffi.Opaque {} class NSTimer extends NSObject { NSTimer._(ffi.Pointer id, SentryCocoa lib, @@ -48885,14 +48885,14 @@ class NSAppleEventDescriptor extends NSObject { } @ffi.Packed(2) -class AEDesc extends ffi.Struct { +base class AEDesc extends ffi.Struct { @ffi.UnsignedInt() external int descriptorType; external ffi.Pointer> dataHandle; } -class OpaqueAEDataStorageType extends ffi.Opaque {} +base class OpaqueAEDataStorageType extends ffi.Opaque {} abstract class NSAppleEventSendOptions { static const int NSAppleEventSendNoReply = 1; @@ -57048,7 +57048,7 @@ class NSScanner extends NSObject { } } -class NSDecimal extends ffi.Opaque {} +base class NSDecimal extends ffi.Opaque {} class NSException extends NSObject { NSException._(ffi.Pointer id, SentryCocoa lib, @@ -61794,7 +61794,7 @@ class NSProcessInfo extends NSObject { } } -class NSOperatingSystemVersion extends ffi.Struct { +base class NSOperatingSystemVersion extends ffi.Struct { @ffi.Long() external int majorVersion; @@ -63819,9 +63819,9 @@ abstract class NSURLCredentialPersistence { static const int NSURLCredentialPersistenceSynchronizable = 3; } -class __SecIdentity extends ffi.Opaque {} +base class __SecIdentity extends ffi.Opaque {} -class __SecTrust extends ffi.Opaque {} +base class __SecTrust extends ffi.Opaque {} class NSURLProtectionSpace extends NSObject { NSURLProtectionSpace._(ffi.Pointer id, SentryCocoa lib, diff --git a/flutter/lib/src/screenshot/recorder.dart b/flutter/lib/src/screenshot/recorder.dart index 497eb4ebfd..3869e4e1b3 100644 --- a/flutter/lib/src/screenshot/recorder.dart +++ b/flutter/lib/src/screenshot/recorder.dart @@ -118,7 +118,7 @@ class ScreenshotRecorder { List? _obscureSync(_Capture capture) { if (_maskingConfig != null) { - final filter = WidgetFilter(_maskingConfig!, options.logger); + final filter = WidgetFilter(_maskingConfig, options.logger); final colorScheme = capture.context.findColorScheme(); filter.obscure( root: capture.root, diff --git a/flutter/lib/src/sentry_asset_bundle.dart b/flutter/lib/src/sentry_asset_bundle.dart index b4b6c2c905..48aba614dc 100644 --- a/flutter/lib/src/sentry_asset_bundle.dart +++ b/flutter/lib/src/sentry_asset_bundle.dart @@ -78,7 +78,7 @@ class SentryAssetBundle implements AssetBundle { outerSpan, 'loadBuffer', key, - () => _loadBuffer(key), + () => _bundle.loadBuffer(key), updateInnerSpan: (innerSpan) => innerSpan?.setData('file.path', key), ); } @@ -110,14 +110,14 @@ class SentryAssetBundle implements AssetBundle { Future loadStructuredBinaryData( String key, FutureOr Function(ByteData data) parser) { if (!_enableStructuredDataTracing) { - return _loadStructuredBinaryDataWrapper(key, parser); + return _bundle.loadStructuredBinaryData(key, parser); } final outerSpan = _hub.getSpan(); return _wrapLoad( outerSpan, 'loadStructuredBinaryData', key, - () => _loadStructuredBinaryDataWrapper( + () => _bundle.loadStructuredBinaryData( key, (value) => _wrapParser( outerSpan, @@ -256,42 +256,6 @@ class SentryAssetBundle implements AssetBundle { } return uri.pathSegments.isEmpty ? key : uri.pathSegments.last; } - - // Helper: Safe method calls for older flutter versions - - Future _loadBuffer(String key) { - try { - // ignore: return_of_invalid_type - return (_bundle as dynamic).loadBuffer(key); - } on NoSuchMethodError catch (_) { - // The loadBuffer method exists as of Flutter greater than 3.1 - // Previous versions don't have it, but later versions do. - // We can't use `extends` in order to provide this method because this is - // a wrapper and thus the method call must be forwarded. - // On Flutter versions <=3.1 we can't forward this call and - // just catch the error which is thrown. On later version the call gets - // correctly forwarded. - // - // In case of a NoSuchMethodError we just return an empty list - return ImmutableBuffer.fromUint8List(Uint8List.fromList([])); - } - } - - Future _loadStructuredBinaryDataWrapper( - String key, - FutureOr Function(ByteData data) parser, - ) { - // The loadStructuredBinaryData method exists as of Flutter greater than 3.8 - // Previous versions don't have it, but later versions do. - // We can't use `extends` in order to provide this method because this is - // a wrapper and thus the method call must be forwarded. - // On Flutter versions <=3.8 we can't forward this call. - // On later version the call gets correctly forwarded. - // The error doesn't need to handled since it can't be called on earlier versions, - // and it's correctly forwarded on later versions. - return (_bundle as dynamic).loadStructuredBinaryData(key, parser) - as Future; - } } @internal diff --git a/flutter/lib/src/sentry_flutter.dart b/flutter/lib/src/sentry_flutter.dart index 692b12894a..ae25f8e206 100644 --- a/flutter/lib/src/sentry_flutter.dart +++ b/flutter/lib/src/sentry_flutter.dart @@ -1,5 +1,4 @@ import 'dart:async'; -import 'dart:ui'; import 'package:flutter/widgets.dart'; import 'package:meta/meta.dart'; @@ -66,14 +65,10 @@ mixin SentryFlutter { _native = createBinding(options); } - final platformDispatcher = PlatformDispatcher.instance; - final wrapper = PlatformDispatcherWrapper(platformDispatcher); - - // Flutter Web doesn't capture [Future] errors if using [PlatformDispatcher.onError] and not + // Flutter Web don't capture [Future] errors if using [PlatformDispatcher.onError] and not // the [runZonedGuarded]. // likely due to https://github.com/flutter/flutter/issues/100277 - final bool isOnErrorSupported = - !options.platformChecker.isWeb && wrapper.isOnErrorSupported(options); + final isOnErrorSupported = !options.platformChecker.isWeb; final bool isRootZone = options.platformChecker.isRootZone; diff --git a/flutter/lib/src/user_interaction/sentry_user_interaction_widget.dart b/flutter/lib/src/user_interaction/sentry_user_interaction_widget.dart index 45c3a0921c..4432597e3d 100644 --- a/flutter/lib/src/user_interaction/sentry_user_interaction_widget.dart +++ b/flutter/lib/src/user_interaction/sentry_user_interaction_widget.dart @@ -613,21 +613,6 @@ class _SentryUserInteractionWidgetState if (element == null) { return false; } - try { - // ignore: return_of_invalid_type - return (element as dynamic).mounted; - } on NoSuchMethodError catch (_) { - // mounted checks if the widget is not null. - - try { - // Flutter 3.0.0 does `_widget!` and if `_widget` is null it throws. - - // ignore: unnecessary_null_comparison - return element.widget != null; - } catch (_) { - // if it throws, the `_widget` is null and not mounted. - return false; - } - } + return element.mounted; } } diff --git a/flutter/pubspec.yaml b/flutter/pubspec.yaml index 2b7d2b4864..121c289ad2 100644 --- a/flutter/pubspec.yaml +++ b/flutter/pubspec.yaml @@ -7,8 +7,8 @@ issue_tracker: https://github.com/getsentry/sentry-dart/issues documentation: https://docs.sentry.io/platforms/flutter/ environment: - sdk: '>=2.17.0 <4.0.0' - flutter: '>=3.0.0' + sdk: '>=3.5.0 <4.0.0' + flutter: '>=3.24.0' platforms: android: diff --git a/flutter/test/android_platform_exception_event_processor_test.dart b/flutter/test/android_platform_exception_event_processor_test.dart index 25ea8b2c6b..c42505584f 100644 --- a/flutter/test/android_platform_exception_event_processor_test.dart +++ b/flutter/test/android_platform_exception_event_processor_test.dart @@ -1,5 +1,5 @@ @TestOn('vm') -library flutter_test; +library; // ignore_for_file: invalid_use_of_internal_member import 'package:flutter/services.dart'; diff --git a/flutter/test/event_processor/screenshot_event_processor_test.dart b/flutter/test/event_processor/screenshot_event_processor_test.dart index dae0bf468d..c433628f24 100644 --- a/flutter/test/event_processor/screenshot_event_processor_test.dart +++ b/flutter/test/event_processor/screenshot_event_processor_test.dart @@ -1,5 +1,5 @@ @Tags(['canvasKit']) // Web renderer where this test can run -library flutter_test; +library; import 'dart:math'; import 'dart:ui'; diff --git a/flutter/test/event_processor/url_filter/io_filter_event_processor_test.dart b/flutter/test/event_processor/url_filter/io_filter_event_processor_test.dart index 186858888d..a9f6f3617e 100644 --- a/flutter/test/event_processor/url_filter/io_filter_event_processor_test.dart +++ b/flutter/test/event_processor/url_filter/io_filter_event_processor_test.dart @@ -1,5 +1,5 @@ @TestOn('vm') -library flutter_test; +library; import 'package:flutter_test/flutter_test.dart'; import 'package:sentry_flutter/sentry_flutter.dart'; diff --git a/flutter/test/event_processor/url_filter/web_url_filter_event_processor_test.dart b/flutter/test/event_processor/url_filter/web_url_filter_event_processor_test.dart index bc80d45e6b..1fa61d1697 100644 --- a/flutter/test/event_processor/url_filter/web_url_filter_event_processor_test.dart +++ b/flutter/test/event_processor/url_filter/web_url_filter_event_processor_test.dart @@ -1,5 +1,5 @@ @TestOn('browser') -library flutter_test; +library; import 'package:flutter_test/flutter_test.dart'; import 'package:sentry_flutter/sentry_flutter.dart'; diff --git a/flutter/test/file_system_transport_test.dart b/flutter/test/file_system_transport_test.dart index 91340f7fb6..0177efb923 100644 --- a/flutter/test/file_system_transport_test.dart +++ b/flutter/test/file_system_transport_test.dart @@ -1,5 +1,5 @@ @TestOn('vm') -library flutter_test; +library; import 'dart:convert'; diff --git a/flutter/test/frame_tracking/frames_tracking_integration_test.dart b/flutter/test/frame_tracking/frames_tracking_integration_test.dart index f16069f447..b1fff1bb8f 100644 --- a/flutter/test/frame_tracking/frames_tracking_integration_test.dart +++ b/flutter/test/frame_tracking/frames_tracking_integration_test.dart @@ -1,6 +1,6 @@ // ignore_for_file: invalid_use_of_internal_member @TestOn('vm') -library flutter_test; +library; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; diff --git a/flutter/test/initialization_test.dart b/flutter/test/initialization_test.dart index 527b51b247..14b98b051f 100644 --- a/flutter/test/initialization_test.dart +++ b/flutter/test/initialization_test.dart @@ -1,5 +1,5 @@ @TestOn('vm') -library flutter_test; +library; import 'package:flutter_test/flutter_test.dart'; import 'package:sentry_flutter/sentry_flutter.dart'; diff --git a/flutter/test/integrations/init_native_sdk_test.dart b/flutter/test/integrations/init_native_sdk_test.dart index 818641073b..7f2d9fe1a6 100644 --- a/flutter/test/integrations/init_native_sdk_test.dart +++ b/flutter/test/integrations/init_native_sdk_test.dart @@ -1,5 +1,5 @@ @TestOn('vm') -library flutter_test; +library; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; diff --git a/flutter/test/integrations/load_contexts_integration_test.dart b/flutter/test/integrations/load_contexts_integration_test.dart index caed2f3293..147d24240e 100644 --- a/flutter/test/integrations/load_contexts_integration_test.dart +++ b/flutter/test/integrations/load_contexts_integration_test.dart @@ -1,5 +1,5 @@ @TestOn('vm') -library flutter_test; +library; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; diff --git a/flutter/test/integrations/load_contexts_integrations_test.dart b/flutter/test/integrations/load_contexts_integrations_test.dart index 7add3f7929..acb7889f7c 100644 --- a/flutter/test/integrations/load_contexts_integrations_test.dart +++ b/flutter/test/integrations/load_contexts_integrations_test.dart @@ -1,5 +1,5 @@ @TestOn('vm') -library flutter_test; +library; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; diff --git a/flutter/test/integrations/load_image_list_test.dart b/flutter/test/integrations/load_image_list_test.dart index 95e31a625c..d4c3da3548 100644 --- a/flutter/test/integrations/load_image_list_test.dart +++ b/flutter/test/integrations/load_image_list_test.dart @@ -1,5 +1,5 @@ @TestOn('vm') -library flutter_test; +library; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; diff --git a/flutter/test/integrations/native_app_start_handler_test.dart b/flutter/test/integrations/native_app_start_handler_test.dart index 375231a45f..de55e42e74 100644 --- a/flutter/test/integrations/native_app_start_handler_test.dart +++ b/flutter/test/integrations/native_app_start_handler_test.dart @@ -1,5 +1,5 @@ @TestOn('vm') -library flutter_test; +library; import 'package:collection/collection.dart'; import 'package:flutter_test/flutter_test.dart'; diff --git a/flutter/test/integrations/native_app_start_integration_test.dart b/flutter/test/integrations/native_app_start_integration_test.dart index 4696dc8987..0cb96a5b80 100644 --- a/flutter/test/integrations/native_app_start_integration_test.dart +++ b/flutter/test/integrations/native_app_start_integration_test.dart @@ -1,5 +1,5 @@ @TestOn('vm') -library flutter_test; +library; import 'dart:async'; import 'dart:core'; diff --git a/flutter/test/integrations/native_sdk_integration_test.dart b/flutter/test/integrations/native_sdk_integration_test.dart index 8645a80aa2..7239166b93 100644 --- a/flutter/test/integrations/native_sdk_integration_test.dart +++ b/flutter/test/integrations/native_sdk_integration_test.dart @@ -1,5 +1,5 @@ @TestOn('vm') -library flutter_test; +library; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; diff --git a/flutter/test/integrations/web_sdk_integration_test.dart b/flutter/test/integrations/web_sdk_integration_test.dart index 7057adcab3..9521e4c34d 100644 --- a/flutter/test/integrations/web_sdk_integration_test.dart +++ b/flutter/test/integrations/web_sdk_integration_test.dart @@ -1,5 +1,5 @@ @TestOn('browser') -library flutter_test; +library; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; diff --git a/flutter/test/native_memory_test.dart b/flutter/test/native_memory_test.dart index 185590ac69..8590f8a6ac 100644 --- a/flutter/test/native_memory_test.dart +++ b/flutter/test/native_memory_test.dart @@ -1,5 +1,5 @@ @TestOn('vm') -library flutter_test; +library; import 'dart:typed_data'; diff --git a/flutter/test/native_scope_observer_test.dart b/flutter/test/native_scope_observer_test.dart index e22136bc1b..feb40f5416 100644 --- a/flutter/test/native_scope_observer_test.dart +++ b/flutter/test/native_scope_observer_test.dart @@ -1,5 +1,5 @@ @TestOn('vm') -library flutter_test; +library; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; diff --git a/flutter/test/profiling_test.dart b/flutter/test/profiling_test.dart index 510daac9f0..fb0c4ce905 100644 --- a/flutter/test/profiling_test.dart +++ b/flutter/test/profiling_test.dart @@ -1,5 +1,5 @@ @TestOn('vm') -library flutter_test; +library; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; diff --git a/flutter/test/replay/replay_integration_test.dart b/flutter/test/replay/replay_integration_test.dart index e8a0bc8a27..9a0cc54e3d 100644 --- a/flutter/test/replay/replay_integration_test.dart +++ b/flutter/test/replay/replay_integration_test.dart @@ -1,7 +1,7 @@ // ignore_for_file: invalid_use_of_internal_member @TestOn('vm') -library flutter_test; +library; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; diff --git a/flutter/test/replay/replay_native_test.dart b/flutter/test/replay/replay_native_test.dart index 7cfee2e574..bbbb347d17 100644 --- a/flutter/test/replay/replay_native_test.dart +++ b/flutter/test/replay/replay_native_test.dart @@ -1,7 +1,7 @@ // ignore_for_file: invalid_use_of_internal_member @TestOn('vm') -library flutter_test; +library; import 'dart:async'; diff --git a/flutter/test/replay/scheduled_recorder_test.dart b/flutter/test/replay/scheduled_recorder_test.dart index add5c67278..f2e672a208 100644 --- a/flutter/test/replay/scheduled_recorder_test.dart +++ b/flutter/test/replay/scheduled_recorder_test.dart @@ -1,7 +1,7 @@ // For some reason, this test is not working in the browser but that's OK, we // don't support video recording anyway. @TestOn('vm') -library dart_test; +library; import 'dart:async'; diff --git a/flutter/test/screenshot/recorder_test.dart b/flutter/test/screenshot/recorder_test.dart index 85ff006748..f66333e5cb 100644 --- a/flutter/test/screenshot/recorder_test.dart +++ b/flutter/test/screenshot/recorder_test.dart @@ -1,7 +1,7 @@ // For some reason, this test is not working in the browser but that's OK, we // don't support video recording anyway. @TestOn('vm') -library dart_test; +library; import 'dart:typed_data'; import 'dart:ui'; diff --git a/flutter/test/screenshot/sentry_screenshot_widget_test.dart b/flutter/test/screenshot/sentry_screenshot_widget_test.dart index 3e04e2fde2..2bf312b790 100644 --- a/flutter/test/screenshot/sentry_screenshot_widget_test.dart +++ b/flutter/test/screenshot/sentry_screenshot_widget_test.dart @@ -1,5 +1,6 @@ @TestOn('vm') -library flutter_test; +library; +// ignore_for_file: invalid_use_of_internal_member import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/annotations.dart'; diff --git a/flutter/test/sentry_native/sentry_native_test.dart b/flutter/test/sentry_native/sentry_native_test.dart index 5f168a919d..9817bfb71a 100644 --- a/flutter/test/sentry_native/sentry_native_test.dart +++ b/flutter/test/sentry_native/sentry_native_test.dart @@ -2,7 +2,7 @@ // a browser. @TestOn('vm') doesn't help by itself in this case because imports // are still evaluated, thus causing a compilation failure. @TestOn('vm && (windows || linux)') -library sentry_native_test; +library; import 'package:flutter_test/flutter_test.dart'; diff --git a/flutter/test/sentry_native_channel_test.dart b/flutter/test/sentry_native_channel_test.dart index 8e6983758b..b041e71105 100644 --- a/flutter/test/sentry_native_channel_test.dart +++ b/flutter/test/sentry_native_channel_test.dart @@ -1,7 +1,7 @@ // ignore_for_file: inference_failure_on_function_invocation @TestOn('vm') -library flutter_test; +library; import 'dart:typed_data'; diff --git a/flutter/test/user_interaction/sentry_user_interaction_widget_test.dart b/flutter/test/user_interaction/sentry_user_interaction_widget_test.dart index cdb27f9275..7d35c3deaa 100644 --- a/flutter/test/user_interaction/sentry_user_interaction_widget_test.dart +++ b/flutter/test/user_interaction/sentry_user_interaction_widget_test.dart @@ -1,5 +1,5 @@ @TestOn('vm') -library flutter_test; +library; // ignore_for_file: invalid_use_of_internal_member import 'dart:async'; diff --git a/flutter/test/version_test.dart b/flutter/test/version_test.dart index b97fd250b4..90c861d5c9 100644 --- a/flutter/test/version_test.dart +++ b/flutter/test/version_test.dart @@ -3,7 +3,7 @@ // found in the LICENSE file. @TestOn('vm') -library flutter_test; +library; import 'dart:io'; diff --git a/flutter/test/view_hierarchy/view_hierarchy_integration_test.dart b/flutter/test/view_hierarchy/view_hierarchy_integration_test.dart index c57fff8b5e..6c04ba5389 100644 --- a/flutter/test/view_hierarchy/view_hierarchy_integration_test.dart +++ b/flutter/test/view_hierarchy/view_hierarchy_integration_test.dart @@ -1,5 +1,5 @@ @TestOn('vm') -library flutter_test; +library; import 'package:flutter_test/flutter_test.dart'; import 'package:sentry_flutter/src/view_hierarchy/view_hierarchy_event_processor.dart'; diff --git a/flutter/test/web/sentry_js_bundles_test.dart b/flutter/test/web/sentry_js_bundles_test.dart index a962f7231a..392b490bbf 100644 --- a/flutter/test/web/sentry_js_bundles_test.dart +++ b/flutter/test/web/sentry_js_bundles_test.dart @@ -1,5 +1,5 @@ @TestOn('browser') -library flutter_test; +library; import 'package:flutter_test/flutter_test.dart'; import 'package:http/http.dart' as http; diff --git a/flutter/test/web/sentry_script_loader_test.dart b/flutter/test/web/sentry_script_loader_test.dart index ca17bede26..36c585dd07 100644 --- a/flutter/test/web/sentry_script_loader_test.dart +++ b/flutter/test/web/sentry_script_loader_test.dart @@ -1,5 +1,5 @@ @TestOn('browser') -library flutter_test; +library; import 'package:flutter_test/flutter_test.dart'; import 'package:sentry_flutter/src/web/script_loader/script_dom_api.dart'; diff --git a/flutter/test/web/sentry_script_loader_tt_custom_test.dart b/flutter/test/web/sentry_script_loader_tt_custom_test.dart index 19f8601b14..9b53476dd4 100644 --- a/flutter/test/web/sentry_script_loader_tt_custom_test.dart +++ b/flutter/test/web/sentry_script_loader_tt_custom_test.dart @@ -1,5 +1,5 @@ @TestOn('browser') -library flutter_test; +library; import 'package:flutter_test/flutter_test.dart'; import 'package:sentry_flutter/src/web/script_loader/sentry_script_loader.dart'; diff --git a/flutter/test/web/sentry_script_loader_tt_forbidden_test.dart b/flutter/test/web/sentry_script_loader_tt_forbidden_test.dart index 29123caad2..e64c67b5c8 100644 --- a/flutter/test/web/sentry_script_loader_tt_forbidden_test.dart +++ b/flutter/test/web/sentry_script_loader_tt_forbidden_test.dart @@ -1,5 +1,5 @@ @TestOn('browser') -library flutter_test; +library; import 'package:flutter_test/flutter_test.dart'; import 'package:sentry_flutter/src/web/script_loader/sentry_script_loader.dart'; diff --git a/flutter/test/web/sentry_web_test.dart b/flutter/test/web/sentry_web_test.dart index 337183eff9..9fd73a56f8 100644 --- a/flutter/test/web/sentry_web_test.dart +++ b/flutter/test/web/sentry_web_test.dart @@ -1,5 +1,5 @@ @TestOn('browser') -library flutter_test; +library; import 'dart:typed_data'; diff --git a/hive/lib/sentry_hive.dart b/hive/lib/sentry_hive.dart index 03be720ca1..740ae6a1bf 100644 --- a/hive/lib/sentry_hive.dart +++ b/hive/lib/sentry_hive.dart @@ -1,4 +1,4 @@ -library sentry_hive; +library; import 'package:meta/meta.dart'; import 'package:hive/hive.dart'; diff --git a/hive/pubspec.yaml b/hive/pubspec.yaml index 309d4e9b24..bcb532f767 100644 --- a/hive/pubspec.yaml +++ b/hive/pubspec.yaml @@ -6,7 +6,7 @@ repository: https://github.com/getsentry/sentry-dart issue_tracker: https://github.com/getsentry/sentry-dart/issues environment: - sdk: '>=2.17.0 <4.0.0' + sdk: '>=3.5.0 <4.0.0' platforms: android: diff --git a/isar/lib/sentry_isar.dart b/isar/lib/sentry_isar.dart index 75e63c47ea..ca3d24ed45 100644 --- a/isar/lib/sentry_isar.dart +++ b/isar/lib/sentry_isar.dart @@ -1,4 +1,4 @@ -library sentry_isar; +library; export 'src/sentry_isar.dart'; export 'src/sentry_isar_collection.dart'; diff --git a/isar/pubspec.yaml b/isar/pubspec.yaml index bf2e2acea9..84203d230d 100644 --- a/isar/pubspec.yaml +++ b/isar/pubspec.yaml @@ -6,8 +6,8 @@ repository: https://github.com/getsentry/sentry-dart issue_tracker: https://github.com/getsentry/sentry-dart/issues environment: - sdk: '>=2.17.0 <4.0.0' - flutter: '>=3.3.0' + sdk: '>=3.5.0 <4.0.0' + flutter: '>=3.24.0' platforms: android: diff --git a/logging/lib/sentry_logging.dart b/logging/lib/sentry_logging.dart index 9b56c3f433..236f075583 100644 --- a/logging/lib/sentry_logging.dart +++ b/logging/lib/sentry_logging.dart @@ -1,3 +1,3 @@ -library sentry_logging; +library; export 'src/logging_integration.dart'; diff --git a/logging/pubspec.yaml b/logging/pubspec.yaml index 087d418899..7323af9c24 100644 --- a/logging/pubspec.yaml +++ b/logging/pubspec.yaml @@ -7,7 +7,7 @@ issue_tracker: https://github.com/getsentry/sentry-dart/issues documentation: https://docs.sentry.io/platforms/dart/integrations/logging/ environment: - sdk: '>=2.17.0 <4.0.0' + sdk: '>=3.5.0 <4.0.0' platforms: android: diff --git a/logging/test/version_test.dart b/logging/test/version_test.dart index 316a1caaff..b9e5d69077 100644 --- a/logging/test/version_test.dart +++ b/logging/test/version_test.dart @@ -1,5 +1,5 @@ @TestOn('vm') -library dart_test; +library; import 'dart:io'; diff --git a/min_version_test/android/app/build.gradle b/min_version_test/android/app/build.gradle index f183f2bfd5..2286767d8b 100644 --- a/min_version_test/android/app/build.gradle +++ b/min_version_test/android/app/build.gradle @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 33 + compileSdkVersion 34 ndkVersion '21.4.7075529' compileOptions { @@ -48,8 +48,8 @@ android { applicationId "com.example.minversiontest" // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. - minSdkVersion 19 - targetSdkVersion 33 + minSdkVersion flutter.minSdkVersion + targetSdkVersion 34 versionCode flutterVersionCode.toInteger() versionName flutterVersionName diff --git a/min_version_test/pubspec.yaml b/min_version_test/pubspec.yaml index e8e76dc9df..49a693a6cb 100644 --- a/min_version_test/pubspec.yaml +++ b/min_version_test/pubspec.yaml @@ -18,8 +18,8 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: '2.17.0' - flutter: '3.0.0' + sdk: '3.5.0' + flutter: '3.24.0' # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions diff --git a/sqflite/lib/sentry_sqflite.dart b/sqflite/lib/sentry_sqflite.dart index 770831fb5b..a09ff17490 100644 --- a/sqflite/lib/sentry_sqflite.dart +++ b/sqflite/lib/sentry_sqflite.dart @@ -1,4 +1,4 @@ -library sentry_sqflite; +library; export 'src/sentry_database.dart'; export 'src/sentry_sqflite.dart'; diff --git a/sqflite/pubspec.yaml b/sqflite/pubspec.yaml index 7eba5a4d78..2caa5413af 100644 --- a/sqflite/pubspec.yaml +++ b/sqflite/pubspec.yaml @@ -6,8 +6,8 @@ repository: https://github.com/getsentry/sentry-dart issue_tracker: https://github.com/getsentry/sentry-dart/issues environment: - sdk: '>=2.17.0 <4.0.0' - flutter: '>=3.3.0' # matching sqflite + sdk: '>=3.5.0 <4.0.0' + flutter: '>=3.24.0' platforms: android: diff --git a/sqflite/test/sentry_batch_test.dart b/sqflite/test/sentry_batch_test.dart index 50dc469ab3..974b8e2c04 100644 --- a/sqflite/test/sentry_batch_test.dart +++ b/sqflite/test/sentry_batch_test.dart @@ -1,5 +1,5 @@ @TestOn('vm') -library sqflite_test; +library; import 'package:sentry/sentry.dart'; import 'package:sentry_sqflite/sentry_sqflite.dart'; diff --git a/sqflite/test/sentry_database_test.dart b/sqflite/test/sentry_database_test.dart index b97f97784e..db59e9a940 100644 --- a/sqflite/test/sentry_database_test.dart +++ b/sqflite/test/sentry_database_test.dart @@ -1,5 +1,5 @@ @TestOn('vm') -library sqflite_test; +library; import 'package:sentry/sentry.dart'; import 'package:sentry/src/sentry_tracer.dart'; diff --git a/sqflite/test/sentry_sqflite_database_factory_dart_test.dart b/sqflite/test/sentry_sqflite_database_factory_dart_test.dart index 38bc23d404..d25ae1144d 100644 --- a/sqflite/test/sentry_sqflite_database_factory_dart_test.dart +++ b/sqflite/test/sentry_sqflite_database_factory_dart_test.dart @@ -1,5 +1,5 @@ @TestOn('vm') -library sqflite_test; +library; import 'package:sentry/sentry.dart'; import 'package:sentry/src/sentry_tracer.dart'; diff --git a/sqflite/test/sentry_sqflite_test.dart b/sqflite/test/sentry_sqflite_test.dart index f54cfda980..bae90f97d5 100644 --- a/sqflite/test/sentry_sqflite_test.dart +++ b/sqflite/test/sentry_sqflite_test.dart @@ -1,5 +1,5 @@ @TestOn('vm') -library sqflite_test; +library; import 'package:sentry/sentry.dart'; import 'package:sentry_sqflite/sentry_sqflite.dart'; diff --git a/sqflite/test/version_test.dart b/sqflite/test/version_test.dart index 98e02ca499..01764f33f5 100644 --- a/sqflite/test/version_test.dart +++ b/sqflite/test/version_test.dart @@ -1,5 +1,5 @@ @TestOn('vm') -library sqflite_test; +library; import 'dart:io';