2020-01-04 19:31:52 +00:00
|
|
|
import 'package:cw_monero/structs/subaddress_row.dart';
|
|
|
|
|
|
|
|
class Subaddress {
|
|
|
|
Subaddress({this.id, this.address, this.label});
|
|
|
|
|
|
|
|
Subaddress.fromMap(Map map)
|
2020-01-08 12:26:34 +00:00
|
|
|
: this.id = map['id'] == null ? 0 : int.parse(map['id'] as String),
|
|
|
|
this.address = (map['address'] ?? '') as String,
|
|
|
|
this.label = (map['label'] ?? '') as String;
|
2020-01-04 19:31:52 +00:00
|
|
|
|
|
|
|
Subaddress.fromRow(SubaddressRow row)
|
|
|
|
: this.id = row.getId(),
|
|
|
|
this.address = row.getAddress(),
|
2020-09-30 18:23:15 +00:00
|
|
|
this.label = row.getId() == 0 &&
|
|
|
|
row.getLabel().toLowerCase() == 'Primary account'.toLowerCase()
|
|
|
|
? 'Primary address'
|
|
|
|
: row.getLabel();
|
2020-01-08 12:26:34 +00:00
|
|
|
|
|
|
|
final int id;
|
|
|
|
final String address;
|
|
|
|
final String label;
|
2020-01-04 19:31:52 +00:00
|
|
|
}
|