NexoFlutterErrors class

Глобальная регистрация обработчиков ошибок Flutter (без UI).

После install перехватываются:

  • FlutterError.onError (ошибки рендеринга и assert в debug);
  • PlatformDispatcher.instance.onError (непойманные async-ошибки).

Дополнительно используйте runAppInZone, чтобы ловить ошибки в зоне.

Важно: WidgetsFlutterBinding.ensureInitialized и runApp должны вызываться в одной зоне. Оберните весь main (включая ensureInitialized, DI и runApp) в тело runAppInZone, либо не используйте зону вокруг runApp.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

install({required NexoLogger logger, NexoCrashReporter? crashReporter}) → void
Подключает глобальные хендлеры. Вызывайте один раз после WidgetsFlutterBinding.ensureInitialized в той же зоне, что и runApp (см. runAppInZone).
runAppInZone(Future<void> body()) → Future<void>
Оборачивает body в runZonedGuarded с отчётом в лог и NexoCrashReporter.
uninstall() → void
Снимает хендлеры (удобно в тестах).