nodes pages fixes

This commit is contained in:
fosse 2023-09-07 12:05:27 -04:00
parent bb397cd3ee
commit bda4684f50
2 changed files with 36 additions and 29 deletions

View file

@ -42,6 +42,9 @@ class ManageNodesPage extends BasePage {
return nodeListViewModel.nodes.length; return nodeListViewModel.nodes.length;
}, },
itemBuilder: (_, index) { itemBuilder: (_, index) {
if (index > nodeListViewModel.nodes.length - 1) {
return SizedBox();
}
return Observer( return Observer(
builder: (context) { builder: (context) {
final node = nodeListViewModel.nodes[index]; final node = nodeListViewModel.nodes[index];

View file

@ -1,14 +1,11 @@
import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/routes.dart';
import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/src/screens/base_page.dart';
import 'package:cake_wallet/src/screens/nodes/widgets/node_list_row.dart';
import 'package:cake_wallet/src/screens/nodes/widgets/pow_node_list_row.dart'; import 'package:cake_wallet/src/screens/nodes/widgets/pow_node_list_row.dart';
import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart'; import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
import 'package:cake_wallet/src/widgets/standard_list.dart'; import 'package:cake_wallet/src/widgets/standard_list.dart';
import 'package:cake_wallet/utils/show_pop_up.dart'; import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:cake_wallet/view_model/node_list/node_list_view_model.dart';
import 'package:cake_wallet/view_model/node_list/pow_node_list_view_model.dart'; import 'package:cake_wallet/view_model/node_list/pow_node_list_view_model.dart';
import 'package:cw_core/node.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:flutter_mobx/flutter_mobx.dart';
@ -45,6 +42,11 @@ class ManagePowNodesPage extends BasePage {
return nodeListViewModel.nodes.length; return nodeListViewModel.nodes.length;
}, },
itemBuilder: (_, index) { itemBuilder: (_, index) {
return Observer(
builder: (context) {
if (index > nodeListViewModel.nodes.length - 1) {
return SizedBox();
}
final node = nodeListViewModel.nodes[index]; final node = nodeListViewModel.nodes[index];
final isSelected = node.keyIndex == nodeListViewModel.currentNode.keyIndex; final isSelected = node.keyIndex == nodeListViewModel.currentNode.keyIndex;
final nodeListRow = PowNodeListRow( final nodeListRow = PowNodeListRow(
@ -76,6 +78,8 @@ class ManagePowNodesPage extends BasePage {
return nodeListRow; return nodeListRow;
}, },
);
},
), ),
); );
}, },