2021-11-17 06:20:23 +01:00
|
|
|
import 'dart:io';
|
|
|
|
|
2021-11-07 04:23:05 +01:00
|
|
|
import 'package:hive_flutter/hive_flutter.dart';
|
|
|
|
|
2021-11-14 19:21:20 +01:00
|
|
|
part 'wallet_data.g.dart';
|
2021-11-07 04:23:05 +01:00
|
|
|
|
|
|
|
@HiveType(typeId: 0)
|
|
|
|
class WalletData extends HiveObject {
|
|
|
|
@HiveField(0)
|
|
|
|
int chest;
|
|
|
|
|
|
|
|
@HiveField(1)
|
|
|
|
int number;
|
|
|
|
|
|
|
|
@HiveField(2)
|
|
|
|
String name;
|
|
|
|
|
|
|
|
@HiveField(3)
|
|
|
|
int derivation;
|
|
|
|
|
2021-11-11 14:45:12 +01:00
|
|
|
@HiveField(4)
|
|
|
|
String imageName;
|
|
|
|
|
2021-11-17 06:20:23 +01:00
|
|
|
@HiveField(5)
|
|
|
|
File imageFile;
|
|
|
|
|
2021-11-11 14:45:12 +01:00
|
|
|
WalletData(
|
2021-11-17 06:20:23 +01:00
|
|
|
{this.chest,
|
|
|
|
this.number,
|
|
|
|
this.name,
|
|
|
|
this.derivation,
|
|
|
|
this.imageName,
|
|
|
|
this.imageFile});
|
2021-11-07 04:23:05 +01:00
|
|
|
|
|
|
|
// representation of WalletData when debugging
|
|
|
|
@override
|
|
|
|
String toString() {
|
2021-11-14 19:21:20 +01:00
|
|
|
return name;
|
2021-11-07 04:23:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// creates the ':'-separated string from the WalletData
|
|
|
|
String inLine() {
|
2021-11-14 19:21:20 +01:00
|
|
|
return "$chest:$number:$name:$derivation:$imageName";
|
2021-11-07 04:23:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// returns only the id part of the ':'-separated string
|
2021-11-17 06:20:23 +01:00
|
|
|
List<int> id() {
|
2021-11-14 19:21:20 +01:00
|
|
|
return [chest, number];
|
2021-11-07 04:23:05 +01:00
|
|
|
}
|
|
|
|
}
|