printError static method

dynamic printError(
  1. dynamic details
)

Implementation

static printError(details) {
  //operating system information
  if (kDebugMode) {
    print("Operating System : ${Platform.operatingSystem}");
    print("Operating System Version : ${Platform.operatingSystemVersion}");
    print("local host name : ${Platform.localHostname}");
    print("Number of processors : ${Platform.numberOfProcessors} ");
    print("Operating version ${Platform.version}");

    //screen size and pixel info
    print("Pixel Ratio :${window.devicePixelRatio}");
    print("Height :${window.physicalSize.height}");
    print("Width :${window.physicalSize.width}");
    print("Aspect Ratio :${window.physicalSize.aspectRatio}");
    print("Brightness :${window.platformBrightness}");
    print("${window.padding}");

    //stack trace
    print("\n+++++++++++++++ Stack Trace \n\n ${StackTrace.current}");

    // print("++++++++ Error Message");
    // print("exception : ${details.exception}\n");
    // print("library : ${details.library}\n");
    // print(WidgetsBinding.instance.renderViewElement!.toStringDeep());

    print("\n\n+++++++++++++++ Error message \n\n ${TextTreeRenderer(
      maxDescendentsTruncatableNode: 5,
    )
        .render(details.toDiagnosticsNode(style: DiagnosticsTreeStyle.error))
        .trimRight()} ");
  }
}