Client constructor Null safety

Client(
  1. {required ClientOptions options,
  2. String overrideSession = ""}
)

the main client object

Implementation

Client({
  required ClientOptions options,
  String overrideSession = "",
}) {
  _clientOptions = options;

  Logger.root.level = _clientOptions.logLevel;
  Logger.root.onRecord.listen((record) {
    print(
        '${record.time.toString().split(" ")[1].split(".")[0]} [${record.level.name}] ${record.message}');
  });

  /// initialize http object
  http = HTTP(
    client: this,
  );

  /// initialize auth object
  auth = FortniteAuth(this);

  /// initialize common core profile object
  commonCore = CommonCoreProfile(this);

  /// initialize campaign profile object
  campaign = CampaignProfile(this);

  if (overrideSession != "") {
    session = overrideSession;
  }

  log(LogLevel.info, "Initialized fortnite client object [$accountId]");
}