handleError method
- Object error,
- StackTrace stackTrace
Implementation
void handleError(Object error, StackTrace stackTrace) {
showSnackBar("An error occurred: ${error.toString()}");
// You can log errors or send them to an analytics service here
}