From 0c32adfc98a4779cb1f0872e870b211e560b1e26 Mon Sep 17 00:00:00 2001 From: Manoel Aranda Neto Date: Tue, 24 Jan 2023 15:17:06 -0300 Subject: [PATCH 1/5] Fix file package min version --- .github/workflows/file.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/file.yml b/.github/workflows/file.yml index 3889deac24..05640b1675 100644 --- a/.github/workflows/file.yml +++ b/.github/workflows/file.yml @@ -31,8 +31,8 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - # removing beta because of Dart 2.19.0 - sdk: [stable] + # removing stable and beta because of Dart 2.19.0 + sdk: [2.18.6] steps: - uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d # pin@v1 with: From 826e46767b7fa8566adaba9ab32c07afdb5da4b2 Mon Sep 17 00:00:00 2001 From: Manoel Aranda Neto Date: Wed, 25 Jan 2023 08:52:54 -0300 Subject: [PATCH 2/5] sentry_file now requires Dart >= 2.19 --- .github/workflows/file.yml | 3 +-- CHANGELOG.md | 6 ++++++ file/lib/src/sentry_file.dart | 8 ++++---- file/pubspec.yaml | 3 +-- min_version_test/lib/main.dart | 5 +---- min_version_test/pubspec.yaml | 3 --- 6 files changed, 13 insertions(+), 15 deletions(-) diff --git a/.github/workflows/file.yml b/.github/workflows/file.yml index 05640b1675..307ec0c3c8 100644 --- a/.github/workflows/file.yml +++ b/.github/workflows/file.yml @@ -31,8 +31,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - # removing stable and beta because of Dart 2.19.0 - sdk: [2.18.6] + sdk: [stable, beta] steps: - uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d # pin@v1 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index fdb72fa13d..ad098a5796 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## Unreleased + +### Breaking Changes: + +- sentry_file now requires Dart >= 2.19 ([#1237](https://github.com/getsentry/sentry-dart/pull/1237)) + ## 6.18.3 ### Fixes diff --git a/file/lib/src/sentry_file.dart b/file/lib/src/sentry_file.dart index 1ce23bc2c8..80792e52a7 100644 --- a/file/lib/src/sentry_file.dart +++ b/file/lib/src/sentry_file.dart @@ -53,17 +53,17 @@ class SentryFile implements File { } @override - Future create({bool recursive = false}) { + Future create({bool recursive = false, bool exclusive = false}) { return _wrap( - () async => _file.create(recursive: recursive), + () async => _file.create(recursive: recursive, exclusive: exclusive), 'file.write', ); } @override - void createSync({bool recursive = false}) { + void createSync({bool recursive = false, bool exclusive = false}) { return _wrapSync( - () => _file.createSync(recursive: recursive), + () => _file.createSync(recursive: recursive, exclusive: exclusive), 'file.write', ); } diff --git a/file/pubspec.yaml b/file/pubspec.yaml index f62b2dd1ff..8c5ada4231 100644 --- a/file/pubspec.yaml +++ b/file/pubspec.yaml @@ -6,8 +6,7 @@ repository: https://github.com/getsentry/sentry-dart issue_tracker: https://github.com/getsentry/sentry-dart/issues environment: - # <2.19 because of https://github.com/dart-lang/sdk/issues/49647 breaking change - sdk: '>=2.12.0 <2.19.0' + sdk: '>=2.19.0 <3.0.0' dependencies: sentry: 6.18.3 diff --git a/min_version_test/lib/main.dart b/min_version_test/lib/main.dart index e70e318bf2..cb2371033b 100644 --- a/min_version_test/lib/main.dart +++ b/min_version_test/lib/main.dart @@ -5,11 +5,9 @@ import 'dart:io' if (dart.library.html) 'dart:html'; import 'package:logging/logging.dart'; import 'package:dio/dio.dart'; -import 'package:sentry/sentry.dart'; import 'package:sentry_flutter/sentry_flutter.dart'; import 'package:sentry_dio/sentry_dio.dart'; import 'package:sentry_logging/sentry_logging.dart'; -import 'package:sentry_file/sentry_file.dart'; // ATTENTION: Change the DSN below with your own to see the events in Sentry. Get one at sentry.io const String _exampleDsn = @@ -116,9 +114,8 @@ class _MyHomePageState extends State { try { final file = File('response.txt'); - final sentryFile = file.sentryTrace(); final response = await dio.get('https://flutter.dev/'); - await sentryFile.writeAsString(response.data ?? 'no response'); + await file.writeAsString(response.data ?? 'no response'); await transaction.finish(status: SpanStatus.ok()); } catch (exception, stackTrace) { diff --git a/min_version_test/pubspec.yaml b/min_version_test/pubspec.yaml index 4ecca9a599..368deb46d7 100644 --- a/min_version_test/pubspec.yaml +++ b/min_version_test/pubspec.yaml @@ -34,7 +34,6 @@ dependencies: sentry_flutter: sentry_dio: sentry_logging: - sentry_file: dio: ^4.0.0 logging: ^1.0.0 @@ -53,8 +52,6 @@ dependency_overrides: path: ../dio sentry_logging: path: ../logging - sentry_file: - path: ../file # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec From d1cd75ceb073d5ff5b82158f0aac6b83adf97caf Mon Sep 17 00:00:00 2001 From: Manoel Aranda Neto Date: Wed, 25 Jan 2023 08:53:09 -0300 Subject: [PATCH 3/5] id --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad098a5796..ba7265ed22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ ### Breaking Changes: -- sentry_file now requires Dart >= 2.19 ([#1237](https://github.com/getsentry/sentry-dart/pull/1237)) +- sentry_file now requires Dart >= 2.19 ([#1240](https://github.com/getsentry/sentry-dart/pull/1240)) ## 6.18.3 From dddfb79cb3c5691be143c1732240e3e685b57c58 Mon Sep 17 00:00:00 2001 From: Manoel Aranda Neto Date: Wed, 25 Jan 2023 08:58:40 -0300 Subject: [PATCH 4/5] remove beta --- .github/workflows/file.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/file.yml b/.github/workflows/file.yml index 307ec0c3c8..da046ac601 100644 --- a/.github/workflows/file.yml +++ b/.github/workflows/file.yml @@ -31,7 +31,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - sdk: [stable, beta] + sdk: [stable] steps: - uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d # pin@v1 with: From 1ba21f30b57667f00c01b59f08f8329da6c97509 Mon Sep 17 00:00:00 2001 From: Manoel Aranda Neto Date: Wed, 25 Jan 2023 09:06:00 -0300 Subject: [PATCH 5/5] fix lints --- flutter/example/lib/main.dart | 4 ++++ flutter/example/lib/user_feedback_dialog.dart | 2 ++ 2 files changed, 6 insertions(+) diff --git a/flutter/example/lib/main.dart b/flutter/example/lib/main.dart index fe577b4514..b1f564c813 100644 --- a/flutter/example/lib/main.dart +++ b/flutter/example/lib/main.dart @@ -330,6 +330,7 @@ class MainScaffold extends StatelessWidget { ElevatedButton( onPressed: () async { final id = await Sentry.captureMessage('UserFeedback'); + // ignore: use_build_context_synchronously await showDialog( context: context, builder: (context) { @@ -547,6 +548,7 @@ Future makeWebRequest(BuildContext context) async { await transaction.finish(status: const SpanStatus.ok()); + // ignore: use_build_context_synchronously await showDialog( context: context, // gets tracked if using SentryNavigatorObserver @@ -601,6 +603,7 @@ Future makeWebRequestWithDio(BuildContext context) async { await span.finish(); } + // ignore: use_build_context_synchronously await showDialog( context: context, // gets tracked if using SentryNavigatorObserver @@ -633,6 +636,7 @@ Future showDialogWithTextAndImage(BuildContext context) async { ); final text = await DefaultAssetBundle.of(context).loadString('assets/lorem-ipsum.txt'); + // ignore: use_build_context_synchronously await showDialog( context: context, // gets tracked if using SentryNavigatorObserver diff --git a/flutter/example/lib/user_feedback_dialog.dart b/flutter/example/lib/user_feedback_dialog.dart index 6eac0db7ba..19340d3611 100644 --- a/flutter/example/lib/user_feedback_dialog.dart +++ b/flutter/example/lib/user_feedback_dialog.dart @@ -34,6 +34,7 @@ class _UserFeedbackDialogState extends State { Text( "It looks like we're having some internal issues.", textAlign: TextAlign.center, + // ignore: deprecated_member_use style: Theme.of(context).textTheme.headline6, ), const SizedBox(height: 4), @@ -43,6 +44,7 @@ class _UserFeedbackDialogState extends State { textAlign: TextAlign.center, style: Theme.of(context) .textTheme + // ignore: deprecated_member_use .subtitle1 ?.copyWith(color: Colors.grey), ),