stack_wallet/lib/models/isar/models/address_label.dart
2023-05-27 00:21:16 +03:00

46 lines
1,009 B
Dart

/*
* This file is part of Stack Wallet.
*
* Copyright (c) 2023 Cypher Stack
* All Rights Reserved.
* The code is distributed under GPLv3 license, see LICENSE file for details.
* Generated by Cypher Stack on 2023-05-26
*
*/
import 'package:isar/isar.dart';
part 'address_label.g.dart';
@Collection()
class AddressLabel {
AddressLabel({
required this.walletId,
required this.addressString,
required this.value,
required this.tags,
});
Id id = Isar.autoIncrement;
@Index()
late final String walletId;
@Index(unique: true, composite: [CompositeIndex("walletId")])
late final String addressString;
late final String value;
late final List<String>? tags;
AddressLabel copyWith({String? label, Id? id, List<String>? tags}) {
final addressLabel = AddressLabel(
walletId: walletId,
addressString: addressString,
value: label ?? value,
tags: tags ?? this.tags,
);
addressLabel.id = id ?? this.id;
return addressLabel;
}
}