mobile coin control navigation and amount label fixes

This commit is contained in:
julian 2023-04-12 07:11:44 -06:00
parent 44d6510a77
commit 15d42834aa
3 changed files with 27 additions and 21 deletions

View file

@ -49,7 +49,7 @@ class CoinControlView extends ConsumerStatefulWidget {
final String walletId;
final CoinControlViewType type;
final int? requestedTotal;
final Amount? requestedTotal;
final Set<UTXO>? selectedUTXOs;
@override
@ -673,7 +673,7 @@ class _CoinControlViewState extends ConsumerState<CoinControlView> {
),
Builder(
builder: (context) {
int selectedSum =
final int selectedSumInt =
_selectedAvailable.isEmpty
? 0
: _selectedAvailable
@ -682,8 +682,12 @@ class _CoinControlViewState extends ConsumerState<CoinControlView> {
(value, element) =>
value += element,
);
final selectedSum =
selectedSumInt.toAmountAsRaw(
fractionDigits: coin.decimals,
);
return Text(
"${selectedSum.toAmountAsRaw(fractionDigits: coin.decimals).localizedStringAsFixed(
"${selectedSum.localizedStringAsFixed(
locale: ref.watch(
localeServiceChangeNotifierProvider
.select(
@ -731,7 +735,7 @@ class _CoinControlViewState extends ConsumerState<CoinControlView> {
style: STextStyles.w600_14(context),
),
Text(
"${widget.requestedTotal!.toAmountAsRaw(fractionDigits: coin.decimals).localizedStringAsFixed(
"${widget.requestedTotal!.localizedStringAsFixed(
locale: ref.watch(
localeServiceChangeNotifierProvider
.select(

View file

@ -124,13 +124,15 @@ class _UtxoCardState extends ConsumerState<UtxoCard> {
mainAxisSize: MainAxisSize.min,
children: [
Text(
"${utxo.value.toAmountAsRaw(fractionDigits: coin.decimals).localizedStringAsFixed(
"${utxo.value.toAmountAsRaw(
fractionDigits: coin.decimals,
).localizedStringAsFixed(
locale: ref.watch(
localeServiceChangeNotifierProvider.select(
(value) => value.locale,
),
),
)}} ${coin.ticker}",
)} ${coin.ticker}",
style: STextStyles.w600_14(context),
),
const SizedBox(

View file

@ -337,7 +337,7 @@ class RouteGenerator {
),
);
} else if (args
is Tuple4<String, CoinControlViewType, int?, Set<UTXO>?>) {
is Tuple4<String, CoinControlViewType, Amount?, Set<UTXO>?>) {
return getRoute(
shouldUseMaterialRoute: useMaterialPageRoute,
builder: (_) => CoinControlView(