selfprivacy.org.app/lib/logic/models/server_details.dart

38 lines
692 B
Dart
Raw Normal View History

2021-01-06 17:35:57 +00:00
import 'package:flutter/widgets.dart';
import 'package:hive/hive.dart';
part 'server_details.g.dart';
@HiveType(typeId: 2)
class HetznerServerDetails {
HetznerServerDetails({
@required this.ip4,
@required this.id,
2021-01-19 12:05:40 +00:00
@required this.createTime,
this.startTime,
2021-01-06 17:35:57 +00:00
});
@HiveField(0)
final String ip4;
@HiveField(1)
final int id;
2021-01-19 12:05:40 +00:00
@HiveField(3)
final DateTime createTime;
2021-01-21 21:01:42 +00:00
@HiveField(2)
final DateTime startTime;
2021-01-19 12:05:40 +00:00
HetznerServerDetails copyWith({DateTime startTime}) {
return HetznerServerDetails(
startTime: startTime ?? this.startTime,
createTime: createTime,
id: id,
ip4: ip4,
);
}
2021-01-06 17:35:57 +00:00
String toString() => id.toString();
}