Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use PlatformDispatcher.onError instead of custom zone starting with Flutter 3.3 #232

Open
HosamHasanRamadan opened this issue Sep 9, 2022 · 1 comment · May be fixed by #234
Open

Use PlatformDispatcher.onError instead of custom zone starting with Flutter 3.3 #232

HosamHasanRamadan opened this issue Sep 9, 2022 · 1 comment · May be fixed by #234
Assignees
Labels
enhancement New feature or request New issue New issue which has not been checked yet

Comments

@HosamHasanRamadan
Copy link

Starting with Flutter 3.3, apps should now use PlatformDispatcher.onError instead of running the app in a custom zone to catch errors. I believe catcher is using a custom zone to catch errors.

Release notes: https://medium.com/flutter/whats-new-in-flutter-3-3-893c7b9af1ff#:~:text=In%20this%20release%2C%20instead%20of%20using%20a%20custom%20Zone%2C%20you%20should%20catch%20all%20errors%20and%20exceptions%20by%20setting%20the%20PlatformDispatcher.onError%20callback.

The error handling page was also updated to reflect these changes: https://docs.flutter.dev/testing/errors

@HosamHasanRamadan HosamHasanRamadan added enhancement New feature or request New issue New issue which has not been checked yet labels Sep 9, 2022
@calcitem
Copy link

calcitem commented Oct 6, 2022

We can use

calcitem/Sanmill@9de1aff

PlatformDispatcher.instance.onError = (error, stack) {
      
        Catcher.reportCheckedError(error, stack);
     
      return true;
    };

@ThexXTURBOXx ThexXTURBOXx linked a pull request Apr 17, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request New issue New issue which has not been checked yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants