CW-368 Fix Range error accessing outputs (#912)

This commit is contained in:
Godwin Asuquo 2023-05-05 03:15:35 +03:00 committed by GitHub
parent f012aaebf4
commit 25b743df47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -142,10 +142,8 @@ class ConfirmSendingAlertContentState extends State<ConfirmSendingAlertContent>
required this.feeValue, required this.feeValue,
required this.feeFiatAmount, required this.feeFiatAmount,
required this.outputs}) required this.outputs})
: itemCount = 0, : recipientTitle = '' {
recipientTitle = '' { recipientTitle = outputs.length > 1
itemCount = outputs.length;
recipientTitle = itemCount > 1
? S.current.transaction_details_recipient_address ? S.current.transaction_details_recipient_address
: S.current.recipient_address; : S.current.recipient_address;
} }
@ -165,7 +163,6 @@ class ConfirmSendingAlertContentState extends State<ConfirmSendingAlertContent>
ScrollController controller = ScrollController(); ScrollController controller = ScrollController();
double fromTop = 0; double fromTop = 0;
String recipientTitle; String recipientTitle;
int itemCount;
bool showScrollbar = false; bool showScrollbar = false;
@override @override
@ -342,12 +339,12 @@ class ConfirmSendingAlertContentState extends State<ConfirmSendingAlertContent>
decoration: TextDecoration.none, decoration: TextDecoration.none,
), ),
), ),
itemCount > 1 outputs.length > 1
? ListView.builder( ? ListView.builder(
padding: EdgeInsets.only(top: 0), padding: EdgeInsets.only(top: 0),
shrinkWrap: true, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
itemCount: itemCount, itemCount: outputs.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
final item = outputs[index]; final item = outputs[index];
final _address = item.isParsedAddress final _address = item.isParsedAddress