mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 09:47:37 +00:00
utxo confirmed status ui indication
This commit is contained in:
parent
c77993a3e5
commit
5f35048688
2 changed files with 32 additions and 5 deletions
|
@ -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) {
|
||||
|
|
|
@ -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,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
Loading…
Reference in a new issue