Skip to content

Commit d41d9e8

Browse files
authored
Merge pull request #1755 from SatoshiPortal/patch-2
fix: various dark theme patches breaking PSBT flow
2 parents 3b9bd27 + 2a6d310 commit d41d9e8

3 files changed

Lines changed: 53 additions & 44 deletions

File tree

lib/features/psbt_flow/show_animated_qr/show_animated_qr_widget.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,9 @@ class _ShowAnimatedQrViewState extends State<_ShowAnimatedQrView> {
121121
children: [
122122
QrImageView(
123123
data: state.parts[state.currentIndex],
124-
// ignore: deprecated_member_use
125-
foregroundColor: context.appColors.secondary,
124+
// This color must stay hardcoded and not adapt to the theme.
125+
// ColdCard can read only QR with white background.
126+
backgroundColor: context.appColors.onPrimaryFixed,
126127
),
127128
const Gap(16),
128129
if (widget.showSlider) ...[

lib/features/psbt_flow/show_psbt/show_psbt_screen.dart

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,14 @@ class ShowPsbtScreen extends StatelessWidget {
3939
const Gap(16),
4040
],
4141

42-
if (signerDevice != null)
42+
if ([
43+
SignerDeviceEntity.jade,
44+
SignerDeviceEntity.krux,
45+
SignerDeviceEntity.keystone,
46+
SignerDeviceEntity.passport,
47+
SignerDeviceEntity.seedsigner,
48+
SignerDeviceEntity.specter,
49+
].contains(signerDevice))
4350
BBButton.small(
4451
label: context.loc.psbtFlowInstructions,
4552
onPressed: () {
@@ -66,8 +73,8 @@ class ShowPsbtScreen extends StatelessWidget {
6673
break;
6774
}
6875
},
69-
bgColor: context.appColors.onSecondary,
70-
textColor: context.appColors.secondary,
76+
bgColor: context.appColors.secondary,
77+
textColor: context.appColors.onSecondary,
7178
outlined: true,
7279
),
7380
],
@@ -76,7 +83,7 @@ class ShowPsbtScreen extends StatelessWidget {
7683
BBButton.big(
7784
label: context.loc.psbtFlowDone,
7885
bgColor: context.appColors.secondary,
79-
textColor: context.appColors.onPrimary,
86+
textColor: context.appColors.onSecondary,
8087
onPressed: () {
8188
context.pushNamed(
8289
BroadcastSignedTxRoute.broadcastHome.name,

lib/features/send/ui/widgets/selectable_custom_fee_list_item.dart

Lines changed: 39 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,9 @@ class _SelectableCustomFeeListItemState
5656
void _onValueChanged(String text) {
5757
final parsed = num.tryParse(text);
5858
if (parsed != null) {
59-
final fee =
60-
_isAbsolute
61-
? NetworkFee.absolute(parsed.toInt())
62-
: NetworkFee.relative(parsed.toDouble());
59+
final fee = _isAbsolute
60+
? NetworkFee.absolute(parsed.toInt())
61+
: NetworkFee.relative(parsed.toDouble());
6362
setState(() {
6463
_customFee = fee;
6564
});
@@ -82,32 +81,29 @@ class _SelectableCustomFeeListItemState
8281
final fastestAbsValue = (feeOptions?.fastest.value ?? 0) * txSize;
8382
final economicAbsValue = (feeOptions?.economic.value ?? 0) * txSize;
8483
final slowAbsValue = (feeOptions?.slow.value ?? 0) * txSize;
85-
final customAbsValue =
86-
_customFee == null
87-
? 0
88-
: _customFee is AbsoluteFee
89-
? _customFee!.value
90-
: (_customFee?.value ?? 0) * txSize;
84+
final customAbsValue = _customFee == null
85+
? 0
86+
: _customFee is AbsoluteFee
87+
? _customFee!.value
88+
: (_customFee?.value ?? 0) * txSize;
9189
final fiatEq = ConvertAmount.satsToFiat(
9290
customAbsValue.toInt(),
9391
exchangeRate,
9492
);
9593

96-
final subtitle1 =
97-
_customFee == null || feeOptions == null
98-
? ''
99-
: 'Estimated delivery ~ ${customAbsValue >= fastestAbsValue
100-
? context.loc.sendEstimatedDelivery10Minutes
101-
: customAbsValue >= economicAbsValue
102-
? context.loc.sendEstimatedDelivery10to30Minutes
103-
: customAbsValue >= slowAbsValue
104-
? context.loc.sendEstimatedDeliveryFewHours
105-
: context.loc.sendEstimatedDeliveryHoursToDays}';
94+
final subtitle1 = _customFee == null || feeOptions == null
95+
? ''
96+
: 'Estimated delivery ~ ${customAbsValue >= fastestAbsValue
97+
? context.loc.sendEstimatedDelivery10Minutes
98+
: customAbsValue >= economicAbsValue
99+
? context.loc.sendEstimatedDelivery10to30Minutes
100+
: customAbsValue >= slowAbsValue
101+
? context.loc.sendEstimatedDeliveryFewHours
102+
: context.loc.sendEstimatedDeliveryHoursToDays}';
106103

107-
final subtitle2 =
108-
_customFee == null
109-
? ''
110-
: '${_customFee!.value} ${_isAbsolute ? context.loc.sendSats : context.loc.sendSatsPerVB} = $customAbsValue ${context.loc.sendSats} (~ $fiatEq $fiatCurrencyCode)';
104+
final subtitle2 = _customFee == null
105+
? ''
106+
: '${_customFee!.value} ${_isAbsolute ? context.loc.sendSats : context.loc.sendSatsPerVB} = $customAbsValue ${context.loc.sendSats} (~ $fiatEq $fiatCurrencyCode)';
111107

112108
Future<void> submitCustomFee() async {
113109
await context.read<SendCubit>().customFeesChanged(_customFee!);
@@ -139,7 +135,10 @@ class _SelectableCustomFeeListItemState
139135
child: Column(
140136
crossAxisAlignment: .stretch,
141137
children: [
142-
BBText(context.loc.sendCustomFee, style: context.font.headlineLarge),
138+
BBText(
139+
context.loc.sendCustomFee,
140+
style: context.font.headlineLarge,
141+
),
143142
if (subtitle1.isNotEmpty) ...[
144143
const Gap(4),
145144
BBText(subtitle1, style: context.font.labelMedium),
@@ -154,18 +153,19 @@ class _SelectableCustomFeeListItemState
154153
const Gap(8),
155154
Icon(
156155
Icons.radio_button_checked_outlined,
157-
color:
158-
isCustomFeeSelected
159-
? context.appColors.primary
160-
: context.appColors.surface,
156+
color: isCustomFeeSelected
157+
? context.appColors.primary
158+
: context.appColors.surface,
161159
),
162160
],
163161
),
164162
const Gap(12),
165163
Row(
166164
children: [
167165
BBText(
168-
_isAbsolute ? context.loc.sendAbsoluteFees : context.loc.sendRelativeFees,
166+
_isAbsolute
167+
? context.loc.sendAbsoluteFees
168+
: context.loc.sendRelativeFees,
169169
style: context.font.bodySmall,
170170
),
171171
const Spacer(),
@@ -185,9 +185,9 @@ class _SelectableCustomFeeListItemState
185185
else
186186
AmountInputFormatter(BitcoinUnit.btc.code),
187187
],
188-
style: context.font.bodyLarge,
188+
style: TextStyle(color: context.appColors.onSecondary),
189189
decoration: InputDecoration(
190-
fillColor: context.appColors.onPrimary,
190+
fillColor: context.appColors.secondary,
191191
filled: true,
192192
border: OutlineInputBorder(
193193
borderRadius: BorderRadius.circular(8.0),
@@ -210,14 +210,15 @@ class _SelectableCustomFeeListItemState
210210
),
211211
),
212212
contentPadding: const EdgeInsets.symmetric(horizontal: 16.0),
213-
hintText:
214-
_isAbsolute
215-
? context.loc.sendEnterAbsoluteFee
216-
: context.loc.sendEnterRelativeFee,
213+
hintText: _isAbsolute
214+
? context.loc.sendEnterAbsoluteFee
215+
: context.loc.sendEnterRelativeFee,
217216
hintStyle: context.font.bodyMedium?.copyWith(
218217
color: context.appColors.outline,
219218
),
220-
suffixText: _isAbsolute ? context.loc.sendSats : context.loc.sendSatsPerVB,
219+
suffixText: _isAbsolute
220+
? context.loc.sendSats
221+
: context.loc.sendSatsPerVB,
221222
),
222223
onFieldSubmitted: (_) => submitCustomFee(),
223224
onChanged: _onValueChanged,
@@ -228,7 +229,7 @@ class _SelectableCustomFeeListItemState
228229
label: context.loc.sendConfirmCustomFee,
229230
onPressed: submitCustomFee,
230231
bgColor: context.appColors.secondary,
231-
textColor: context.appColors.onPrimary,
232+
textColor: context.appColors.onSecondary,
232233
),
233234
],
234235
),

0 commit comments

Comments
 (0)