selfprivacy.org.app/lib/logic/models/hive/server_domain.dart

35 lines
560 B
Dart
Raw Normal View History

2021-01-06 17:35:57 +00:00
import 'package:hive/hive.dart';
part 'server_domain.g.dart';
2021-01-06 17:35:57 +00:00
@HiveType(typeId: 3)
class ServerDomain {
ServerDomain({
2021-03-26 13:38:39 +00:00
required this.domainName,
required this.zoneId,
required this.provider,
2021-03-26 13:38:39 +00:00
});
2021-01-06 17:35:57 +00:00
@HiveField(0)
2021-03-26 13:38:39 +00:00
final String domainName;
2021-01-06 17:35:57 +00:00
@HiveField(1)
2021-03-26 13:38:39 +00:00
final String zoneId;
2021-01-06 17:35:57 +00:00
@HiveField(2, defaultValue: DnsProvider.Cloudflare)
final DnsProvider provider;
2021-01-06 17:35:57 +00:00
@override
String toString() {
2021-01-21 07:35:38 +00:00
return '$domainName: $zoneId';
2021-01-06 17:35:57 +00:00
}
}
@HiveType(typeId: 100)
enum DnsProvider {
@HiveField(0)
Unknown,
@HiveField(1)
Cloudflare,
}