Skip to content

Commit d23489c

Browse files
committed
refactor(BullEye): split into AddressViewer, TransactionViewer, InvoiceViewer
Each widget handles its own concerns: AddressViewer auto-detects network, TransactionViewer has typed constructors (.bitcoin/.liquid/.ark) with Ark explorer at explorer.arkade.sh, InvoiceViewer is copy-only. Renamed localization keys and translated 5 missing languages.
1 parent f5784cb commit d23489c

44 files changed

Lines changed: 835 additions & 344 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

lib/core/mempool/domain/services/mempool_url_builder.dart

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,26 @@ class MempoolUrlBuilder {
2828
);
2929
return '${server.fullUrl}/$unblindedUrl';
3030
}
31+
32+
Future<String> bitcoinAddressUrl(
33+
String address, {
34+
required bool isTestnet,
35+
}) async {
36+
final server = await _getActiveMempoolServerUsecase.execute(
37+
isTestnet: isTestnet,
38+
isLiquid: false,
39+
);
40+
return '${server.fullUrl}/address/$address';
41+
}
42+
43+
Future<String> liquidAddressUrl(
44+
String address, {
45+
required bool isTestnet,
46+
}) async {
47+
final server = await _getActiveMempoolServerUsecase.execute(
48+
isTestnet: isTestnet,
49+
isLiquid: true,
50+
);
51+
return '${server.fullUrl}/address/$address';
52+
}
3153
}

lib/core/screens/send_confirm_screen.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import 'package:bb_mobile/core/errors/send_errors.dart';
2-
import 'package:bb_mobile/core/widgets/bull_eye.dart';
2+
import 'package:bb_mobile/core/widgets/address_viewer.dart';
33
import 'package:bb_mobile/core/swaps/domain/entity/swap.dart';
44
import 'package:bb_mobile/core/themes/app_theme.dart';
55
import 'package:bb_mobile/core/utils/build_context_x.dart';
@@ -159,7 +159,7 @@ class CommonOnchainSendInfoSection extends StatelessWidget {
159159
_divider(context),
160160
CommonInfoRow(
161161
title: context.loc.coreScreensToLabel,
162-
details: BullEye.address(
162+
details: AddressViewer(
163163
_receiveWalletLabel,
164164
style: context.font.bodyLarge,
165165
color: context.appColors.secondary,
@@ -295,7 +295,7 @@ class CommonLnSwapSendInfoSection extends StatelessWidget {
295295
mainAxisSize: MainAxisSize.min,
296296
children: [
297297
Expanded(
298-
child: BullEye.address(
298+
child: AddressViewer(
299299
_paymentRequestAddress,
300300
style: context.font.bodyLarge?.copyWith(
301301
color: context.appColors.secondary,
@@ -536,7 +536,7 @@ class CommonChainSwapSendInfoSection extends StatelessWidget {
536536
mainAxisSize: MainAxisSize.min,
537537
children: [
538538
Expanded(
539-
child: BullEye.address(
539+
child: AddressViewer(
540540
(swap as ChainSwap).receiveAddress!,
541541
style: context.font.bodyLarge?.copyWith(
542542
color: context.appColors.secondary,

lib/core/transactions/ui/transaction_screen.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import 'package:bb_mobile/core/transactions/domain/error/transaction_error.dart'
55
import 'package:bb_mobile/core/transactions/presentation/transaction_cubit.dart';
66
import 'package:bb_mobile/core/transactions/presentation/transaction_state.dart';
77
import 'package:bb_mobile/core/utils/build_context_x.dart';
8-
import 'package:bb_mobile/core/widgets/bull_eye.dart';
8+
import 'package:bb_mobile/core/widgets/address_viewer.dart';
99
import 'package:bb_mobile/core/widgets/loading/fading_linear_progress.dart';
1010
import 'package:bb_mobile/core/widgets/text/text.dart';
1111
import 'package:flutter/material.dart';
@@ -398,7 +398,7 @@ class _SummarySection extends StatelessWidget {
398398
label: context.loc.coreScreensToLabel,
399399
child: Align(
400400
alignment: Alignment.centerRight,
401-
child: BullEye.address(
401+
child: AddressViewer(
402402
toLabel!,
403403
style: context.font.bodyLarge,
404404
color: context.appColors.secondary,
@@ -453,7 +453,7 @@ class _InputAddressRow extends StatelessWidget {
453453
children: [
454454
SizedBox(
455455
width: double.infinity,
456-
child: BullEye.address(
456+
child: AddressViewer(
457457
fullAddress,
458458
style: context.font.bodySmall,
459459
color: context.appColors.secondary,
@@ -488,7 +488,7 @@ class _OutputAddressRow extends StatelessWidget {
488488
children: [
489489
SizedBox(
490490
width: double.infinity,
491-
child: BullEye.address(
491+
child: AddressViewer(
492492
fullAddress,
493493
style: context.font.bodySmall,
494494
color: context.appColors.secondary,

0 commit comments

Comments
 (0)