|
1 | 1 | import 'package:bb_mobile/core/errors/send_errors.dart'; |
| 2 | +import 'package:bb_mobile/core/widgets/bull_eye.dart'; |
2 | 3 | import 'package:bb_mobile/core/swaps/domain/entity/swap.dart'; |
3 | 4 | import 'package:bb_mobile/core/themes/app_theme.dart'; |
4 | 5 | import 'package:bb_mobile/core/utils/build_context_x.dart'; |
5 | | -import 'package:bb_mobile/core/utils/string_formatting.dart'; |
6 | 6 | import 'package:bb_mobile/core/widgets/buttons/button.dart'; |
7 | 7 | import 'package:bb_mobile/core/widgets/text/text.dart'; |
8 | 8 | import 'package:bb_mobile/features/bitcoin_price/ui/currency_text.dart'; |
9 | 9 | import 'package:bb_mobile/generated/flutter_gen/assets.gen.dart'; |
10 | 10 | import 'package:flutter/material.dart'; |
11 | 11 | import 'package:flutter/services.dart'; |
12 | | -import 'package:flutter_bloc/flutter_bloc.dart'; |
13 | 12 | import 'package:gap/gap.dart'; |
14 | 13 |
|
15 | 14 | enum SendType { send, swap } |
@@ -160,31 +159,10 @@ class CommonOnchainSendInfoSection extends StatelessWidget { |
160 | 159 | _divider(context), |
161 | 160 | CommonInfoRow( |
162 | 161 | title: context.loc.coreScreensToLabel, |
163 | | - details: Row( |
164 | | - mainAxisAlignment: .end, |
165 | | - mainAxisSize: .min, |
166 | | - children: [ |
167 | | - Expanded( |
168 | | - child: BBText( |
169 | | - _receiveWalletLabel, |
170 | | - style: context.font.bodyLarge?.copyWith( |
171 | | - color: context.appColors.secondary, |
172 | | - ), |
173 | | - textAlign: .end, |
174 | | - ), |
175 | | - ), |
176 | | - const Gap(4), |
177 | | - InkWell( |
178 | | - child: Icon( |
179 | | - Icons.copy, |
180 | | - color: context.appColors.primary, |
181 | | - size: 16, |
182 | | - ), |
183 | | - onTap: () { |
184 | | - Clipboard.setData(ClipboardData(text: _receiveWalletLabel)); |
185 | | - }, |
186 | | - ), |
187 | | - ], |
| 162 | + details: BullEye.address( |
| 163 | + _receiveWalletLabel, |
| 164 | + style: context.font.bodyLarge, |
| 165 | + color: context.appColors.secondary, |
188 | 166 | ), |
189 | 167 | ), |
190 | 168 | if (_isToSelf) ...[ |
@@ -312,40 +290,12 @@ class CommonLnSwapSendInfoSection extends StatelessWidget { |
312 | 290 | _divider(context), |
313 | 291 | CommonInfoRow( |
314 | 292 | title: context.loc.coreScreensToLabel, |
315 | | - details: Row( |
316 | | - mainAxisAlignment: .end, |
317 | | - mainAxisSize: .min, |
318 | | - children: [ |
319 | | - BBText( |
320 | | - StringFormatting.truncateMiddle(_paymentRequestAddress), |
321 | | - style: context.font.bodyLarge?.copyWith( |
322 | | - color: context.appColors.secondary, |
323 | | - ), |
324 | | - textAlign: .end, |
325 | | - ), |
326 | | - const Gap(4), |
327 | | - InkWell( |
328 | | - child: Icon( |
329 | | - Icons.copy, |
330 | | - color: context.appColors.primary, |
331 | | - size: 16, |
332 | | - ), |
333 | | - onTap: () { |
334 | | - Clipboard.setData( |
335 | | - ClipboardData(text: _paymentRequestAddress), |
336 | | - ); |
337 | | - }, |
338 | | - ), |
339 | | - ], |
| 293 | + details: BullEye.address( |
| 294 | + _paymentRequestAddress, |
| 295 | + style: context.font.bodyLarge?.copyWith( |
| 296 | + color: context.appColors.secondary, |
| 297 | + ), |
340 | 298 | ), |
341 | | - // const Gap(4), |
342 | | - // InkWell( |
343 | | - // child: Icon( |
344 | | - // Icons.copy, |
345 | | - // color: context.colour.primary, |
346 | | - // size: 16, |
347 | | - // ), |
348 | | - // ), |
349 | 299 | ), |
350 | 300 | _divider(context), |
351 | 301 | CommonInfoRow( |
@@ -560,35 +510,11 @@ class CommonChainSwapSendInfoSection extends StatelessWidget { |
560 | 510 | swap.isChainSwap && |
561 | 511 | (swap as ChainSwap).receiveWalletId == null && |
562 | 512 | (swap as ChainSwap).receiveAddress != null |
563 | | - ? Row( |
564 | | - mainAxisAlignment: .end, |
565 | | - mainAxisSize: .min, |
566 | | - children: [ |
567 | | - BBText( |
568 | | - StringFormatting.truncateMiddle( |
569 | | - (swap as ChainSwap).receiveAddress!, |
570 | | - ), |
571 | | - style: context.font.bodyLarge?.copyWith( |
572 | | - color: context.appColors.secondary, |
573 | | - ), |
574 | | - textAlign: .end, |
575 | | - ), |
576 | | - const Gap(4), |
577 | | - InkWell( |
578 | | - child: Icon( |
579 | | - Icons.copy, |
580 | | - color: context.appColors.primary, |
581 | | - size: 16, |
582 | | - ), |
583 | | - onTap: () { |
584 | | - Clipboard.setData( |
585 | | - ClipboardData( |
586 | | - text: (swap as ChainSwap).receiveAddress!, |
587 | | - ), |
588 | | - ); |
589 | | - }, |
590 | | - ), |
591 | | - ], |
| 513 | + ? BullEye.address( |
| 514 | + (swap as ChainSwap).receiveAddress!, |
| 515 | + style: context.font.bodyLarge?.copyWith( |
| 516 | + color: context.appColors.secondary, |
| 517 | + ), |
592 | 518 | ) |
593 | 519 | : receiveWalletLabel != null && receiveWalletLabel!.isNotEmpty |
594 | 520 | ? BBText( |
@@ -704,56 +630,21 @@ class CommonChainSwapSendInfoSection extends StatelessWidget { |
704 | 630 |
|
705 | 631 | class CommonSendBottomButtons extends StatelessWidget { |
706 | 632 | const CommonSendBottomButtons({ |
707 | | - required bool isBitcoinWallet, |
708 | | - required StateStreamableSource<Object?> blocProviderValue, |
709 | 633 | required bool disableSendButton, |
710 | 634 | required Function onSendPressed, |
711 | | - }) : _isBitcoinWallet = isBitcoinWallet, |
712 | | - _blocProviderValue = blocProviderValue, |
713 | | - _disableSendButton = disableSendButton, |
| 635 | + }) : _disableSendButton = disableSendButton, |
714 | 636 | _onSendPressed = onSendPressed; |
715 | 637 |
|
716 | | - // ignore: unused_field |
717 | | - final bool _isBitcoinWallet; |
718 | | - // ignore: unused_field |
719 | | - final StateStreamableSource<Object?> _blocProviderValue; |
720 | 638 | final bool _disableSendButton; |
721 | 639 | final Function _onSendPressed; |
722 | 640 |
|
723 | 641 | @override |
724 | 642 | Widget build(BuildContext context) { |
725 | 643 | return Padding( |
726 | 644 | padding: const EdgeInsets.symmetric(horizontal: 16), |
727 | | - child: Column( |
728 | | - crossAxisAlignment: .stretch, |
729 | | - children: [ |
730 | | - // if (_isBitcoinWallet) ...[ |
731 | | - // BBButton.big( |
732 | | - // label: 'Advanced Settings', |
733 | | - // onPressed: () { |
734 | | - // showModalBottomSheet( |
735 | | - // context: context, |
736 | | - // isScrollControlled: true, |
737 | | - // backgroundColor: context.colour.secondaryFixed, |
738 | | - // builder: |
739 | | - // (BuildContext buildContext) => BlocProvider.value( |
740 | | - // value: _blocProviderValue, |
741 | | - // child: const AdvancedOptionsBottomSheet(), |
742 | | - // ), |
743 | | - // ); |
744 | | - // }, |
745 | | - // borderColor: context.colour.secondary, |
746 | | - // outlined: true, |
747 | | - // bgColor: context.appColors.transparent, |
748 | | - // textColor: context.colour.secondary, |
749 | | - // ), |
750 | | - // const Gap(12), |
751 | | - // ], |
752 | | - CommonConfirmSendButton( |
753 | | - disableSendButton: _disableSendButton, |
754 | | - onPressed: _onSendPressed, |
755 | | - ), |
756 | | - ], |
| 645 | + child: CommonConfirmSendButton( |
| 646 | + disableSendButton: _disableSendButton, |
| 647 | + onPressed: _onSendPressed, |
757 | 648 | ), |
758 | 649 | ); |
759 | 650 | } |
|
0 commit comments