mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 17:57:40 +00:00
update isCancelled flag name to be consistent with other isar model bool values
This commit is contained in:
parent
25a60920dd
commit
30d8f8b810
5 changed files with 66 additions and 66 deletions
|
@ -34,7 +34,7 @@ class Transaction {
|
||||||
|
|
||||||
late int? height;
|
late int? height;
|
||||||
|
|
||||||
late bool cancelled;
|
late bool isCancelled;
|
||||||
|
|
||||||
late String? slateId;
|
late String? slateId;
|
||||||
|
|
||||||
|
|
|
@ -27,21 +27,21 @@ const TransactionSchema = CollectionSchema(
|
||||||
name: r'amount',
|
name: r'amount',
|
||||||
type: IsarType.long,
|
type: IsarType.long,
|
||||||
),
|
),
|
||||||
r'cancelled': PropertySchema(
|
|
||||||
id: 2,
|
|
||||||
name: r'cancelled',
|
|
||||||
type: IsarType.bool,
|
|
||||||
),
|
|
||||||
r'fee': PropertySchema(
|
r'fee': PropertySchema(
|
||||||
id: 3,
|
id: 2,
|
||||||
name: r'fee',
|
name: r'fee',
|
||||||
type: IsarType.long,
|
type: IsarType.long,
|
||||||
),
|
),
|
||||||
r'height': PropertySchema(
|
r'height': PropertySchema(
|
||||||
id: 4,
|
id: 3,
|
||||||
name: r'height',
|
name: r'height',
|
||||||
type: IsarType.long,
|
type: IsarType.long,
|
||||||
),
|
),
|
||||||
|
r'isCancelled': PropertySchema(
|
||||||
|
id: 4,
|
||||||
|
name: r'isCancelled',
|
||||||
|
type: IsarType.bool,
|
||||||
|
),
|
||||||
r'otherData': PropertySchema(
|
r'otherData': PropertySchema(
|
||||||
id: 5,
|
id: 5,
|
||||||
name: r'otherData',
|
name: r'otherData',
|
||||||
|
@ -167,9 +167,9 @@ void _transactionSerialize(
|
||||||
) {
|
) {
|
||||||
writer.writeString(offsets[0], object.address);
|
writer.writeString(offsets[0], object.address);
|
||||||
writer.writeLong(offsets[1], object.amount);
|
writer.writeLong(offsets[1], object.amount);
|
||||||
writer.writeBool(offsets[2], object.cancelled);
|
writer.writeLong(offsets[2], object.fee);
|
||||||
writer.writeLong(offsets[3], object.fee);
|
writer.writeLong(offsets[3], object.height);
|
||||||
writer.writeLong(offsets[4], object.height);
|
writer.writeBool(offsets[4], object.isCancelled);
|
||||||
writer.writeString(offsets[5], object.otherData);
|
writer.writeString(offsets[5], object.otherData);
|
||||||
writer.writeString(offsets[6], object.slateId);
|
writer.writeString(offsets[6], object.slateId);
|
||||||
writer.writeByte(offsets[7], object.subType.index);
|
writer.writeByte(offsets[7], object.subType.index);
|
||||||
|
@ -187,10 +187,10 @@ Transaction _transactionDeserialize(
|
||||||
final object = Transaction();
|
final object = Transaction();
|
||||||
object.address = reader.readString(offsets[0]);
|
object.address = reader.readString(offsets[0]);
|
||||||
object.amount = reader.readLong(offsets[1]);
|
object.amount = reader.readLong(offsets[1]);
|
||||||
object.cancelled = reader.readBool(offsets[2]);
|
object.fee = reader.readLong(offsets[2]);
|
||||||
object.fee = reader.readLong(offsets[3]);
|
object.height = reader.readLongOrNull(offsets[3]);
|
||||||
object.height = reader.readLongOrNull(offsets[4]);
|
|
||||||
object.id = id;
|
object.id = id;
|
||||||
|
object.isCancelled = reader.readBool(offsets[4]);
|
||||||
object.otherData = reader.readStringOrNull(offsets[5]);
|
object.otherData = reader.readStringOrNull(offsets[5]);
|
||||||
object.slateId = reader.readStringOrNull(offsets[6]);
|
object.slateId = reader.readStringOrNull(offsets[6]);
|
||||||
object.subType =
|
object.subType =
|
||||||
|
@ -216,11 +216,11 @@ P _transactionDeserializeProp<P>(
|
||||||
case 1:
|
case 1:
|
||||||
return (reader.readLong(offset)) as P;
|
return (reader.readLong(offset)) as P;
|
||||||
case 2:
|
case 2:
|
||||||
return (reader.readBool(offset)) as P;
|
|
||||||
case 3:
|
|
||||||
return (reader.readLong(offset)) as P;
|
return (reader.readLong(offset)) as P;
|
||||||
case 4:
|
case 3:
|
||||||
return (reader.readLongOrNull(offset)) as P;
|
return (reader.readLongOrNull(offset)) as P;
|
||||||
|
case 4:
|
||||||
|
return (reader.readBool(offset)) as P;
|
||||||
case 5:
|
case 5:
|
||||||
return (reader.readStringOrNull(offset)) as P;
|
return (reader.readStringOrNull(offset)) as P;
|
||||||
case 6:
|
case 6:
|
||||||
|
@ -748,16 +748,6 @@ extension TransactionQueryFilter
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<Transaction, Transaction, QAfterFilterCondition>
|
|
||||||
cancelledEqualTo(bool value) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
|
||||||
return query.addFilterCondition(FilterCondition.equalTo(
|
|
||||||
property: r'cancelled',
|
|
||||||
value: value,
|
|
||||||
));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
QueryBuilder<Transaction, Transaction, QAfterFilterCondition> feeEqualTo(
|
QueryBuilder<Transaction, Transaction, QAfterFilterCondition> feeEqualTo(
|
||||||
int value) {
|
int value) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
@ -935,6 +925,16 @@ extension TransactionQueryFilter
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QueryBuilder<Transaction, Transaction, QAfterFilterCondition>
|
||||||
|
isCancelledEqualTo(bool value) {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addFilterCondition(FilterCondition.equalTo(
|
||||||
|
property: r'isCancelled',
|
||||||
|
value: value,
|
||||||
|
));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
QueryBuilder<Transaction, Transaction, QAfterFilterCondition>
|
QueryBuilder<Transaction, Transaction, QAfterFilterCondition>
|
||||||
otherDataIsNull() {
|
otherDataIsNull() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
@ -1703,18 +1703,6 @@ extension TransactionQuerySortBy
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<Transaction, Transaction, QAfterSortBy> sortByCancelled() {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
|
||||||
return query.addSortBy(r'cancelled', Sort.asc);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
QueryBuilder<Transaction, Transaction, QAfterSortBy> sortByCancelledDesc() {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
|
||||||
return query.addSortBy(r'cancelled', Sort.desc);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
QueryBuilder<Transaction, Transaction, QAfterSortBy> sortByFee() {
|
QueryBuilder<Transaction, Transaction, QAfterSortBy> sortByFee() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addSortBy(r'fee', Sort.asc);
|
return query.addSortBy(r'fee', Sort.asc);
|
||||||
|
@ -1739,6 +1727,18 @@ extension TransactionQuerySortBy
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QueryBuilder<Transaction, Transaction, QAfterSortBy> sortByIsCancelled() {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addSortBy(r'isCancelled', Sort.asc);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryBuilder<Transaction, Transaction, QAfterSortBy> sortByIsCancelledDesc() {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addSortBy(r'isCancelled', Sort.desc);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
QueryBuilder<Transaction, Transaction, QAfterSortBy> sortByOtherData() {
|
QueryBuilder<Transaction, Transaction, QAfterSortBy> sortByOtherData() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addSortBy(r'otherData', Sort.asc);
|
return query.addSortBy(r'otherData', Sort.asc);
|
||||||
|
@ -1838,18 +1838,6 @@ extension TransactionQuerySortThenBy
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<Transaction, Transaction, QAfterSortBy> thenByCancelled() {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
|
||||||
return query.addSortBy(r'cancelled', Sort.asc);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
QueryBuilder<Transaction, Transaction, QAfterSortBy> thenByCancelledDesc() {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
|
||||||
return query.addSortBy(r'cancelled', Sort.desc);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
QueryBuilder<Transaction, Transaction, QAfterSortBy> thenByFee() {
|
QueryBuilder<Transaction, Transaction, QAfterSortBy> thenByFee() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addSortBy(r'fee', Sort.asc);
|
return query.addSortBy(r'fee', Sort.asc);
|
||||||
|
@ -1886,6 +1874,18 @@ extension TransactionQuerySortThenBy
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QueryBuilder<Transaction, Transaction, QAfterSortBy> thenByIsCancelled() {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addSortBy(r'isCancelled', Sort.asc);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryBuilder<Transaction, Transaction, QAfterSortBy> thenByIsCancelledDesc() {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addSortBy(r'isCancelled', Sort.desc);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
QueryBuilder<Transaction, Transaction, QAfterSortBy> thenByOtherData() {
|
QueryBuilder<Transaction, Transaction, QAfterSortBy> thenByOtherData() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addSortBy(r'otherData', Sort.asc);
|
return query.addSortBy(r'otherData', Sort.asc);
|
||||||
|
@ -1974,12 +1974,6 @@ extension TransactionQueryWhereDistinct
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<Transaction, Transaction, QDistinct> distinctByCancelled() {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
|
||||||
return query.addDistinctBy(r'cancelled');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
QueryBuilder<Transaction, Transaction, QDistinct> distinctByFee() {
|
QueryBuilder<Transaction, Transaction, QDistinct> distinctByFee() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addDistinctBy(r'fee');
|
return query.addDistinctBy(r'fee');
|
||||||
|
@ -1992,6 +1986,12 @@ extension TransactionQueryWhereDistinct
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QueryBuilder<Transaction, Transaction, QDistinct> distinctByIsCancelled() {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addDistinctBy(r'isCancelled');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
QueryBuilder<Transaction, Transaction, QDistinct> distinctByOtherData(
|
QueryBuilder<Transaction, Transaction, QDistinct> distinctByOtherData(
|
||||||
{bool caseSensitive = true}) {
|
{bool caseSensitive = true}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
@ -2052,12 +2052,6 @@ extension TransactionQueryProperty
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<Transaction, bool, QQueryOperations> cancelledProperty() {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
|
||||||
return query.addPropertyName(r'cancelled');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
QueryBuilder<Transaction, int, QQueryOperations> feeProperty() {
|
QueryBuilder<Transaction, int, QQueryOperations> feeProperty() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addPropertyName(r'fee');
|
return query.addPropertyName(r'fee');
|
||||||
|
@ -2070,6 +2064,12 @@ extension TransactionQueryProperty
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QueryBuilder<Transaction, bool, QQueryOperations> isCancelledProperty() {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addPropertyName(r'isCancelled');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
QueryBuilder<Transaction, String?, QQueryOperations> otherDataProperty() {
|
QueryBuilder<Transaction, String?, QQueryOperations> otherDataProperty() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addPropertyName(r'otherData');
|
return query.addPropertyName(r'otherData');
|
||||||
|
|
|
@ -122,7 +122,7 @@ class TxIcon2 extends StatelessWidget {
|
||||||
child: Center(
|
child: Center(
|
||||||
child: SvgPicture.asset(
|
child: SvgPicture.asset(
|
||||||
_getAssetName(
|
_getAssetName(
|
||||||
transaction.cancelled,
|
transaction.isCancelled,
|
||||||
txIsReceived,
|
txIsReceived,
|
||||||
!transaction.isConfirmed(
|
!transaction.isConfirmed(
|
||||||
currentHeight,
|
currentHeight,
|
||||||
|
|
|
@ -2223,7 +2223,7 @@ class BitcoinCashWallet extends CoinServiceAPI {
|
||||||
|
|
||||||
tx.height = txData["height"] as int?;
|
tx.height = txData["height"] as int?;
|
||||||
|
|
||||||
tx.cancelled = false;
|
tx.isCancelled = false;
|
||||||
tx.slateId = null;
|
tx.slateId = null;
|
||||||
tx.otherData = null;
|
tx.otherData = null;
|
||||||
|
|
||||||
|
|
|
@ -452,7 +452,7 @@ class _TransactionCardState2 extends ConsumerState<TransactionCard2> {
|
||||||
child: FittedBox(
|
child: FittedBox(
|
||||||
fit: BoxFit.scaleDown,
|
fit: BoxFit.scaleDown,
|
||||||
child: Text(
|
child: Text(
|
||||||
_transaction.cancelled
|
_transaction.isCancelled
|
||||||
? "Cancelled"
|
? "Cancelled"
|
||||||
: whatIsIt(
|
: whatIsIt(
|
||||||
_transaction.type,
|
_transaction.type,
|
||||||
|
|
Loading…
Reference in a new issue