report static method

String report({
  1. List<RxSession>? sessions,
  2. SessionId? sessionId,
  3. String? userAgent,
  4. MyUser? myUser,
  5. DeviceToken? token,
  6. bool? pushNotifications,
})

Returns a report of the technical information and Logs.

Implementation

static String report({
  List<RxSession>? sessions,
  SessionId? sessionId,
  String? userAgent,
  MyUser? myUser,
  DeviceToken? token,
  bool? pushNotifications,
}) {
  final Session? session = sessions
      ?.firstWhereOrNull((e) => e.session.value.id == sessionId)
      ?.session
      .value;

  return '''
================ Report ================

Created at: ${DateTime.now().toUtc()}
Application: ${Pubspec.ref}
User-Agent: $userAgent
Is PWA: ${CustomSafeArea.isPwa}

MyUser:
${myUser?.toJson()}

SessionId:
$sessionId

Session:
${session?.toJson()}

Push Notifications are considered active:
$pushNotifications

Token:
$token

================= Logs =================

${Log.logs.map((e) => '[${e.at.toUtc().toStamp}] [${e.level.name}] ${e.text}').join('\n')}

========================================
''';
}