gecko/lib/models/walletData.dart

41 lines
796 B
Dart

import 'package:hive_flutter/hive_flutter.dart';
part 'walletData.g.dart';
@HiveType(typeId: 0)
class WalletData extends HiveObject {
@HiveField(0)
int chest;
@HiveField(1)
int number;
@HiveField(2)
String name;
@HiveField(3)
int derivation;
@HiveField(4)
String imageName;
WalletData(
{this.chest, this.number, this.name, this.derivation, this.imageName});
// representation of WalletData when debugging
@override
String toString() {
return this.name;
}
// creates the ':'-separated string from the WalletData
String inLine() {
return "${this.chest}:${this.number}:${this.name}:${this.derivation}:${this.imageName}";
}
// returns only the id part of the ':'-separated string
List id() {
return [this.chest, this.number];
}
}