BuildInfoData.fromMillisecondsSinceEpoch constructor

BuildInfoData.fromMillisecondsSinceEpoch({
  1. int? buildDate,
  2. int? installDate,
  3. bool isUtc = false,
})

Constructs a new BuildInfoData instance with the given millisecondsSinceEpoch.

If isUtc is false then the date is in the local time zone.

Implementation

factory BuildInfoData.fromMillisecondsSinceEpoch({
  int? buildDate,
  int? installDate,
  bool isUtc = false,
}) {
  final buildDateTime = buildDate == null
      ? null
      : DateTime.fromMillisecondsSinceEpoch(
          buildDate,
          isUtc: isUtc,
        );

  final installDateTime = installDate == null
      ? null
      : DateTime.fromMillisecondsSinceEpoch(
          installDate,
          isUtc: isUtc,
        );

  return BuildInfoData(
    buildDate: buildDateTime,
    installDate: installDateTime,
  );
}