Does what https://github.com/cypherstack/stack_wallet/pull/1442/ intended but without the negative side effects
What changed, and why it matters
This commit adjusts two on-screen selection sheets in the Stack Wallet mobile app so they respect the phone's safe area (notch, gesture bar, etc.) and fixes some padding. It also removes a duplicate spacer in one sheet. There is no indication this fixes a security vulnerability; it appears to be a UI/UX follow-up to an earlier pull request.
No security action required. Treat as a routine UI polish commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff wraps the dual_balance_selection_sheet.dart and transaction_fee_selection_sheet.dart content in a SafeArea widget and tweaks bottom padding. It also removes an extra const SizedBox(height: 16) followed by const SizedBox(height: 24) in the balance sheet, replacing them with a single const SizedBox(height: 24). The transaction fee sheet is otherwise structurally identical, just indented inside the new SafeArea. No logic, state handling, cryptographic, or network code is changed.
Changed components
lib/pages/send_view/sub_widgets/dual_balance_selection_sheet.dartlib/pages/send_view/sub_widgets/transaction_fee_selection_sheet.dartInspect captured patch +568 / −543
diff --git a/lib/pages/send_view/sub_widgets/dual_balance_selection_sheet.dart b/lib/pages/send_view/sub_widgets/dual_balance_selection_sheet.dart
index fbd9ad9..e4505bc 100644
--- a/lib/pages/send_view/sub_widgets/dual_balance_selection_sheet.dart
+++ b/lib/pages/send_view/sub_widgets/dual_balance_selection_sheet.dart
@@ -50,208 +50,216 @@ class _FiroBalanceSelectionSheetState
color: Theme.of(context).extension<StackColors>()!.popupBG,
borderRadius: const BorderRadius.vertical(top: Radius.circular(20)),
),
- child: Padding(
- padding: const EdgeInsets.only(left: 24, right: 24, top: 10, bottom: 0),
- child: Column(
- mainAxisSize: MainAxisSize.min,
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Center(
- child: Container(
- decoration: BoxDecoration(
- color:
- Theme.of(
- context,
- ).extension<StackColors>()!.textFieldDefaultBG,
- borderRadius: BorderRadius.circular(
- Constants.size.circularBorderRadius,
+ child: SafeArea(
+ child: Padding(
+ padding: const EdgeInsets.only(
+ left: 24,
+ right: 24,
+ top: 10,
+ bottom: 16,
+ ),
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Center(
+ child: Container(
+ decoration: BoxDecoration(
+ color: Theme.of(context)
+ .extension<StackColors>()!
+ .textFieldDefaultBG,
+ borderRadius: BorderRadius.circular(
+ Constants.size.circularBorderRadius,
+ ),
),
+ width: 60,
+ height: 4,
),
- width: 60,
- height: 4,
),
- ),
- const SizedBox(height: 36),
- Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(
- "Select balance",
- style: STextStyles.pageTitleH2(context),
- textAlign: TextAlign.left,
- ),
- const SizedBox(height: 16),
- GestureDetector(
- onTap: () {
- final state =
- ref.read(publicPrivateBalanceStateProvider.state).state;
- if (state != BalanceType.private) {
- ref.read(publicPrivateBalanceStateProvider.state).state =
- BalanceType.private;
- }
- Navigator.of(context).pop();
- },
- child: Container(
- color: Colors.transparent,
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Column(
- mainAxisAlignment: MainAxisAlignment.start,
- children: [
- SizedBox(
- width: 20,
- height: 20,
- child: Radio(
- activeColor:
- Theme.of(context)
- .extension<StackColors>()!
- .radioButtonIconEnabled,
- value: BalanceType.private,
- groupValue:
- ref
- .watch(
- publicPrivateBalanceStateProvider
- .state,
- )
- .state,
- onChanged: (x) {
- ref
- .read(
+ const SizedBox(height: 36),
+ Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ "Select balance",
+ style: STextStyles.pageTitleH2(context),
+ textAlign: TextAlign.left,
+ ),
+ const SizedBox(height: 16),
+ GestureDetector(
+ onTap: () {
+ final state = ref
+ .read(publicPrivateBalanceStateProvider.state)
+ .state;
+ if (state != BalanceType.private) {
+ ref
+ .read(publicPrivateBalanceStateProvider.state)
+ .state =
+ BalanceType.private;
+ }
+ Navigator.of(context).pop();
+ },
+ child: Container(
+ color: Colors.transparent,
+ child: Row(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Column(
+ mainAxisAlignment: MainAxisAlignment.start,
+ children: [
+ SizedBox(
+ width: 20,
+ height: 20,
+ child: Radio(
+ activeColor: Theme.of(context)
+ .extension<StackColors>()!
+ .radioButtonIconEnabled,
+ value: BalanceType.private,
+ groupValue: ref
+ .watch(
publicPrivateBalanceStateProvider.state,
)
- .state = BalanceType.private;
+ .state,
+ onChanged: (x) {
+ ref
+ .read(
+ publicPrivateBalanceStateProvider
+ .state,
+ )
+ .state =
+ BalanceType.private;
- Navigator.of(context).pop();
- },
- ),
- ),
- ],
- ),
- const SizedBox(width: 12),
- Flexible(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- // Row(
- // children: [
- Text(
- "Private balance",
- style: STextStyles.titleBold12(context),
- textAlign: TextAlign.left,
- ),
- const SizedBox(width: 2),
- Text(
- ref
- .watch(pAmountFormatter(coin))
- .format(
- ref
- .watch(
- coin is Firo
- ? pWalletBalanceTertiary(
- walletId,
- )
- : pWalletBalanceSecondary(
- walletId,
- ),
- )
- .spendable,
- ),
- style: STextStyles.itemSubtitle(context),
- textAlign: TextAlign.left,
+ Navigator.of(context).pop();
+ },
+ ),
),
],
),
- // ],
- // ),
- ),
- ],
+ const SizedBox(width: 12),
+ Flexible(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ // Row(
+ // children: [
+ Text(
+ "Private balance",
+ style: STextStyles.titleBold12(context),
+ textAlign: TextAlign.left,
+ ),
+ const SizedBox(width: 2),
+ Text(
+ ref
+ .watch(pAmountFormatter(coin))
+ .format(
+ ref
+ .watch(
+ coin is Firo
+ ? pWalletBalanceTertiary(
+ walletId,
+ )
+ : pWalletBalanceSecondary(
+ walletId,
+ ),
+ )
+ .spendable,
+ ),
+ style: STextStyles.itemSubtitle(context),
+ textAlign: TextAlign.left,
+ ),
+ ],
+ ),
+ // ],
+ // ),
+ ),
+ ],
+ ),
),
),
- ),
- const SizedBox(height: 16),
- GestureDetector(
- onTap: () {
- final state =
- ref.read(publicPrivateBalanceStateProvider.state).state;
- if (state != BalanceType.public) {
- ref.read(publicPrivateBalanceStateProvider.state).state =
- BalanceType.public;
- }
- Navigator.of(context).pop();
- },
- child: Container(
- color: Colors.transparent,
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Column(
- children: [
- SizedBox(
- width: 20,
- height: 20,
- child: Radio(
- activeColor:
- Theme.of(context)
- .extension<StackColors>()!
- .radioButtonIconEnabled,
- value: BalanceType.public,
- groupValue:
- ref
- .watch(
- publicPrivateBalanceStateProvider
- .state,
- )
- .state,
- onChanged: (x) {
- ref
- .read(
+ const SizedBox(height: 16),
+ GestureDetector(
+ onTap: () {
+ final state = ref
+ .read(publicPrivateBalanceStateProvider.state)
+ .state;
+ if (state != BalanceType.public) {
+ ref
+ .read(publicPrivateBalanceStateProvider.state)
+ .state =
+ BalanceType.public;
+ }
+ Navigator.of(context).pop();
+ },
+ child: Container(
+ color: Colors.transparent,
+ child: Row(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Column(
+ children: [
+ SizedBox(
+ width: 20,
+ height: 20,
+ child: Radio(
+ activeColor: Theme.of(context)
+ .extension<StackColors>()!
+ .radioButtonIconEnabled,
+ value: BalanceType.public,
+ groupValue: ref
+ .watch(
publicPrivateBalanceStateProvider.state,
)
- .state = BalanceType.public;
- Navigator.of(context).pop();
- },
- ),
- ),
- ],
- ),
- const SizedBox(width: 12),
- Flexible(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- // Row(
- // children: [
- Text(
- "Public balance",
- style: STextStyles.titleBold12(context),
- textAlign: TextAlign.left,
- ),
- const SizedBox(width: 2),
- Text(
- ref
- .watch(pAmountFormatter(coin))
- .format(
- ref
- .watch(pWalletBalance(walletId))
- .spendable,
- ),
- style: STextStyles.itemSubtitle(context),
- textAlign: TextAlign.left,
+ .state,
+ onChanged: (x) {
+ ref
+ .read(
+ publicPrivateBalanceStateProvider
+ .state,
+ )
+ .state =
+ BalanceType.public;
+ Navigator.of(context).pop();
+ },
+ ),
),
],
),
- ),
- ],
+ const SizedBox(width: 12),
+ Flexible(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ // Row(
+ // children: [
+ Text(
+ "Public balance",
+ style: STextStyles.titleBold12(context),
+ textAlign: TextAlign.left,
+ ),
+ const SizedBox(width: 2),
+ Text(
+ ref
+ .watch(pAmountFormatter(coin))
+ .format(
+ ref
+ .watch(pWalletBalance(walletId))
+ .spendable,
+ ),
+ style: STextStyles.itemSubtitle(context),
+ textAlign: TextAlign.left,
+ ),
+ ],
+ ),
+ ),
+ ],
+ ),
),
),
- ),
- const SizedBox(height: 16),
- const SizedBox(height: 24),
- ],
- ),
- ],
+ ],
+ ),
+ ],
+ ),
),
),
);
diff --git a/lib/pages/send_view/sub_widgets/transaction_fee_selection_sheet.dart b/lib/pages/send_view/sub_widgets/transaction_fee_selection_sheet.dart
index 732e5e1..71fa032 100644
--- a/lib/pages/send_view/sub_widgets/transaction_fee_selection_sheet.dart
+++ b/lib/pages/send_view/sub_widgets/transaction_fee_selection_sheet.dart
@@ -315,385 +315,285 @@ class _TransactionFeeSelectionSheetState
color: Theme.of(context).extension<StackColors>()!.popupBG,
borderRadius: const BorderRadius.vertical(top: Radius.circular(20)),
),
- child: Padding(
- padding: const EdgeInsets.only(left: 24, right: 24, top: 10, bottom: 0),
- child: Column(
- mainAxisSize: MainAxisSize.min,
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Center(
- child: Container(
- decoration: BoxDecoration(
- color: Theme.of(
- context,
- ).extension<StackColors>()!.textFieldDefaultBG,
- borderRadius: BorderRadius.circular(
- Constants.size.circularBorderRadius,
+ child: SafeArea(
+ child: Padding(
+ padding: const EdgeInsets.only(
+ left: 24,
+ right: 24,
+ top: 10,
+ bottom: 0,
+ ),
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Center(
+ child: Container(
+ decoration: BoxDecoration(
+ color: Theme.of(context)
+ .extension<StackColors>()!
+ .textFieldDefaultBG,
+ borderRadius: BorderRadius.circular(
+ Constants.size.circularBorderRadius,
+ ),
),
+ width: 60,
+ height: 4,
),
- width: 60,
- height: 4,
),
- ),
- const SizedBox(height: 36),
- FutureBuilder(
- future: widget.isToken
- ? (coin is Ethereum
- ? ref.read(pCurrentTokenWallet)!.fees
- : wallet.fees)
- : wallet.fees,
- builder: (context, AsyncSnapshot<FeeObject> snapshot) {
- if (snapshot.connectionState == ConnectionState.done &&
- snapshot.hasData) {
- feeObject = snapshot.data!;
- }
-
- return Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(
- "Fee rate",
- style: STextStyles.pageTitleH2(context),
- textAlign: TextAlign.left,
- ),
- const SizedBox(height: 16),
- GestureDetector(
- onTap: () => _selectFeeRate(FeeRateType.fast),
- child: Container(
- color: Colors.transparent,
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Column(
- mainAxisAlignment: MainAxisAlignment.start,
- children: [
- SizedBox(
- width: 20,
- height: 20,
- child: Radio(
- activeColor: Theme.of(context)
- .extension<StackColors>()!
- .radioButtonIconEnabled,
- value: FeeRateType.fast,
- groupValue: ref
- .watch(
- feeRateTypeMobileStateProvider.state,
- )
- .state,
- onChanged: (_) =>
- _selectFeeRate(FeeRateType.fast),
- ),
- ),
- ],
- ),
- const SizedBox(width: 12),
- Flexible(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
+ const SizedBox(height: 36),
+ FutureBuilder(
+ future: widget.isToken
+ ? (coin is Ethereum
+ ? ref.read(pCurrentTokenWallet)!.fees
+ : wallet.fees)
+ : wallet.fees,
+ builder: (context, AsyncSnapshot<FeeObject> snapshot) {
+ if (snapshot.connectionState == ConnectionState.done &&
+ snapshot.hasData) {
+ feeObject = snapshot.data!;
+ }
+
+ return Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ "Fee rate",
+ style: STextStyles.pageTitleH2(context),
+ textAlign: TextAlign.left,
+ ),
+ const SizedBox(height: 16),
+ GestureDetector(
+ onTap: () => _selectFeeRate(FeeRateType.fast),
+ child: Container(
+ color: Colors.transparent,
+ child: Row(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Column(
+ mainAxisAlignment: MainAxisAlignment.start,
children: [
- Row(
- children: [
- Text(
- FeeRateType.fast.prettyName,
- style: STextStyles.titleBold12(context),
- textAlign: TextAlign.left,
- ),
- const SizedBox(width: 2),
- if (feeObject == null)
- AnimatedText(
- stringsToLoopThrough:
- stringsToLoopThrough,
- style: STextStyles.itemSubtitle(
+ SizedBox(
+ width: 20,
+ height: 20,
+ child: Radio(
+ activeColor: Theme.of(context)
+ .extension<StackColors>()!
+ .radioButtonIconEnabled,
+ value: FeeRateType.fast,
+ groupValue: ref
+ .watch(
+ feeRateTypeMobileStateProvider
+ .state,
+ )
+ .state,
+ onChanged: (_) =>
+ _selectFeeRate(FeeRateType.fast),
+ ),
+ ),
+ ],
+ ),
+ const SizedBox(width: 12),
+ Flexible(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Row(
+ children: [
+ Text(
+ FeeRateType.fast.prettyName,
+ style: STextStyles.titleBold12(
context,
),
+ textAlign: TextAlign.left,
),
- if (feeObject != null)
- FutureBuilder(
- future: feeFor(
- coin: coin,
- feeRateType: FeeRateType.fast,
- feeRate: feeObject!.fast,
- amount: amount,
+ const SizedBox(width: 2),
+ if (feeObject == null)
+ AnimatedText(
+ stringsToLoopThrough:
+ stringsToLoopThrough,
+ style: STextStyles.itemSubtitle(
+ context,
+ ),
),
- builder:
- (
- _,
- AsyncSnapshot<Amount> snapshot,
- ) {
- if (snapshot.connectionState ==
- ConnectionState.done &&
- snapshot.hasData) {
- return Text(
- "(~${ref.watch(pAmountFormatter(coin)).format(snapshot.data!, indicatePrecisionLoss: false)})",
- style:
- STextStyles.itemSubtitle(
- context,
- ),
- textAlign: TextAlign.left,
- );
- } else {
- return AnimatedText(
- stringsToLoopThrough:
- stringsToLoopThrough,
- style:
- STextStyles.itemSubtitle(
- context,
- ),
- );
- }
- },
- ),
- ],
- ),
- const SizedBox(height: 2),
- if (feeObject == null && coin is! Ethereum)
- AnimatedText(
- stringsToLoopThrough:
- stringsToLoopThrough,
- style: STextStyles.itemSubtitle(context),
+ if (feeObject != null)
+ FutureBuilder(
+ future: feeFor(
+ coin: coin,
+ feeRateType: FeeRateType.fast,
+ feeRate: feeObject!.fast,
+ amount: amount,
+ ),
+ builder: (_, AsyncSnapshot<Amount> snapshot) {
+ if (snapshot.connectionState ==
+ ConnectionState.done &&
+ snapshot.hasData) {
+ return Text(
+ "(~${ref.watch(pAmountFormatter(coin)).format(snapshot.data!, indicatePrecisionLoss: false)})",
+ style:
+ STextStyles.itemSubtitle(
+ context,
+ ),
+ textAlign: TextAlign.left,
+ );
+ } else {
+ return AnimatedText(
+ stringsToLoopThrough:
+ stringsToLoopThrough,
+ style:
+ STextStyles.itemSubtitle(
+ context,
+ ),
+ );
+ }
+ },
+ ),
+ ],
),
- if (feeObject != null && coin is! Ethereum)
- Text(
- estimatedTimeToBeIncludedInNextBlock(
- coin.targetBlockTimeSeconds,
- feeObject!.numberOfBlocksFast,
+ const SizedBox(height: 2),
+ if (feeObject == null && coin is! Ethereum)
+ AnimatedText(
+ stringsToLoopThrough:
+ stringsToLoopThrough,
+ style: STextStyles.itemSubtitle(
+ context,
+ ),
),
- style: STextStyles.itemSubtitle(context),
- textAlign: TextAlign.left,
- ),
- ],
- ),
- ),
- ],
- ),
- ),
- ),
- const SizedBox(height: 16),
- GestureDetector(
- onTap: () => _selectFeeRate(FeeRateType.average),
- child: Container(
- color: Colors.transparent,
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Column(
- children: [
- SizedBox(
- width: 20,
- height: 20,
- child: Radio(
- activeColor: Theme.of(context)
- .extension<StackColors>()!
- .radioButtonIconEnabled,
- value: FeeRateType.average,
- groupValue: ref
- .watch(
- feeRateTypeMobileStateProvider.state,
- )
- .state,
- onChanged: (_) =>
- _selectFeeRate(FeeRateType.average),
- ),
- ),
- ],
- ),
- const SizedBox(width: 12),
- Flexible(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Row(
- children: [
+ if (feeObject != null && coin is! Ethereum)
Text(
- FeeRateType.average.prettyName,
- style: STextStyles.titleBold12(context),
- textAlign: TextAlign.left,
- ),
- const SizedBox(width: 2),
- if (feeObject == null)
- AnimatedText(
- stringsToLoopThrough:
- stringsToLoopThrough,
- style: STextStyles.itemSubtitle(
- context,
- ),
+ estimatedTimeToBeIncludedInNextBlock(
+ coin.targetBlockTimeSeconds,
+ feeObject!.numberOfBlocksFast,
),
- if (feeObject != null)
- FutureBuilder(
- future: feeFor(
- coin: coin,
- feeRateType: FeeRateType.average,
- feeRate: feeObject!.medium,
- amount: amount,
- ),
- builder:
- (
- _,
- AsyncSnapshot<Amount> snapshot,
- ) {
- if (snapshot.connectionState ==
- ConnectionState.done &&
- snapshot.hasData) {
- return Text(
- "(~${ref.watch(pAmountFormatter(coin)).format(snapshot.data!, indicatePrecisionLoss: false)})",
- style:
- STextStyles.itemSubtitle(
- context,
- ),
- textAlign: TextAlign.left,
- );
- } else {
- return AnimatedText(
- stringsToLoopThrough:
- stringsToLoopThrough,
- style:
- STextStyles.itemSubtitle(
- context,
- ),
- );
- }
- },
+ style: STextStyles.itemSubtitle(
+ context,
),
- ],
- ),
- const SizedBox(height: 2),
- if (feeObject == null && coin is! Ethereum)
- AnimatedText(
- stringsToLoopThrough:
- stringsToLoopThrough,
- style: STextStyles.itemSubtitle(context),
- ),
- if (feeObject != null && coin is! Ethereum)
- Text(
- estimatedTimeToBeIncludedInNextBlock(
- coin.targetBlockTimeSeconds,
- feeObject!.numberOfBlocksAverage,
+ textAlign: TextAlign.left,
),
- style: STextStyles.itemSubtitle(context),
- textAlign: TextAlign.left,
- ),
- ],
+ ],
+ ),
),
- ),
- ],
+ ],
+ ),
),
),
- ),
- const SizedBox(height: 16),
- GestureDetector(
- onTap: () => _selectFeeRate(FeeRateType.slow),
- child: Container(
- color: Colors.transparent,
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Column(
- children: [
- SizedBox(
- width: 20,
- height: 20,
- child: Radio(
- activeColor: Theme.of(context)
- .extension<StackColors>()!
- .radioButtonIconEnabled,
- value: FeeRateType.slow,
- groupValue: ref
- .watch(
- feeRateTypeMobileStateProvider.state,
- )
- .state,
- onChanged: (_) =>
- _selectFeeRate(FeeRateType.slow),
- ),
- ),
- ],
- ),
- const SizedBox(width: 12),
- Flexible(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
+ const SizedBox(height: 16),
+ GestureDetector(
+ onTap: () => _selectFeeRate(FeeRateType.average),
+ child: Container(
+ color: Colors.transparent,
+ child: Row(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Column(
children: [
- Row(
- children: [
- Text(
- FeeRateType.slow.prettyName,
- style: STextStyles.titleBold12(context),
- textAlign: TextAlign.left,
- ),
- const SizedBox(width: 2),
- if (feeObject == null)
- AnimatedText(
- stringsToLoopThrough:
- stringsToLoopThrough,
- style: STextStyles.itemSubtitle(
+ SizedBox(
+ width: 20,
+ height: 20,
+ child: Radio(
+ activeColor: Theme.of(context)
+ .extension<StackColors>()!
+ .radioButtonIconEnabled,
+ value: FeeRateType.average,
+ groupValue: ref
+ .watch(
+ feeRateTypeMobileStateProvider
+ .state,
+ )
+ .state,
+ onChanged: (_) =>
+ _selectFeeRate(FeeRateType.average),
+ ),
+ ),
+ ],
+ ),
+ const SizedBox(width: 12),
+ Flexible(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Row(
+ children: [
+ Text(
+ FeeRateType.average.prettyName,
+ style: STextStyles.titleBold12(
context,
),
+ textAlign: TextAlign.left,
),
- if (feeObject != null)
- FutureBuilder(
- future: feeFor(
- coin: coin,
- feeRateType: FeeRateType.slow,
- feeRate: feeObject!.slow,
- amount: amount,
+ const SizedBox(width: 2),
+ if (feeObject == null)
+ AnimatedText(
+ stringsToLoopThrough:
+ stringsToLoopThrough,
+ style: STextStyles.itemSubtitle(
+ context,
+ ),
),
- builder:
- (
- _,
- AsyncSnapshot<Amount> snapshot,
- ) {
- if (snapshot.connectionState ==
- ConnectionState.done &&
- snapshot.hasData) {
- return Text(
- "(~${ref.watch(pAmountFormatter(coin)).format(snapshot.data!, indicatePrecisionLoss: false)})",
- style:
- STextStyles.itemSubtitle(
- context,
- ),
- textAlign: TextAlign.left,
- );
- } else {
- return AnimatedText(
- stringsToLoopThrough:
- stringsToLoopThrough,
- style:
- STextStyles.itemSubtitle(
- context,
- ),
- );
- }
- },
- ),
- ],
- ),
- const SizedBox(height: 2),
- if (feeObject == null && coin is! Ethereum)
- AnimatedText(
- stringsToLoopThrough:
- stringsToLoopThrough,
- style: STextStyles.itemSubtitle(context),
+ if (feeObject != null)
+ FutureBuilder(
+ future: feeFor(
+ coin: coin,
+ feeRateType: FeeRateType.average,
+ feeRate: feeObject!.medium,
+ amount: amount,
+ ),
+ builder: (_, AsyncSnapshot<Amount> snapshot) {
+ if (snapshot.connectionState ==
+ ConnectionState.done &&
+ snapshot.hasData) {
+ return Text(
+ "(~${ref.watch(pAmountFormatter(coin)).format(snapshot.data!, indicatePrecisionLoss: false)})",
+ style:
+ STextStyles.itemSubtitle(
+ context,
+ ),
+ textAlign: TextAlign.left,
+ );
+ } else {
+ return AnimatedText(
+ stringsToLoopThrough:
+ stringsToLoopThrough,
+ style:
+ STextStyles.itemSubtitle(
+ context,
+ ),
+ );
+ }
+ },
+ ),
+ ],
),
- if (feeObject != null && coin is! Ethereum)
- Text(
- estimatedTimeToBeIncludedInNextBlock(
- coin.targetBlockTimeSeconds,
- feeObject!.numberOfBlocksSlow,
+ const SizedBox(height: 2),
+ if (feeObject == null && coin is! Ethereum)
+ AnimatedText(
+ stringsToLoopThrough:
+ stringsToLoopThrough,
+ style: STextStyles.itemSubtitle(
+ context,
+ ),
),
- style: STextStyles.itemSubtitle(context),
- textAlign: TextAlign.left,
- ),
- ],
+ if (feeObject != null && coin is! Ethereum)
+ Text(
+ estimatedTimeToBeIncludedInNextBlock(
+ coin.targetBlockTimeSeconds,
+ feeObject!.numberOfBlocksAverage,
+ ),
+ style: STextStyles.itemSubtitle(
+ context,
+ ),
+ textAlign: TextAlign.left,
+ ),
+ ],
+ ),
),
- ),
- ],
+ ],
+ ),
),
),
- ),
- const SizedBox(height: 24),
- if (wallet is ElectrumXInterface || coin is Ethereum)
+ const SizedBox(height: 16),
GestureDetector(
- onTap: () => _selectFeeRate(FeeRateType.custom),
+ onTap: () => _selectFeeRate(FeeRateType.slow),
child: Container(
color: Colors.transparent,
child: Row(
@@ -708,7 +608,7 @@ class _TransactionFeeSelectionSheetState
activeColor: Theme.of(context)
.extension<StackColors>()!
.radioButtonIconEnabled,
- value: FeeRateType.custom,
+ value: FeeRateType.slow,
groupValue: ref
.watch(
feeRateTypeMobileStateProvider
@@ -716,7 +616,7 @@ class _TransactionFeeSelectionSheetState
)
.state,
onChanged: (_) =>
- _selectFeeRate(FeeRateType.custom),
+ _selectFeeRate(FeeRateType.slow),
),
),
],
@@ -729,15 +629,75 @@ class _TransactionFeeSelectionSheetState
Row(
children: [
Text(
- FeeRateType.custom.prettyName,
+ FeeRateType.slow.prettyName,
style: STextStyles.titleBold12(
context,
),
textAlign: TextAlign.left,
),
+ const SizedBox(width: 2),
+ if (feeObject == null)
+ AnimatedText(
+ stringsToLoopThrough:
+ stringsToLoopThrough,
+ style: STextStyles.itemSubtitle(
+ context,
+ ),
+ ),
+ if (feeObject != null)
+ FutureBuilder(
+ future: feeFor(
+ coin: coin,
+ feeRateType: FeeRateType.slow,
+ feeRate: feeObject!.slow,
+ amount: amount,
+ ),
+ builder: (_, AsyncSnapshot<Amount> snapshot) {
+ if (snapshot.connectionState ==
+ ConnectionState.done &&
+ snapshot.hasData) {
+ return Text(
+ "(~${ref.watch(pAmountFormatter(coin)).format(snapshot.data!, indicatePrecisionLoss: false)})",
+ style:
+ STextStyles.itemSubtitle(
+ context,
+ ),
+ textAlign: TextAlign.left,
+ );
+ } else {
+ return AnimatedText(
+ stringsToLoopThrough:
+ stringsToLoopThrough,
+ style:
+ STextStyles.itemSubtitle(
+ context,
+ ),
+ );
+ }
+ },
+ ),
],
),
const SizedBox(height: 2),
+ if (feeObject == null && coin is! Ethereum)
+ AnimatedText(
+ stringsToLoopThrough:
+ stringsToLoopThrough,
+ style: STextStyles.itemSubtitle(
+ context,
+ ),
+ ),
+ if (feeObject != null && coin is! Ethereum)
+ Text(
+ estimatedTimeToBeIncludedInNextBlock(
+ coin.targetBlockTimeSeconds,
+ feeObject!.numberOfBlocksSlow,
+ ),
+ style: STextStyles.itemSubtitle(
+ context,
+ ),
+ textAlign: TextAlign.left,
+ ),
],
),
),
@@ -745,13 +705,70 @@ class _TransactionFeeSelectionSheetState
),
),
),
- if (wallet is ElectrumXInterface || coin is Ethereum)
const SizedBox(height: 24),
- ],
- );
- },
- ),
- ],
+ if (wallet is ElectrumXInterface || coin is Ethereum)
+ GestureDetector(
+ onTap: () => _selectFeeRate(FeeRateType.custom),
+ child: Container(
+ color: Colors.transparent,
+ child: Row(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Column(
+ children: [
+ SizedBox(
+ width: 20,
+ height: 20,
+ child: Radio(
+ activeColor: Theme.of(context)
+ .extension<StackColors>()!
+ .radioButtonIconEnabled,
+ value: FeeRateType.custom,
+ groupValue: ref
+ .watch(
+ feeRateTypeMobileStateProvider
+ .state,
+ )
+ .state,
+ onChanged: (_) =>
+ _selectFeeRate(FeeRateType.custom),
+ ),
+ ),
+ ],
+ ),
+ const SizedBox(width: 12),
+ Flexible(
+ child: Column(
+ crossAxisAlignment:
+ CrossAxisAlignment.start,
+ children: [
+ Row(
+ children: [
+ Text(
+ FeeRateType.custom.prettyName,
+ style: STextStyles.titleBold12(
+ context,
+ ),
+ textAlign: TextAlign.left,
+ ),
+ ],
+ ),
+ const SizedBox(height: 2),
+ ],
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ if (wallet is ElectrumXInterface || coin is Ethereum)
+ const SizedBox(height: 24),
+ ],
+ );
+ },
+ ),
+ ],
+ ),
),
),
);
Why this scored 19/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.