Skip to content

Commit

Permalink
add missing override annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
vaind committed Sep 18, 2024
1 parent b0aa3ab commit fd2d073
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
28 changes: 28 additions & 0 deletions flutter/lib/src/native/c/sentry_native.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import 'utils.dart';
@internal
class SentryNative with SentryNativeSafeInvoker implements SentryNativeBinding {
DebugImage? _appDebugImage;
@override
final SentryFlutterOptions options;

@visibleForTesting
Expand All @@ -31,6 +32,7 @@ class SentryNative with SentryNativeSafeInvoker implements SentryNativeBinding {
void _logNotSupported(String operation) => options.logger(
SentryLevel.debug, 'SentryNative: $operation is not supported');

Check warning on line 33 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L32-L33

Added lines #L32 - L33 were not covered by tests

@override

Check warning on line 35 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L35

Added line #L35 was not covered by tests
FutureOr<void> init(Hub hub) {
if (!options.enableNativeCrashHandling) {
options.logger(

Check warning on line 38 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L37-L38

Added lines #L37 - L38 were not covered by tests
Expand Down Expand Up @@ -77,23 +79,30 @@ class SentryNative with SentryNativeSafeInvoker implements SentryNativeBinding {
}
}

@override

Check warning on line 82 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L82

Added line #L82 was not covered by tests
FutureOr<void> close() {
tryCatchSync('close', native.close);

Check warning on line 84 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L84

Added line #L84 was not covered by tests
}

@override

Check warning on line 87 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L87

Added line #L87 was not covered by tests
FutureOr<NativeAppStart?> fetchNativeAppStart() => null;

@override
bool get supportsCaptureEnvelope => false;

@override

Check warning on line 93 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L93

Added line #L93 was not covered by tests
FutureOr<void> captureEnvelope(
Uint8List envelopeData, bool containsUnhandledException) {
throw UnsupportedError('$SentryNative.captureEnvelope() is not suppurted');

Check warning on line 96 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L96

Added line #L96 was not covered by tests
}

@override

Check warning on line 99 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L99

Added line #L99 was not covered by tests
FutureOr<void> beginNativeFrames() {}

@override

Check warning on line 102 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L102

Added line #L102 was not covered by tests
FutureOr<NativeFrames?> endNativeFrames(SentryId id) => null;

@override

Check warning on line 105 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L105

Added line #L105 was not covered by tests
FutureOr<void> setUser(SentryUser? user) {
if (user == null) {
tryCatchSync('remove_user', native.remove_user);

Check warning on line 108 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L108

Added line #L108 was not covered by tests
Expand All @@ -105,24 +114,29 @@ class SentryNative with SentryNativeSafeInvoker implements SentryNativeBinding {
}
}

@override

Check warning on line 117 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L117

Added line #L117 was not covered by tests
FutureOr<void> addBreadcrumb(Breadcrumb breadcrumb) {
tryCatchSync('add_breadcrumb', () {
var cBreadcrumb = breadcrumb.toJson().toNativeValue(options.logger);
native.add_breadcrumb(cBreadcrumb);

Check warning on line 121 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L119-L121

Added lines #L119 - L121 were not covered by tests
});
}

@override

Check warning on line 125 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L125

Added line #L125 was not covered by tests
FutureOr<void> clearBreadcrumbs() {
_logNotSupported('clearing breadcrumbs');

Check warning on line 127 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L127

Added line #L127 was not covered by tests
}

@override
bool get supportsLoadContexts => false;

@override

Check warning on line 133 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L133

Added line #L133 was not covered by tests
FutureOr<Map<String, dynamic>?> loadContexts() {
_logNotSupported('loading contexts');

Check warning on line 135 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L135

Added line #L135 was not covered by tests
return null;
}

@override

Check warning on line 139 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L139

Added line #L139 was not covered by tests
FutureOr<void> setContexts(String key, dynamic value) {
tryCatchSync('set_context', () {
final cValue = dynamicToNativeValue(value, options.logger);

Check warning on line 142 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L141-L142

Added lines #L141 - L142 were not covered by tests
Expand All @@ -137,6 +151,7 @@ class SentryNative with SentryNativeSafeInvoker implements SentryNativeBinding {
});
}

@override

Check warning on line 154 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L154

Added line #L154 was not covered by tests
FutureOr<void> removeContexts(String key) {
tryCatchSync('remove_context', () {
final cKey = key.toNativeUtf8();
Expand All @@ -145,6 +160,7 @@ class SentryNative with SentryNativeSafeInvoker implements SentryNativeBinding {
});
}

@override

Check warning on line 163 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L163

Added line #L163 was not covered by tests
FutureOr<void> setExtra(String key, dynamic value) {
tryCatchSync('set_extra', () {
final cValue = dynamicToNativeValue(value, options.logger);

Check warning on line 166 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L165-L166

Added lines #L165 - L166 were not covered by tests
Expand All @@ -159,6 +175,7 @@ class SentryNative with SentryNativeSafeInvoker implements SentryNativeBinding {
});
}

@override

Check warning on line 178 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L178

Added line #L178 was not covered by tests
FutureOr<void> removeExtra(String key) {
tryCatchSync('remove_extra', () {
final cKey = key.toNativeUtf8();
Expand All @@ -167,6 +184,7 @@ class SentryNative with SentryNativeSafeInvoker implements SentryNativeBinding {
});
}

@override

Check warning on line 187 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L187

Added line #L187 was not covered by tests
FutureOr<void> setTag(String key, String value) {
tryCatchSync('set_tag', () {
final c = FreeableFactory();
Expand All @@ -175,6 +193,7 @@ class SentryNative with SentryNativeSafeInvoker implements SentryNativeBinding {
});
}

@override

Check warning on line 196 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L196

Added line #L196 was not covered by tests
FutureOr<void> removeTag(String key) {
tryCatchSync('remove_tag', () {
final cKey = key.toNativeUtf8();
Expand All @@ -183,21 +202,26 @@ class SentryNative with SentryNativeSafeInvoker implements SentryNativeBinding {
});
}

@override

Check warning on line 205 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L205

Added line #L205 was not covered by tests
int? startProfiler(SentryId traceId) =>
throw UnsupportedError("Not supported on this platform");

Check warning on line 207 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L207

Added line #L207 was not covered by tests

@override

Check warning on line 209 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L209

Added line #L209 was not covered by tests
FutureOr<void> discardProfiler(SentryId traceId) =>
throw UnsupportedError("Not supported on this platform");

Check warning on line 211 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L211

Added line #L211 was not covered by tests

@override

Check warning on line 213 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L213

Added line #L213 was not covered by tests
FutureOr<Map<String, dynamic>?> collectProfile(
SentryId traceId, int startTimeNs, int endTimeNs) =>
throw UnsupportedError("Not supported on this platform");

Check warning on line 216 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L216

Added line #L216 was not covered by tests

@override

Check warning on line 218 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L218

Added line #L218 was not covered by tests
FutureOr<int?> displayRefreshRate() {
_logNotSupported('collecting display refresh rate');

Check warning on line 220 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L220

Added line #L220 was not covered by tests
return null;
}

@override

Check warning on line 224 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L224

Added line #L224 was not covered by tests
FutureOr<List<DebugImage>?> loadDebugImages(SentryStackTrace stackTrace) =>
tryCatchAsync('get_module_list', () async {
final cImages = native.get_modules_list();

Check warning on line 227 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L226-L227

Added lines #L226 - L227 were not covered by tests
Expand Down Expand Up @@ -311,14 +335,18 @@ class SentryNative with SentryNativeSafeInvoker implements SentryNativeBinding {
return String.fromCharCodes(data);

Check warning on line 335 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L335

Added line #L335 was not covered by tests
}

@override

Check warning on line 338 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L338

Added line #L338 was not covered by tests
FutureOr<void> pauseAppHangTracking() {}

@override

Check warning on line 341 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L341

Added line #L341 was not covered by tests
FutureOr<void> resumeAppHangTracking() {}

@override

Check warning on line 344 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L344

Added line #L344 was not covered by tests
FutureOr<void> nativeCrash() {
Pointer.fromAddress(1).cast<Utf8>().toDartString();

Check warning on line 346 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L346

Added line #L346 was not covered by tests
}

@override

Check warning on line 349 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L349

Added line #L349 was not covered by tests
FutureOr<SentryId> captureReplay(bool isCrash) {
_logNotSupported('capturing replay');
return SentryId.empty();

Check warning on line 352 in flutter/lib/src/native/c/sentry_native.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/native/c/sentry_native.dart#L351-L352

Added lines #L351 - L352 were not covered by tests
Expand Down
2 changes: 2 additions & 0 deletions flutter/lib/src/native/sentry_native_channel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ class SentryNativeChannel
return (json != null) ? NativeAppStart.fromJson(json) : null;
}

@override
bool get supportsCaptureEnvelope => true;

@override
Expand All @@ -93,6 +94,7 @@ class SentryNativeChannel
'captureEnvelope', [envelopeData, containsUnhandledException]);
}

@override
bool get supportsLoadContexts => true;

@override
Expand Down

0 comments on commit fd2d073

Please sign in to comment.