utxo confirmed status ui indication

This commit is contained in:
julian 2023-03-08 11:34:00 -06:00
parent c77993a3e5
commit 5f35048688
2 changed files with 32 additions and 5 deletions

View file

@ -73,6 +73,16 @@ class _CoinControlViewState extends ConsumerState<CoinControlView> {
),
);
final currentChainHeight = ref.watch(
walletsChangeNotifierProvider.select(
(value) => value
.getManager(
widget.walletId,
)
.currentHeight,
),
);
final ids = MainDB.instance
.getUTXOs(widget.walletId)
.filter()
@ -206,7 +216,11 @@ class _CoinControlViewState extends ConsumerState<CoinControlView> {
canSelect: widget.type ==
CoinControlViewType.manage ||
(widget.type == CoinControlViewType.use &&
!_showBlocked),
!_showBlocked &&
utxo.isConfirmed(
currentChainHeight,
coin.requiredConfirmations,
)),
initialSelectedState: isSelected,
onSelectedChanged: (value) {
if (value) {

View file

@ -74,6 +74,11 @@ class _UtxoDetailsViewState extends ConsumerState<UtxoDetailsView> {
),
);
final confirmed = utxo!.isConfirmed(
currentHeight,
coin.requiredConfirmations,
);
return ConditionalParent(
condition: !Util.isDesktop,
builder: (child) => Background(
@ -137,15 +142,23 @@ class _UtxoDetailsViewState extends ConsumerState<UtxoDetailsView> {
style: STextStyles.pageTitleH2(context),
),
Text(
utxo!.isBlocked ? "Frozen" : "Available",
utxo!.isBlocked
? "Frozen"
: confirmed
? "Available"
: "Unconfirmed",
style: STextStyles.w500_14(context).copyWith(
color: utxo!.isBlocked
? Theme.of(context)
.extension<StackColors>()!
.accentColorBlue
: Theme.of(context)
.extension<StackColors>()!
.accentColorGreen,
: confirmed
? Theme.of(context)
.extension<StackColors>()!
.accentColorGreen
: Theme.of(context)
.extension<StackColors>()!
.accentColorYellow,
),
),
],