error abstract method

void error(
  1. String message, {
  2. Object? error,
  3. StackTrace? stackTrace,
})

Logs a critical error message along with the associated error object and stack trace.

Use this when an operation fails completely or a caught exception needs to be explicitly tracked and handled.

Implementation

void error(String message, {Object? error, StackTrace? stackTrace});