mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-11-21 10:24:15 +01:00
28 lines
626 B
Dart
28 lines
626 B
Dart
import 'package:flutter/foundation.dart';
|
|
import 'package:hive/hive.dart';
|
|
import 'package:cake_wallet/src/domain/common/crypto_currency.dart';
|
|
|
|
part 'contact.g.dart';
|
|
|
|
@HiveType(typeId: 0)
|
|
class Contact extends HiveObject {
|
|
Contact({@required this.name, @required this.address, CryptoCurrency type})
|
|
: raw = type?.raw;
|
|
|
|
static const boxName = 'Contacts';
|
|
|
|
@HiveField(0)
|
|
String name;
|
|
|
|
@HiveField(1)
|
|
String address;
|
|
|
|
@HiveField(2)
|
|
int raw;
|
|
|
|
CryptoCurrency get type => CryptoCurrency.deserialize(raw: raw);
|
|
|
|
void updateCryptoCurrency({@required CryptoCurrency currency}) =>
|
|
raw = currency.raw;
|
|
}
|