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;
|
|
|
|
|
|
|
|
@HiveField(2)
|
2021-01-06 19:25:53 +00:00
|
|
|
final DateTime startTime;
|
2021-01-06 17:35:57 +00:00
|
|
|
|
2021-01-19 12:05:40 +00:00
|
|
|
@HiveField(3)
|
|
|
|
final DateTime createTime;
|
|
|
|
|
|
|
|
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();
|
|
|
|
}
|