From 25b743df47d6ac6949ea0feaad6fa691796da093 Mon Sep 17 00:00:00 2001 From: Godwin Asuquo <41484542+godilite@users.noreply.github.com> Date: Fri, 5 May 2023 03:15:35 +0300 Subject: [PATCH] CW-368 Fix Range error accessing outputs (#912) --- .../screens/send/widgets/confirm_sending_alert.dart | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/src/screens/send/widgets/confirm_sending_alert.dart b/lib/src/screens/send/widgets/confirm_sending_alert.dart index a034d801e..3d5f5c928 100644 --- a/lib/src/screens/send/widgets/confirm_sending_alert.dart +++ b/lib/src/screens/send/widgets/confirm_sending_alert.dart @@ -142,10 +142,8 @@ class ConfirmSendingAlertContentState extends State required this.feeValue, required this.feeFiatAmount, required this.outputs}) - : itemCount = 0, - recipientTitle = '' { - itemCount = outputs.length; - recipientTitle = itemCount > 1 + : recipientTitle = '' { + recipientTitle = outputs.length > 1 ? S.current.transaction_details_recipient_address : S.current.recipient_address; } @@ -165,7 +163,6 @@ class ConfirmSendingAlertContentState extends State ScrollController controller = ScrollController(); double fromTop = 0; String recipientTitle; - int itemCount; bool showScrollbar = false; @override @@ -342,12 +339,12 @@ class ConfirmSendingAlertContentState extends State decoration: TextDecoration.none, ), ), - itemCount > 1 + outputs.length > 1 ? ListView.builder( padding: EdgeInsets.only(top: 0), shrinkWrap: true, physics: NeverScrollableScrollPhysics(), - itemCount: itemCount, + itemCount: outputs.length, itemBuilder: (context, index) { final item = outputs[index]; final _address = item.isParsedAddress