builder method

Widget builder(
  1. FlutterErrorDetails details
)

Implementation

Widget builder(FlutterErrorDetails details) {
  String? message;
  try {
    //
    if (stackTrace != null && stackTrace!) {
      //
      message = 'ERROR\n\n${details.exception}\n\n';

      final stack = details.stack.toString().split('\n');

      final length = stack.length > 5 ? 5 : stack.length;

      final buffer = StringBuffer()..write(message);

      for (var i = 0; i < length; i++) {
        buffer.write('${stack[i]}\n');
      }
      message = buffer.toString();
    }
  } catch (e) {
    message = null;
  }
  return errorWidgetChild(
    details: details,
    message: message,
    paragraphStyle: paragraphStyle,
    textStyle: textStyle,
    padding: padding,
    minimumWidth: minimumWidth,
    backgroundColor: backgroundColor,
  );
}