mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-11-30 09:47:43 +03:00
26 lines
564 B
Dart
26 lines
564 B
Dart
import 'package:freezed_annotation/freezed_annotation.dart';
|
|
|
|
part 'models.freezed.dart';
|
|
|
|
@freezed
|
|
class Version with _$Version {
|
|
const Version._();
|
|
const factory Version(int major, int minor, int patch) = _Version;
|
|
|
|
factory Version.fromJson(List<dynamic> values) {
|
|
return Version(values[0], values[1], values[2]);
|
|
}
|
|
|
|
List<dynamic> toJson() => [major, minor, patch];
|
|
|
|
@override
|
|
String toString() {
|
|
return '$major.$minor.$patch';
|
|
}
|
|
}
|
|
|
|
@freezed
|
|
class Pair<T1, T2> with _$Pair<T1, T2> {
|
|
factory Pair(T1 first, T2 second) = _Pair<T1, T2>;
|
|
}
|