From 5b4f2de6974682396045ba87d70a26b50cc2a80e Mon Sep 17 00:00:00 2001 From: ice-hector <96414297+ice-hector@users.noreply.github.com> Date: Wed, 31 Jul 2024 16:38:38 +0300 Subject: [PATCH 1/3] chore: add action buttons --- .../icons/1.5x/icon_button_internet.png | Bin 0 -> 1177 bytes .../icons/2.0x/icon_button_internet.png | Bin 0 -> 1546 bytes .../icons/3.0x/icon_button_internet.png | Bin 0 -> 2395 bytes .../icons/4.0x/icon_button_internet.png | Bin 0 -> 2921 bytes assets/images/icons/icon_button_internet.png | Bin 0 -> 737 bytes .../transaction_details.dart | 8 ++- .../transaction_details_actions.dart | 46 ++++++++++++++++++ lib/l10n/app_en.arb | 3 +- 8 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 assets/images/icons/1.5x/icon_button_internet.png create mode 100644 assets/images/icons/2.0x/icon_button_internet.png create mode 100644 assets/images/icons/3.0x/icon_button_internet.png create mode 100644 assets/images/icons/4.0x/icon_button_internet.png create mode 100644 assets/images/icons/icon_button_internet.png create mode 100644 lib/app/features/wallet/views/pages/transaction_details/transaction_details_actions.dart diff --git a/assets/images/icons/1.5x/icon_button_internet.png b/assets/images/icons/1.5x/icon_button_internet.png new file mode 100644 index 0000000000000000000000000000000000000000..d0234e1dab4cdeca788606e63fa588d4d3f8832c GIT binary patch literal 1177 zcmV;K1ZMk*P)-K|24=W)>0&w? z2FUlFR~}i`=}aIUJ9E}qD}B4#KkX^?Mt%y^3#nSIhUWivyPc>P(6bey0(W0kO679-D};T+-w;oX=Lk;^&nL_`&(F{Iudc36mzI_mIY%Whe?$xN02ud{mzNdR z{LGU#=VPv~uZP3o@B*)UcoGO%gYY%F0zzt>!_(617Zw&8;<9S7SZrf$8SlHYx3RIY zaY@X7QivM?PGuM;ClIy*v&ZSCxw(k3!+Fyc2=bF9x4wZXesCbf}3Y&XDyr0f{PmW z$9Ai2Ay(F|r_6^kX7Np|zO`q9#7zmFic=xRk6e_Qrq&lJ#$1;nITCYE260V^)|ygC z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(@?qu<2;NB10L9it{H*( zTv0#+TCP?qIrsH~ejRztKn&3@yG{f$AOw%wZk{4RN5;gf7MW4&NCBKnU$ZQO;EiGL zHw`9-S)h6F(9*G|c6I*(e+5OM~!@ML@^q%qXbkDah zxF0l=z0Ximb5p5phsllvTBXTdoI)Empa8RNu7p3!n&TWOO*?iKLK_+H4&00d$5toV z)nm2i@`y^WYkvR4OSLe``{b!z2dEz_wqy7rb!da3P4y+YDf$p9ec*8Xg9SJ6XM0s} zd_t-JaCl}OnX{}xdxBqfoJs_uz7JS{X~#RGQ$5~(sPIphyRxLLgUqJY))Os9r)Vbr z$QSssGR{2k4Zw%qLJyo*(X&tdA`{}`;^GXy?)?1xDFkJJex)(;EZa5w>w;!j!sjpW wsA;VG9sT}1KR^F2KNIxa75%|G-tn{WFCpMu|1VU0Qvd(}07*qoM6N<$f}%9oMgRZ+ literal 0 HcmV?d00001 diff --git a/assets/images/icons/3.0x/icon_button_internet.png b/assets/images/icons/3.0x/icon_button_internet.png new file mode 100644 index 0000000000000000000000000000000000000000..c80a9da7da78887197e4ab743512c66de6b89325 GIT binary patch literal 2395 zcmV-h38eOkP) z6iE;*e+V2d*=08tA36ynOvXhF86YIqzrf2cz|JnS{R?ce%WQ`iv6c{!v1FIAml=V? zkZ}=9W{|=69_}%<<(`@D*|80}ebQ>Td;0TDb#--ht;iT-j4{R-KP)EX6wz+CTli}2 z?d>IBzI`}_NYsi~>K*RNj(Po6yK%PHbS2?8O>r%#{SAmS=WNRgEURwYRp z>TQFx-m_=VGC3g}J3*9^&!0a(03jU-C!`8}koE8+$T~KH?%utdV%aR?XDY`C5VZ-S zR*#FQ#tFK0>sEq6Z%7<589qzYJ$c6DIbt&?-LEVfTv2!?P7A_El*JlhObvHJH$I40^>g@E$%( zXU?3N#lY`#r!r;wmK@^g)2HjMZjL!h81g%8i=@hdbRGwfL3OI?x}!yo%(rtD0s5@#%!ItH2UT^r+sRRq zHez?TD1zLMlBleH2sxBG8Q!^i5&=r4k)l?JG+-$%qA$IRT$-20b5A z7s`0SWIdEfpsyiw0TXRk)giIyn`6vWcIu4KAOsOav7`Z}^W1iuh19pptB!5rw)RYA zEd6rlkZ0J4GU+A(3X0NPV>60`A~@y{JIx5(7a& zJH=0qdu0y`mzZaHWl~R^6P4~sGf36%Ohz16+1ajei9vz!%%!uA_;#w`4w;Ed4nhy7 zRlxTCA@@JgDz9>xcQHUFq$Acl;lP(4o@0ZqH&0gCM8Em-xAcK9->`pCd2& zQZNK%+x$Q3cdJh4_R>z8!-mz1bi$**moaxS}jw9FEZrM>kb)+VyE1vTvGnMZH8yMwX3DlW0%dA&Xh4)vb zcW-EqzMNdb7>Av}=v#!IT=xW6@Zxg=%W|P=>H1Jg5Z=rtI$zEw=z=Jt{K_WyX;2nq z6$-v2W2L8Z5NVR(d$u5MF?Gu>Dhjsru<8jrNot7e(0w|5H?>R#4c@ToH2>P5(~Lc$ zk`@ymM7Su}x1sZ>Jk2vQ%XAPG?`M}}NZ3jhLVU`UCI(SCqB8UN+p-I>ohk`(r{1n^ zoMI}0;3?VoZ|+Gm&_3n4BDX912T`-Wn1T@7Daap$hL&syT#Vspmua0?K@Wx`vuf$` z^pA1O%F$&;QUp&82O1PX{S!=GOzPiB#Q86;K-v%K?1ZfXRAguIM zMu10Ar?yP~9}@J%t7;x@d354SrOvTZ?6vQre9~0dR@rge3?a!$phjgVZvcia|Fl#( zcgRoxdKoYeZ(wP()1GchA4zyqr8>!TbV(af)`g1NMUN##72Qh6Y!NU9s%Cuj_PF`V~jDz7~_A4{{ZHU5U>6&*4h97 N002ovPDHLkV1kfocpm@& literal 0 HcmV?d00001 diff --git a/assets/images/icons/4.0x/icon_button_internet.png b/assets/images/icons/4.0x/icon_button_internet.png new file mode 100644 index 0000000000000000000000000000000000000000..c046fffcdd75029ed69b393ccc1a96eb6e5d66c1 GIT binary patch literal 2921 zcmV-v3zqbWP)@~0drDELIAGL9O(c600d`2O+f$vv5yPU3^bUMAH{{dE#0NmLF?(89V=tKT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D$|H8TZmg+m<`fp&Ia1 zUqyr=k@p)Zi^P4od1t6rjFsHv36 z27L;^3~b8v$YTbaXS2TKKr@9cwNB{SGE1M?GO#U^n57R*G_OnnunBr1W%YVJV-5^a zE?2|_!d0N1_YnsGi*1>v@W`wsi#G5)hm*v}j>qFA$(2eaPx9e#NX_YJgMqJn1lEj; z4sj*s?7A zZMWNqw8j1z%ZkCsldL@_*fh0p9?@@AK?C?73_p19uxAx$=<1snKG!nn@o~xWt635h zRZ8`r!psx%5yI9~0v{1IUpdfWF`*HhOvz;v8UBXIM#t4q=dr3{eBiraE#seIa#8rB z5m=W2-g5#YQZM2a*uR%%5~JgbZrE6b4~-!DGvUYL!AVy;iwd?+Am=zx-?IG!>3EE~ TR6Cnt00000NkvXXu0mjfpe9eM literal 0 HcmV?d00001 diff --git a/lib/app/features/wallet/views/pages/transaction_details/transaction_details.dart b/lib/app/features/wallet/views/pages/transaction_details/transaction_details.dart index 7a9d8cfd7..2e32803a9 100644 --- a/lib/app/features/wallet/views/pages/transaction_details/transaction_details.dart +++ b/lib/app/features/wallet/views/pages/transaction_details/transaction_details.dart @@ -9,6 +9,7 @@ import 'package:ice/app/features/wallet/components/timeline/timeline.dart'; import 'package:ice/app/features/wallet/providers/mock_data/wallet_assets_mock_data.dart'; import 'package:ice/app/features/wallet/views/pages/coins_flow/providers/send_asset_form_provider.dart'; import 'package:ice/app/features/wallet/views/pages/coins_flow/send_coins/components/confirmation/transaction_amount_summary.dart'; +import 'package:ice/app/features/wallet/views/pages/transaction_details/transaction_details_actions.dart'; import 'package:ice/app/router/components/navigation_app_bar/navigation_app_bar.dart'; import 'package:ice/app/router/components/navigation_app_bar/navigation_close_button.dart'; import 'package:ice/app/router/components/sheet_content/sheet_content.dart'; @@ -123,7 +124,12 @@ class TransactionDetailsPage extends ConsumerWidget { size: 16.0.s, ), ), - SizedBox(height: 12.0.s), + SizedBox(height: 15.0.s), + TransactionDetailsActions( + onViewOnExplorer: () {}, + onShare: () {}, + ), + SizedBox(height: 8.0.s), ], ), ), diff --git a/lib/app/features/wallet/views/pages/transaction_details/transaction_details_actions.dart b/lib/app/features/wallet/views/pages/transaction_details/transaction_details_actions.dart new file mode 100644 index 000000000..54be2fa95 --- /dev/null +++ b/lib/app/features/wallet/views/pages/transaction_details/transaction_details_actions.dart @@ -0,0 +1,46 @@ +import 'package:flutter/material.dart'; +import 'package:ice/app/components/button/button.dart'; +import 'package:ice/app/extensions/extensions.dart'; +import 'package:ice/generated/assets.gen.dart'; + +class TransactionDetailsActions extends StatelessWidget { + const TransactionDetailsActions({ + required this.onViewOnExplorer, + required this.onShare, + super.key, + }); + + final VoidCallback onViewOnExplorer; + final VoidCallback onShare; + + @override + Widget build(BuildContext context) { + return Row( + children: [ + Expanded( + child: Button( + type: ButtonType.outlined, + label: Text( + context.i18n.transaction_details_view_on_explorer, + ), + mainAxisSize: MainAxisSize.max, + leadingIcon: Assets.images.icons.iconButtonInternet.icon(), + onPressed: onViewOnExplorer, + backgroundColor: context.theme.appColors.tertararyBackground, + borderColor: context.theme.appColors.onTerararyFill, + ), + ), + SizedBox( + width: 12.0.s, + ), + Button.icon( + icon: Assets.images.icons.iconButtonShare.icon(), + type: ButtonType.outlined, + onPressed: onShare, + backgroundColor: context.theme.appColors.tertararyBackground, + borderColor: context.theme.appColors.onTerararyFill, + ), + ], + ); + } +} diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index e79160f14..b19c817c8 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -234,5 +234,6 @@ "send_nft_confirm_network": "Network", "send_nft_confirm_arrival_time": "Arrival time", "send_nft_confirm_network_fee": "Network fee", - "transaction_details_title": "Transaction details" + "transaction_details_title": "Transaction details", + "transaction_details_view_on_explorer": "View on explorer" } From ca22ef8b4c1f5c156044645aa5e8b03b0d794593 Mon Sep 17 00:00:00 2001 From: ice-hector <96414297+ice-hector@users.noreply.github.com> Date: Wed, 31 Jul 2024 19:48:52 +0300 Subject: [PATCH 2/3] chore: connect nft transaction details route opening --- .../wallet/components/nft_item/nft_item.dart | 2 +- .../confirmation/confirmation_sheet.dart | 3 +- .../transaction_result_sheet.dart | 29 ++++++++++++++----- .../send_nft_confirm/send_nft_confirm.dart | 2 +- lib/app/router/wallet_routes.dart | 21 +++++++++++--- 5 files changed, 43 insertions(+), 14 deletions(-) diff --git a/lib/app/features/wallet/components/nft_item/nft_item.dart b/lib/app/features/wallet/components/nft_item/nft_item.dart index 879cd0b40..ed8fc5244 100644 --- a/lib/app/features/wallet/components/nft_item/nft_item.dart +++ b/lib/app/features/wallet/components/nft_item/nft_item.dart @@ -34,7 +34,7 @@ class NftItem extends StatelessWidget { children: [ Padding( padding: EdgeInsets.only(right: 5.0.s), - child: Assets.images.wallet.walletEth.icon(size: 16.0.s), + child: Assets.images.wallet.walletEth.icon(size: 12.0.s), ), Padding( padding: EdgeInsets.only(right: 4.0.s), diff --git a/lib/app/features/wallet/views/pages/coins_flow/send_coins/components/confirmation/confirmation_sheet.dart b/lib/app/features/wallet/views/pages/coins_flow/send_coins/components/confirmation/confirmation_sheet.dart index e5c8644df..5fe010080 100644 --- a/lib/app/features/wallet/views/pages/coins_flow/send_coins/components/confirmation/confirmation_sheet.dart +++ b/lib/app/features/wallet/views/pages/coins_flow/send_coins/components/confirmation/confirmation_sheet.dart @@ -107,7 +107,8 @@ class ConfirmationSheet extends ConsumerWidget { Button( label: Text('${locale.button_confirm} - \$351.35'), mainAxisSize: MainAxisSize.max, - onPressed: () => TransactionResultRoute().go(context), + onPressed: () => + CoinTransactionResultRoute($extra: CryptoAssetType.coin).go(context), ), SizedBox(height: 16.0.s), ], diff --git a/lib/app/features/wallet/views/pages/coins_flow/send_coins/components/confirmation/transaction_result_sheet.dart b/lib/app/features/wallet/views/pages/coins_flow/send_coins/components/confirmation/transaction_result_sheet.dart index 1ee783f01..a6cddf5e6 100644 --- a/lib/app/features/wallet/views/pages/coins_flow/send_coins/components/confirmation/transaction_result_sheet.dart +++ b/lib/app/features/wallet/views/pages/coins_flow/send_coins/components/confirmation/transaction_result_sheet.dart @@ -3,6 +3,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:ice/app/components/button/button.dart'; import 'package:ice/app/components/screen_offset/screen_side_offset.dart'; import 'package:ice/app/extensions/extensions.dart'; +import 'package:ice/app/features/wallet/components/nft_item/nft_item.dart'; import 'package:ice/app/features/wallet/model/network_type.dart'; import 'package:ice/app/features/wallet/providers/mock_data/wallet_assets_mock_data.dart'; import 'package:ice/app/features/wallet/views/pages/coins_flow/providers/send_asset_form_provider.dart'; @@ -12,19 +13,23 @@ import 'package:ice/app/router/components/sheet_content/sheet_content.dart'; import 'package:ice/generated/assets.gen.dart'; class TransactionResultSheet extends ConsumerWidget { - const TransactionResultSheet({super.key}); + const TransactionResultSheet({super.key, required this.type}); + + final CryptoAssetType type; static const networkTypeValues = NetworkType.values; @override Widget build(BuildContext context, WidgetRef ref) { + final controller = ref.watch(sendAssetFormControllerProvider(type: type).notifier); + final formData = ref.watch(sendAssetFormControllerProvider(type: type)); + final isNft = type == CryptoAssetType.nft; + final colors = context.theme.appColors; final textTheme = context.theme.appTextThemes; final locale = context.i18n; final icons = Assets.images.icons; - final formData = ref.watch(sendAssetFormControllerProvider()); - return SheetContent( body: ScreenSideOffset.small( child: Column( @@ -43,10 +48,20 @@ class TransactionResultSheet extends ConsumerWidget { ), ), SizedBox(height: 36.0.s), - if (formData.usdtAmount != null) + if (isNft && formData.selectedNft != null) + Padding( + padding: EdgeInsets.symmetric( + horizontal: 52.0.s, + ), + child: NftItem( + nftData: formData.selectedNft!, + backgroundColor: Colors.transparent, + ), + ), + if (!isNft && formData.selectedCoin != null) TransactionAmountSummary( - usdtAmount: formData.usdtAmount!, - usdAmount: formData.usdtAmount! * 0.999, + usdtAmount: controller.getUsdtAmount(), + usdAmount: controller.getUsdtAmount() * 0.999, icon: mockedCoinsDataArray[3].iconUrl.icon(), ), SizedBox(height: 31.0.s), @@ -55,7 +70,7 @@ class TransactionResultSheet extends ConsumerWidget { leadingIcon: icons.iconButtonDetails.icon(), mainAxisSize: MainAxisSize.max, onPressed: () { - CoinTransactionDetailsRoute($extra: CryptoAssetType.coin).push(context); + CoinTransactionDetailsRoute($extra: type).push(context); }, ), SizedBox(height: 12.0.s), diff --git a/lib/app/features/wallet/views/pages/send_nft_confirm/send_nft_confirm.dart b/lib/app/features/wallet/views/pages/send_nft_confirm/send_nft_confirm.dart index 0f331a5ed..50bebed35 100644 --- a/lib/app/features/wallet/views/pages/send_nft_confirm/send_nft_confirm.dart +++ b/lib/app/features/wallet/views/pages/send_nft_confirm/send_nft_confirm.dart @@ -104,7 +104,7 @@ class SendNftConfirmPage extends ConsumerWidget { context.i18n.button_confirm, ), onPressed: () { - NftTransactionDetailsRoute($extra: CryptoAssetType.nft).push(context); + CoinTransactionResultRoute($extra: CryptoAssetType.nft).go(context); }, ), ], diff --git a/lib/app/router/wallet_routes.dart b/lib/app/router/wallet_routes.dart index 45b5e8a36..e9e984d58 100644 --- a/lib/app/router/wallet_routes.dart +++ b/lib/app/router/wallet_routes.dart @@ -55,6 +55,7 @@ class WalletRoutes { TypedGoRoute(path: 'nfts-sorting'), TypedGoRoute(path: 'nft-send'), TypedGoRoute(path: 'nft-confirm'), + TypedGoRoute(path: 'nft-transaction-result'), TypedGoRoute(path: 'nft-transaction-details'), ], ), @@ -76,7 +77,7 @@ class WalletRoutes { ), ], ), - TypedGoRoute(path: 'transaction-result'), + TypedGoRoute(path: 'coin-transaction-result'), TypedGoRoute(path: 'coin-transaction-details'), ]; @@ -209,12 +210,24 @@ class CoinsSendFormConfirmationRoute extends BaseRouteData { ); } -class TransactionResultRoute extends BaseRouteData { - TransactionResultRoute() +class CoinTransactionResultRoute extends BaseRouteData { + CoinTransactionResultRoute({required this.$extra}) : super( - child: const TransactionResultSheet(), + child: TransactionResultSheet(type: $extra), type: IceRouteType.bottomSheet, ); + + final CryptoAssetType $extra; +} + +class NftTransactionResultRoute extends BaseRouteData { + NftTransactionResultRoute({required this.$extra}) + : super( + child: TransactionResultSheet(type: $extra), + type: IceRouteType.bottomSheet, + ); + + final CryptoAssetType $extra; } class CoinsDetailsRoute extends BaseRouteData { From 8ebd07f0eca5aaabf702c7094fe3593abca2c1ed Mon Sep 17 00:00:00 2001 From: ice-hector <96414297+ice-hector@users.noreply.github.com> Date: Thu, 1 Aug 2024 12:32:36 +0300 Subject: [PATCH 3/3] chore: remove isNft flag --- .../components/confirmation/transaction_result_sheet.dart | 5 ++--- .../views/pages/transaction_details/transaction_details.dart | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/app/features/wallet/views/pages/coins_flow/send_coins/components/confirmation/transaction_result_sheet.dart b/lib/app/features/wallet/views/pages/coins_flow/send_coins/components/confirmation/transaction_result_sheet.dart index a6cddf5e6..347f8fc01 100644 --- a/lib/app/features/wallet/views/pages/coins_flow/send_coins/components/confirmation/transaction_result_sheet.dart +++ b/lib/app/features/wallet/views/pages/coins_flow/send_coins/components/confirmation/transaction_result_sheet.dart @@ -23,7 +23,6 @@ class TransactionResultSheet extends ConsumerWidget { Widget build(BuildContext context, WidgetRef ref) { final controller = ref.watch(sendAssetFormControllerProvider(type: type).notifier); final formData = ref.watch(sendAssetFormControllerProvider(type: type)); - final isNft = type == CryptoAssetType.nft; final colors = context.theme.appColors; final textTheme = context.theme.appTextThemes; @@ -48,7 +47,7 @@ class TransactionResultSheet extends ConsumerWidget { ), ), SizedBox(height: 36.0.s), - if (isNft && formData.selectedNft != null) + if (type == CryptoAssetType.nft) Padding( padding: EdgeInsets.symmetric( horizontal: 52.0.s, @@ -58,7 +57,7 @@ class TransactionResultSheet extends ConsumerWidget { backgroundColor: Colors.transparent, ), ), - if (!isNft && formData.selectedCoin != null) + if (type == CryptoAssetType.coin) TransactionAmountSummary( usdtAmount: controller.getUsdtAmount(), usdAmount: controller.getUsdtAmount() * 0.999, diff --git a/lib/app/features/wallet/views/pages/transaction_details/transaction_details.dart b/lib/app/features/wallet/views/pages/transaction_details/transaction_details.dart index 2e32803a9..be67d1502 100644 --- a/lib/app/features/wallet/views/pages/transaction_details/transaction_details.dart +++ b/lib/app/features/wallet/views/pages/transaction_details/transaction_details.dart @@ -26,7 +26,6 @@ class TransactionDetailsPage extends ConsumerWidget { final controller = ref.watch(sendAssetFormControllerProvider(type: type).notifier); final formData = ref.watch(sendAssetFormControllerProvider(type: type)); - final isNft = type == CryptoAssetType.nft; return SheetContent( body: Column( @@ -42,7 +41,7 @@ class TransactionDetailsPage extends ConsumerWidget { padding: EdgeInsets.only(top: 10.0.s), child: Column( children: [ - if (isNft && formData.selectedNft != null) + if (type == CryptoAssetType.nft) Padding( padding: EdgeInsets.symmetric( horizontal: 52.0.s, @@ -52,7 +51,7 @@ class TransactionDetailsPage extends ConsumerWidget { backgroundColor: Colors.transparent, ), ), - if (!isNft && formData.selectedCoin != null) + if (type == CryptoAssetType.coin) TransactionAmountSummary( usdtAmount: controller.getUsdtAmount(), usdAmount: controller.getUsdtAmount() * 0.999,