yubioath-flutter/lib/app/models.dart
2022-01-19 11:00:37 +01:00

39 lines
955 B
Dart
Executable File

import 'package:flutter/material.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import '../../management/models.dart';
part 'models.freezed.dart';
enum SubPage { authenticator, yubikey }
@freezed
class YubiKeyData with _$YubiKeyData {
factory YubiKeyData(DeviceNode node, String name, DeviceInfo info) =
_YubiKeyData;
}
@freezed
class DeviceNode with _$DeviceNode {
factory DeviceNode.usbYubiKey(
List<String> path, String name, int pid, DeviceInfo info) =
UsbYubiKeyNode;
factory DeviceNode.nfcReader(List<String> path, String name) = NfcReaderNode;
}
@freezed
class MenuAction with _$MenuAction {
factory MenuAction(
{required String text,
required Icon icon,
void Function()? action}) = _MenuAction;
}
@freezed
class WindowState with _$WindowState {
factory WindowState({
required bool focused,
required bool visible,
required bool active,
}) = _WindowState;
}