builder method
Widget
builder(
- FlutterErrorDetails details, {
- ParagraphStyle? paragraphStyle,
- TextStyle? textStyle,
- EdgeInsets? padding,
- double? minimumWidth,
- Color? backgroundColor,
- CustomPainter? customPainter,
Implementation
Widget builder(
FlutterErrorDetails details, {
i.ParagraphStyle? paragraphStyle,
i.TextStyle? textStyle,
EdgeInsets? padding,
double? minimumWidth,
Color? backgroundColor,
CustomPainter? customPainter,
}) {
String? message;
try {
//
message = '\n\n${details.exception}\n\n';
if (details.stack != null && stackTrace != null && stackTrace!) {
//
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 _ErrorRenderObjectWidget(
message: message,
error: details.exception,
paragraphStyle: paragraphStyle ?? this.paragraphStyle,
textStyle: textStyle ?? this.textStyle,
padding: padding ?? this.padding,
minimumWidth: minimumWidth ?? this.minimumWidth,
backgroundColor:
backgroundColor ?? this.backgroundColor ?? const Color(0xFFFFFFFF),
);
}