rollbar / rollbar-flutter

Rollbar for Dart and Flutter
https://docs.rollbar.com/docs/flutter
MIT License
21 stars 27 forks source link

Fix incorrect usage of WidgetFlutterBindings.ensureInitialized() #100

Closed matux closed 1 year ago

matux commented 1 year ago

Description of the change

Fixes some deprecation issues, and an incorrect usage of WidgetFlutterBindings.ensureInitialized() on Flutter 3.10.x:

The Flutter bindings were initialized in a different zone than is now being used. This will likely cause confusion and bugs as any zone-specific configuration will inconsistently use the configuration of the original binding initialization zone or this zone based on hard-to-predict factors such as which zone was active when a particular callback was set.
It is important to use the same zone when calling ensureInitialized on the binding as when calling runApp later.

This was reported https://github.com/rollbar/rollbar-flutter/issues/90#issuecomment-1568424569 and https://github.com/rollbar/rollbar-flutter/issues/90#issuecomment-1569633188.

Type of change

Related issues

This is being partially tracked here: https://github.com/rollbar/rollbar-flutter/issues/90, but the issue itself is about something else, so this wouldn't close the issue.

Checklists

Development

Code review