cake_wallet/cw_core/lib/enumerable_item.dart

17 lines
391 B
Dart
Raw Normal View History

import 'package:flutter/foundation.dart';
abstract class EnumerableItem<T> {
2022-10-12 17:09:57 +00:00
const EnumerableItem({required this.title, required this.raw});
final T raw;
final String title;
@override
String toString() => title;
}
mixin Serializable<T> on EnumerableItem<T> {
2022-10-12 17:09:57 +00:00
static Serializable deserialize<T>({required T raw}) => throw Exception('Unimplemented');
T serialize() => raw;
}