Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@abdelaziz-mahdy
Copy link
Contributor

it should fix #301, but i dont have a way to be 100 % sure, since it didnt fail to compile for me without it

Comment on lines 7 to 26
Future<R?> runTalkerZonedGuarded<R>(Talker talker, R Function() body,
void Function(Object error, StackTrace stack) onError,
{Map<Object?, Object?>? zoneValues,
ZoneSpecification? zoneSpecification,
bool catchFlutterErrors = true}) async {
_setupErrorHooks(talker, catchFlutterErrors: catchFlutterErrors);
return runZonedGuarded<R>(body, (dynamic error, StackTrace stackTrace) {
onError(error, stackTrace);
_reportError(error, stackTrace, talker);
}, zoneValues: zoneValues, zoneSpecification: zoneSpecification);
}

void _reportError(
dynamic error,
dynamic stackTrace,
Talker talker, {
FlutterErrorDetails? errorDetails,
}) async {
talker.error("Unhandled Exception", error, stackTrace);
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this code is same for io and web realizations
Can we separate only _setupErrorHooks method to avoid repeating ща the code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i had to expose everything, so it can be used by the other files, i hope thats okay

i couldnt get it to work without exposing them

@Frezyx
Copy link
Owner

Frezyx commented Jan 3, 2025

Hello @abdelaziz-mahdy !
Thank you for this contribution ❤️

Can you fix review issues before we merge this PR ?

@Frezyx Frezyx changed the title fix wasm compilation Fix wasm compilation Jan 4, 2025
@Frezyx Frezyx changed the title Fix wasm compilation Add support WASM for Flutter Web Jan 4, 2025
@Frezyx Frezyx merged commit f8945fa into Frezyx:master Jan 4, 2025
1 check passed
@Frezyx Frezyx added talker_flutter Related to talker_flutter package web Related to Flutter web, WASM and JS interop labels Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

talker_flutter Related to talker_flutter package web Related to Flutter web, WASM and JS interop

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support WASM for Flutter Web

2 participants